zmq_msg_init_buffer.txt 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. zmq_msg_init_buffer(3)
  2. ======================
  3. NAME
  4. ----
  5. zmq_msg_init_buffer - initialise 0MQ message with buffer copy
  6. SYNOPSIS
  7. --------
  8. *int zmq_msg_init_buffer (zmq_msg_t '*msg', const void '*buf', size_t 'size');*
  9. DESCRIPTION
  10. -----------
  11. The _zmq_msg_init_buffer()_ function shall allocate any resources required to
  12. store a message 'size' bytes long and initialise the message object referenced
  13. by 'msg' to represent a copy of the buffer referenced by the 'buf' and
  14. 'size' arguments.
  15. The implementation shall choose whether to store message content on the stack
  16. (small messages) or on the heap (large messages).
  17. CAUTION: Never access 'zmq_msg_t' members directly, instead always use the
  18. _zmq_msg_ family of functions.
  19. CAUTION: The functions _zmq_msg_init()_, _zmq_msg_init_data()_,
  20. _zmq_msg_init_buffer()_ and _zmq_msg_init_buffer()_ are mutually exclusive.
  21. Never initialise the same 'zmq_msg_t' twice.
  22. RETURN VALUE
  23. ------------
  24. The _zmq_msg_init_buffer()_ function shall return zero if successful. Otherwise
  25. it shall return `-1` and set 'errno' to one of the values defined below.
  26. ERRORS
  27. ------
  28. *ENOMEM*::
  29. Insufficient storage space is available.
  30. SEE ALSO
  31. --------
  32. linkzmq:zmq_msg_init_data[3]
  33. linkzmq:zmq_msg_init_size[3]
  34. linkzmq:zmq_msg_init[3]
  35. linkzmq:zmq_msg_close[3]
  36. linkzmq:zmq_msg_data[3]
  37. linkzmq:zmq_msg_size[3]
  38. linkzmq:zmq[7]
  39. AUTHORS
  40. -------
  41. This page was written by the 0MQ community. To make a change please
  42. read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.