E. Scott Daniels | ece5bbe | 2020-07-21 13:39:18 -0400 | [diff] [blame] | 1 | .. This work is licensed under a Creative Commons Attribution 4.0 International License. |
| 2 | .. SPDX-License-Identifier: CC-BY-4.0 |
| 3 | .. CAUTION: this document is generated from source in doc/src/rtd. |
| 4 | .. To make changes edit the source and recompile the document. |
| 5 | .. Do NOT make changes directly to .rst or .md files. |
| 6 | |
| 7 | ============================================================================================ |
| 8 | Man Page: rmr_bytes2meid |
| 9 | ============================================================================================ |
| 10 | |
| 11 | |
E. Scott Daniels | a3a121c | 2020-05-06 09:07:08 -0400 | [diff] [blame] | 12 | |
| 13 | |
| 14 | RMR LIBRARY FUNCTIONS |
| 15 | ===================== |
| 16 | |
| 17 | |
| 18 | |
| 19 | NAME |
| 20 | ---- |
| 21 | |
E. Scott Daniels | ece5bbe | 2020-07-21 13:39:18 -0400 | [diff] [blame] | 22 | rmr_bytes2meid |
E. Scott Daniels | a3a121c | 2020-05-06 09:07:08 -0400 | [diff] [blame] | 23 | |
| 24 | |
| 25 | SYNOPSIS |
| 26 | -------- |
| 27 | |
E. Scott Daniels | ece5bbe | 2020-07-21 13:39:18 -0400 | [diff] [blame] | 28 | |
| 29 | :: |
| 30 | |
| 31 | #include <rmr/rmr.h> |
| 32 | |
| 33 | int rmr_bytes2meid( rmr_mbuf_t* mbuf, unsigned char* src, int len ) |
| 34 | |
E. Scott Daniels | a3a121c | 2020-05-06 09:07:08 -0400 | [diff] [blame] | 35 | |
| 36 | |
| 37 | DESCRIPTION |
| 38 | ----------- |
| 39 | |
E. Scott Daniels | ece5bbe | 2020-07-21 13:39:18 -0400 | [diff] [blame] | 40 | The ``rmr_bytes2meid`` function will copy up to *len* bytes |
| 41 | from *src* to the managed entity ID (meid) field in the |
| 42 | message. The field is a fixed length, gated by the constant |
| 43 | ``RMR_MAX_MEID`` and if len is larger than this value, only |
| 44 | RMR_MAX_MEID bytes will actually be copied. |
E. Scott Daniels | a3a121c | 2020-05-06 09:07:08 -0400 | [diff] [blame] | 45 | |
| 46 | |
| 47 | RETURN VALUE |
| 48 | ------------ |
| 49 | |
E. Scott Daniels | ece5bbe | 2020-07-21 13:39:18 -0400 | [diff] [blame] | 50 | On success, the actual number of bytes copied is returned, or |
| 51 | -1 to indicate a hard error. If the length is less than 0, or |
| 52 | not the same as length passed in, ``errno`` is set to one of |
| 53 | the errors described in the *Errors* section. |
E. Scott Daniels | a3a121c | 2020-05-06 09:07:08 -0400 | [diff] [blame] | 54 | |
| 55 | |
| 56 | ERRORS |
| 57 | ------ |
| 58 | |
E. Scott Daniels | ece5bbe | 2020-07-21 13:39:18 -0400 | [diff] [blame] | 59 | If the returned length does not match the length passed in, |
| 60 | ``errno`` will be set to one of the following constants with |
| 61 | the meaning listed below. |
| 62 | |
| 63 | .. list-table:: |
| 64 | :widths: auto |
| 65 | :header-rows: 0 |
| 66 | :class: borderless |
| 67 | |
| 68 | |
| 69 | * - **EINVAL** |
| 70 | - |
| 71 | The message, or an internal portion of the message, was |
| 72 | corrupted or the pointer was invalid. |
| 73 | |
| 74 | |
| 75 | * - **EOVERFLOW** |
| 76 | - |
| 77 | The length passed in was larger than the maximum length of |
| 78 | the field; only a portion of the source bytes were copied. |
| 79 | |
| 80 | |
E. Scott Daniels | a3a121c | 2020-05-06 09:07:08 -0400 | [diff] [blame] | 81 | |
| 82 | |
| 83 | EXAMPLE |
| 84 | ------- |
| 85 | |
| 86 | |
| 87 | |
| 88 | SEE ALSO |
| 89 | -------- |
| 90 | |
E. Scott Daniels | ece5bbe | 2020-07-21 13:39:18 -0400 | [diff] [blame] | 91 | rmr_alloc_msg(3), rmr_bytes2xact(3), rmr_call(3), |
| 92 | rmr_free_msg(3), rmr_get_rcvfd(3), rmr_get_meid(3), |
| 93 | rmr_payload_size(3), rmr_send_msg(3), rmr_rcv_msg(3), |
| 94 | rmr_rcv_specific(3), rmr_rts_msg(3), rmr_ready(3), |
| 95 | rmr_fib(3), rmr_has_str(3), rmr_tokenise(3), rmr_mk_ring(3), |
| 96 | rmr_ring_free(3), rmr_str2meid(3), rmr_str2xact(3), |
| 97 | rmr_wh_open(3), rmr_wh_send_msg(3) |