Commit d092f261 authored by Pieter Hintjens's avatar Pieter Hintjens

Renamed peek/poke to get/set

parent dcc1725a
......@@ -3,7 +3,7 @@ MAN3 = zmq_bind.3 zmq_close.3 zmq_connect.3 zmq_init.3 \
zmq_msg_init_data.3 zmq_msg_init_size.3 zmq_msg_move.3 zmq_msg_size.3 \
zmq_poll.3 zmq_recv.3 zmq_send.3 zmq_setsockopt.3 zmq_socket.3 \
zmq_strerror.3 zmq_term.3 zmq_version.3 zmq_getsockopt.3 zmq_errno.3 \
zmq_sendmsg.3 zmq_recvmsg.3 zmq_msg_peek.3 zmq_msg_poke.3 zmq_msg_more.3
zmq_sendmsg.3 zmq_recvmsg.3 zmq_msg_get.3 zmq_msg_set.3 zmq_msg_more.3
MAN7 = zmq.7 zmq_tcp.7 zmq_pgm.7 zmq_epgm.7 zmq_inproc.7 zmq_ipc.7
MAN_DOC = $(MAN1) $(MAN3) $(MAN7)
......
......@@ -86,8 +86,8 @@ Access message content::
linkzmq:zmq_msg_more[3]
Work with message properties::
linkzmq:zmq_msg_peek[3]
linkzmq:zmq_msg_poke[3]
linkzmq:zmq_msg_get[3]
linkzmq:zmq_msg_set[3]
Message manipulation::
linkzmq:zmq_msg_copy[3]
......
zmq_msg_peek(3)
===============
zmq_msg_get(3)
==============
NAME
----
zmq_msg_peek - get message options
zmq_msg_get - get message options
SYNOPSIS
--------
*int zmq_msg_peek (zmq_msg_t '*message', int 'option_name', void '*option_value', size_t '*option_len');*
*int zmq_msg_get (zmq_msg_t '*message', int 'option_name', void '*option_value', size_t '*option_len');*
DESCRIPTION
-----------
The _zmq_msg_peek()_ function shall retrieve the value for the option
The _zmq_msg_get()_ function shall retrieve the value for the option
specified by the 'option_name' argument for the message pointed to by the
'message' argument, and store it in the buffer pointed to by the 'option_value'
argument. The 'option_len' argument is the size in bytes of the buffer pointed
......@@ -22,14 +22,14 @@ to by 'option_value'; upon successful completion _zmq_getsockopt()_ shall
modify the 'option_len' argument to indicate the actual size of the option
value stored in the buffer.
The following options can be retrieved with the _zmq_msg_peek()_ function:
The following options can be retrieved with the _zmq_msg_get()_ function:
*ZMQ_MORE*::
Indicates that there are more message parts to follow after the 'message'.
RETURN VALUE
------------
The _zmq_msg_peek()_ function shall return zero if successful. Otherwise it
The _zmq_msg_get()_ function shall return zero if successful. Otherwise it
shall return `-1` and set 'errno' to one of the values defined below.
......
zmq_msg_poke(3)
===============
zmq_msg_set(3)
==============
NAME
----
zmq_msg_poke - set message options
zmq_msg_set - set message options
SYNOPSIS
......@@ -15,17 +15,17 @@ SYNOPSIS
DESCRIPTION
-----------
The _zmq_msg_poke()_ function shall set the option specified by the
The _zmq_msg_set()_ function shall set the option specified by the
'option_name' argument to the value pointed to by the 'option_value' argument
for the 0MQ socket pointed to by the 'socket' argument. The 'option_len'
argument is the size of the option value in bytes.
Currently the _zmq_msg_poke()_ function does not support any option names.
Currently the _zmq_msg_set()_ function does not support any option names.
RETURN VALUE
------------
The _zmq_msg_poke()_ function shall return zero if successful. Otherwise it
The _zmq_msg_set()_ function shall return zero if successful. Otherwise it
shall return `-1` and set 'errno' to one of the values defined below.
......
......@@ -167,10 +167,10 @@ ZMQ_EXPORT int zmq_msg_copy (zmq_msg_t *dest, zmq_msg_t *src);
ZMQ_EXPORT void *zmq_msg_data (zmq_msg_t *msg);
ZMQ_EXPORT size_t zmq_msg_size (zmq_msg_t *msg);
ZMQ_EXPORT int zmq_msg_more (zmq_msg_t *msg);
ZMQ_EXPORT int zmq_msg_peek (zmq_msg_t *msg, int option, void *optval,
size_t *optvallen);
ZMQ_EXPORT int zmq_msg_poke (zmq_msg_t *msg, int option, const void *optval,
size_t *optvallen);
ZMQ_EXPORT int zmq_msg_get (zmq_msg_t *msg, int option, void *optval,
size_t *optvallen);
ZMQ_EXPORT int zmq_msg_set (zmq_msg_t *msg, int option, const void *optval,
size_t *optvallen);
/******************************************************************************/
......
......@@ -545,12 +545,12 @@ int zmq_msg_more (zmq_msg_t *msg_)
{
int more;
size_t more_size = sizeof (more);
int rc = zmq_msg_peek (msg_, ZMQ_MORE, &more, &more_size);
int rc = zmq_msg_get (msg_, ZMQ_MORE, &more, &more_size);
assert (rc == 0);
return more;
}
int zmq_msg_peek (zmq_msg_t *msg_, int option_, void *optval_,
int zmq_msg_get (zmq_msg_t *msg_, int option_, void *optval_,
size_t *optvallen_)
{
if (!msg_) {
......@@ -573,7 +573,7 @@ int zmq_msg_peek (zmq_msg_t *msg_, int option_, void *optval_,
}
}
int zmq_msg_poke (zmq_msg_t *msg_, int option_, const void *optval_,
int zmq_msg_set (zmq_msg_t *msg_, int option_, const void *optval_,
size_t *optvallen_)
{
if (!msg_) {
......
......@@ -52,7 +52,7 @@ int main (int argc, char *argv [])
assert (rc >= 0);
int more;
size_t more_size = sizeof (more);
rc = zmq_msg_peek (&msg, ZMQ_MORE, &more, &more_size);
rc = zmq_msg_get (&msg, ZMQ_MORE, &more, &more_size);
assert (rc == 0);
assert (more == 1);
......@@ -60,7 +60,7 @@ int main (int argc, char *argv [])
rc = zmq_recvmsg (sb, &msg, 0);
assert (rc == 1);
more_size = sizeof (more);
rc = zmq_msg_peek (&msg, ZMQ_MORE, &more, &more_size);
rc = zmq_msg_get (&msg, ZMQ_MORE, &more, &more_size);
assert (rc == 0);
assert (more == 1);
......@@ -68,7 +68,7 @@ int main (int argc, char *argv [])
rc = zmq_recvmsg (sb, &msg, 0);
assert (rc == 1);
more_size = sizeof (more);
rc = zmq_msg_peek (&msg, ZMQ_MORE, &more, &more_size);
rc = zmq_msg_get (&msg, ZMQ_MORE, &more, &more_size);
assert (rc == 0);
assert (more == 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment