summaryrefslogtreecommitdiff
path: root/librabbitmq/amqp_api.c
diff options
context:
space:
mode:
authorScott Brooks <scott.brooks@epicadvertising.com>2009-10-14 10:42:50 -0400
committerScott Brooks <scott.brooks@epicadvertising.com>2009-10-14 10:42:50 -0400
commit3cb254d902a9b226bf95696af3a98839bb7797a4 (patch)
tree2999d9061d80af32c6fba046549b402418c15483 /librabbitmq/amqp_api.c
parent62fcf89ed4e4356033b65a9a3a99f47ff2e9581a (diff)
downloadrabbitmq-c-github-ask-3cb254d902a9b226bf95696af3a98839bb7797a4.tar.gz
Updated amqp_simple_rpc to take a 0 terminated array of amqp_method_number_t replies
Updated AMQP_SIMPLE_RPC macro for the new format Added AMQP_MULTIPLE_RESPONSE_RPC macro to take a 0 terminated array of amqp_method_number_t replies Added amqp_basic_get function Added amqp_queue_purge function Added amqp_get_rpc_reply function to expose amqp_rpc_reply when we are not statically linking Added amqp_data_in_buffer function to check to see if amqp_simple_wait_frames will hit a blocking read
Diffstat (limited to 'librabbitmq/amqp_api.c')
-rw-r--r--librabbitmq/amqp_api.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/librabbitmq/amqp_api.c b/librabbitmq/amqp_api.c
index a52d947..2b887c7 100644
--- a/librabbitmq/amqp_api.c
+++ b/librabbitmq/amqp_api.c
@@ -197,3 +197,32 @@ int amqp_basic_ack(amqp_connection_state_t state,
AMQP_CHECK_RESULT(amqp_send_method(state, channel, AMQP_BASIC_ACK_METHOD, &m));
return 0;
}
+
+amqp_queue_purge_ok_t *amqp_queue_purge(amqp_connection_state_t state,
+ amqp_channel_t channel,
+ amqp_bytes_t queue,
+ amqp_boolean_t no_wait)
+{
+ amqp_rpc_reply = AMQP_SIMPLE_RPC(state, channel, QUEUE, PURGE, PURGE_OK,
+ amqp_queue_purge_t, channel, queue, no_wait);
+ return RPC_REPLY(amqp_queue_purge_ok_t);
+}
+
+amqp_rpc_reply_t amqp_basic_get(amqp_connection_state_t state,
+ amqp_channel_t channel,
+ amqp_bytes_t queue,
+ amqp_boolean_t no_ack)
+{
+ amqp_method_number_t replies[] = { AMQP_EXPAND_METHOD(BASIC, GET_OK), AMQP_EXPAND_METHOD(BASIC, GET_EMPTY), 0};
+ amqp_rpc_reply =
+ AMQP_MULTIPLE_RESPONSE_RPC(state, channel, BASIC, GET, replies,
+ amqp_basic_get_t,
+ channel, queue, no_ack);
+ return amqp_rpc_reply;
+}
+
+// Expose amqp_rpc_reply to dynamically linked libraries
+amqp_rpc_reply_t amqp_get_rpc_reply()
+{
+ return amqp_rpc_reply;
+}