From d092f2615c2133338097cb4f37d9809d2422a991 Mon Sep 17 00:00:00 2001 From: Pieter Hintjens Date: Wed, 15 Feb 2012 19:28:29 -0600 Subject: [PATCH] Renamed peek/poke to get/set --- doc/Makefile.am | 2 +- doc/zmq.txt | 4 ++-- doc/{zmq_msg_peek.txt => zmq_msg_get.txt} | 14 +++++++------- doc/{zmq_msg_poke.txt => zmq_msg_set.txt} | 12 ++++++------ include/zmq.h | 8 ++++---- src/zmq.cpp | 6 +++--- tests/test_msg_flags.cpp | 6 +++--- 7 files changed, 26 insertions(+), 26 deletions(-) rename doc/{zmq_msg_peek.txt => zmq_msg_get.txt} (81%) rename doc/{zmq_msg_poke.txt => zmq_msg_set.txt} (72%) diff --git a/doc/Makefile.am b/doc/Makefile.am index 741e4f96..f9b471d3 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -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) diff --git a/doc/zmq.txt b/doc/zmq.txt index 277b68f6..aa0523a6 100644 --- a/doc/zmq.txt +++ b/doc/zmq.txt @@ -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] diff --git a/doc/zmq_msg_peek.txt b/doc/zmq_msg_get.txt similarity index 81% rename from doc/zmq_msg_peek.txt rename to doc/zmq_msg_get.txt index 2cdaafe3..5ba18713 100644 --- a/doc/zmq_msg_peek.txt +++ b/doc/zmq_msg_get.txt @@ -1,20 +1,20 @@ -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. diff --git a/doc/zmq_msg_poke.txt b/doc/zmq_msg_set.txt similarity index 72% rename from doc/zmq_msg_poke.txt rename to doc/zmq_msg_set.txt index b6bb86f3..bd71b7c9 100644 --- a/doc/zmq_msg_poke.txt +++ b/doc/zmq_msg_set.txt @@ -1,11 +1,11 @@ -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. diff --git a/include/zmq.h b/include/zmq.h index cd798fe4..481deeeb 100644 --- a/include/zmq.h +++ b/include/zmq.h @@ -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); /******************************************************************************/ diff --git a/src/zmq.cpp b/src/zmq.cpp index 00497182..ca5b9614 100644 --- a/src/zmq.cpp +++ b/src/zmq.cpp @@ -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_) { diff --git a/tests/test_msg_flags.cpp b/tests/test_msg_flags.cpp index c14a86c6..7aa08791 100644 --- a/tests/test_msg_flags.cpp +++ b/tests/test_msg_flags.cpp @@ -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);