Skip to content

Instantly share code, notes, and snippets.

@earl

earl/zmqext.h Secret

Created March 25, 2011 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save earl/e22a35049ae56324004a to your computer and use it in GitHub Desktop.
Save earl/e22a35049ae56324004a to your computer and use it in GitHub Desktop.
/*
This file was automatically generated:
Source file: zmqext.r3
Source date: 25-Mar-2011/16:42+1:00
Generation date: 25-Mar-2011/16:42:03+1:00
The REBOL 3 header of the source file follows:
REBOL [
title: "ØMQ extension"
author: "Andreas Bolka"
name: zmqext
type: extension
rights: {
Copyright (C) 2011 Andreas Bolka <a AT bolka DOT at>
Licensed under the terms of the Apache License, Version 2.0
The zmqext REBOL 3 extension uses the ØMQ library, the use of which is
granted under the terms of the GNU Lesser General Public License
(LGPL), Version 3.
}
]
*/
static int cmd_zmq_init(RXIFRM *frm, void *data);
static int cmd_zmq_term(RXIFRM *frm, void *data);
static int cmd_zmq_msg_alloc(RXIFRM *frm, void *data);
static int cmd_zmq_msg_free(RXIFRM *frm, void *data);
static int cmd_zmq_msg_init(RXIFRM *frm, void *data);
static int cmd_zmq_msg_init_size(RXIFRM *frm, void *data);
static int cmd_zmq_msg_init_data(RXIFRM *frm, void *data);
static int cmd_zmq_msg_close(RXIFRM *frm, void *data);
static int cmd_zmq_msg_data(RXIFRM *frm, void *data);
static int cmd_zmq_msg_size(RXIFRM *frm, void *data);
static int cmd_zmq_msg_copy(RXIFRM *frm, void *data);
static int cmd_zmq_msg_move(RXIFRM *frm, void *data);
static int cmd_zmq_socket(RXIFRM *frm, void *data);
static int cmd_zmq_close(RXIFRM *frm, void *data);
static int cmd_zmq_setsockopt_binary(RXIFRM *frm, void *data);
static int cmd_zmq_getsockopt_binary(RXIFRM *frm, void *data);
static int cmd_zmq_setsockopt_int(RXIFRM *frm, void *data);
static int cmd_zmq_getsockopt_int(RXIFRM *frm, void *data);
static int cmd_zmq_bind(RXIFRM *frm, void *data);
static int cmd_zmq_connect(RXIFRM *frm, void *data);
static int cmd_zmq_send(RXIFRM *frm, void *data);
static int cmd_zmq_recv(RXIFRM *frm, void *data);
static int cmd_zmq_poll(RXIFRM *frm, void *data);
static int cmd_zmq_errno(RXIFRM *frm, void *data);
static int cmd_zmq_strerror(RXIFRM *frm, void *data);
static int cmd_zmq_version(RXIFRM *frm, void *data);
static int cmd_zmq_equal_(RXIFRM *frm, void *data);
static const int command_count = 27;
typedef int (RXICMD)(RXIFRM*, void*);
static RXICMD * const command_block[] = {
&cmd_zmq_init,
&cmd_zmq_term,
&cmd_zmq_msg_alloc,
&cmd_zmq_msg_free,
&cmd_zmq_msg_init,
&cmd_zmq_msg_init_size,
&cmd_zmq_msg_init_data,
&cmd_zmq_msg_close,
&cmd_zmq_msg_data,
&cmd_zmq_msg_size,
&cmd_zmq_msg_copy,
&cmd_zmq_msg_move,
&cmd_zmq_socket,
&cmd_zmq_close,
&cmd_zmq_setsockopt_binary,
&cmd_zmq_getsockopt_binary,
&cmd_zmq_setsockopt_int,
&cmd_zmq_getsockopt_int,
&cmd_zmq_bind,
&cmd_zmq_connect,
&cmd_zmq_send,
&cmd_zmq_recv,
&cmd_zmq_poll,
&cmd_zmq_errno,
&cmd_zmq_strerror,
&cmd_zmq_version,
&cmd_zmq_equal_,
};
static const char init_block[] =
"REBOL [\n"
" title: \"ØMQ extension\"\n"
" author: \"Andreas Bolka\"\n"
" name: zmqext\n"
" type: extension\n"
" rights: {\n"
" Copyright (C) 2011 Andreas Bolka <a AT bolka DOT at>\n"
" Licensed under the terms of the Apache License, Version 2.0\n"
"\n"
" The zmqext REBOL 3 extension uses the ØMQ library, the use of which is\n"
" granted under the terms of the GNU Lesser General Public License\n"
" (LGPL), Version 3.\n"
" }\n"
"]\n"
"\n"
"export zmq-constants: map [\n"
" ;; socket types\n"
" pair 0\n"
" pub 1\n"
" sub 2\n"
" req 3\n"
" rep 4\n"
" xreq 5\n"
" xrep 6\n"
" pull 7\n"
" push 8\n"
"\n"
" ;; socket options\n"
" hwm 1\n"
" swap 3\n"
" affinity 4\n"
" identity 5\n"
" subscribe 6\n"
" unsubscribe 7\n"
" rate 8\n"
" recovery-ivl 9\n"
" mcast-loop 10\n"
" sndbuf 11\n"
" rcvbuf 12\n"
" rcvmore 13\n"
"\n"
" ;; send/recv options\n"
" noblock 1\n"
" sndmore 2\n"
"\n"
" ;; poll options\n"
" pollin 1\n"
" pollout 2\n"
" ;pollerr 4 ;; not used for 0MQ sockets (& we can't support standard sockets)\n"
"]\n"
"\n"
"export zmq-init: command [\n"
" \"Initialise 0MQ context\"\n"
" io-threads [integer!]\n"
"]\n"
"\n"
"export zmq-term: command [\n"
" \"Terminate 0MQ context\"\n"
" ctx [handle!]\n"
"]\n"
"\n"
"export zmq-msg-alloc: command [\n"
" \"Allocate memory for a 0MQ message object\"\n"
"]\n"
"\n"
"export zmq-msg-free: command [\n"
" \"Free the memory previously allocated for a 0MQ message object\"\n"
" msg [handle!]\n"
"]\n"
"\n"
"export zmq-msg-init: command [\n"
" \"Initialise empty 0MQ message\"\n"
" msg [handle!]\n"
"]\n"
"\n"
"export zmq-msg-init-size: command [\n"
" \"Initialise 0MQ message of a specified size\"\n"
" msg [handle!]\n"
" size [integer!]\n"
"]\n"
"\n"
"export zmq-msg-init-data: command [\n"
" \"Initialise 0MQ message with the supplied data\"\n"
" msg [handle!]\n"
" data [binary!]\n"
"]\n"
"\n"
"export zmq-msg-close: command [\n"
" \"Release 0MQ message\"\n"
" msg [handle!]\n"
"]\n"
"\n"
"export zmq-msg-data: command [\n"
" \"Retrieve message content (as binary!)\"\n"
" msg [handle!]\n"
"]\n"
"\n"
"export zmq-msg-size: command [\n"
" \"Retrieve message content size in bytes\"\n"
" msg [handle!]\n"
"]\n"
"\n"
"export zmq-msg-copy: command [\n"
" \"Copy content of a message to another message\"\n"
" msg-dest [handle!]\n"
" msg-src [handle!]\n"
"]\n"
"\n"
"export zmq-msg-move: command [\n"
" \"Move content of a message to another message\"\n"
" msg-dest [handle!]\n"
" msg-src [handle!]\n"
"]\n"
"\n"
"export zmq-socket: command [\n"
" \"Create 0MQ socket\"\n"
" ctx [handle!]\n"
" type [integer!]\n"
"]\n"
"\n"
"export zmq-close: command [\n"
" \"Close 0MQ socket\"\n"
" socket [handle!]\n"
"]\n"
"\n"
"export zmq-setsockopt-binary: command [\n"
" \"Set 0MQ socket options (of 0MQ option value type 'binary')\"\n"
" socket [handle!]\n"
" name [integer!]\n"
" value [binary!]\n"
"]\n"
"\n"
"export zmq-getsockopt-binary: command [\n"
" \"Get 0MQ socket options (of 0MQ option value type 'binary')\"\n"
" socket [handle!]\n"
" name [integer!]\n"
" size [integer!]\n"
"]\n"
"\n"
"export zmq-setsockopt-int: command [\n"
" \"Set 0MQ socket options (of 0MQ option value type '[u]int64_t')\"\n"
" socket [handle!]\n"
" name [integer!]\n"
" value [integer!]\n"
"]\n"
"\n"
"export zmq-getsockopt-int: command [\n"
" \"Get 0MQ socket options (of 0MQ option value type '[u]int64_t')\"\n"
" socket [handle!]\n"
" name [integer!]\n"
"]\n"
"\n"
"export zmq-bind: command [\n"
" \"Accept connections on a socket\"\n"
" socket [handle!]\n"
" endpoint [string!]\n"
"]\n"
"\n"
"export zmq-connect: command [\n"
" \"Connect a socket\"\n"
" socket [handle!]\n"
" endpoint [string!]\n"
"]\n"
"\n"
"export zmq-send: command [\n"
" \"Send a message on a socket\"\n"
" socket [handle!]\n"
" msg [handle!]\n"
" flags [integer!]\n"
"]\n"
"\n"
"export zmq-recv: command [\n"
" \"Receive a message from a socket\"\n"
" socket [handle!]\n"
" msg [handle!]\n"
" flags [integer!]\n"
"]\n"
"\n"
"export zmq-poll: command [\n"
" \"Input/output multiplexing\"\n"
" poll-spec [block!]\n"
" timeout [integer!] \"Timeout in microseconds\"\n"
"]\n"
"\n"
"export zmq-errno: command [\n"
" \"Retrieve the error code\"\n"
"]\n"
"\n"
"export zmq-strerror: command [\n"
" \"Get 0MQ error message string for a given error code\"\n"
" errnum [integer!]\n"
"]\n"
"\n"
"export zmq-version: command [\n"
" \"Report 0MQ library version\"\n"
"]\n"
"\n"
";; Temporary workaround for bug#1868\n"
"export zmq-equal?: command [\n"
" \"Returns TRUE if two 0MQ handle! values are equal\"\n"
" value1 [handle!]\n"
" value2 [handle!]\n"
"]\n"
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment