summaryrefslogtreecommitdiff
path: root/examples/amqps_bind.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/amqps_bind.c')
-rw-r--r--examples/amqps_bind.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/examples/amqps_bind.c b/examples/amqps_bind.c
index c1785af..8832566 100644
--- a/examples/amqps_bind.c
+++ b/examples/amqps_bind.c
@@ -37,8 +37,8 @@
*/
#include <stdint.h>
-#include <stdlib.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <amqp.h>
@@ -46,8 +46,7 @@
#include "utils.h"
-int main(int argc, char const *const *argv)
-{
+int main(int argc, char const *const *argv) {
char const *hostname;
int port, status;
char const *exchange;
@@ -57,7 +56,8 @@ int main(int argc, char const *const *argv)
amqp_connection_state_t conn;
if (argc < 6) {
- fprintf(stderr, "Usage: amqps_bind host port exchange bindingkey queue "
+ fprintf(stderr,
+ "Usage: amqps_bind host port exchange bindingkey queue "
"[cacert.pem [verifypeer] [verifyhostname] [key.pem cert.pem]]\n");
return 1;
}
@@ -106,20 +106,21 @@ int main(int argc, char const *const *argv)
die("opening SSL/TLS connection");
}
- die_on_amqp_error(amqp_login(conn, "/", 0, 131072, 0, AMQP_SASL_METHOD_PLAIN, "guest", "guest"),
+ die_on_amqp_error(amqp_login(conn, "/", 0, 131072, 0, AMQP_SASL_METHOD_PLAIN,
+ "guest", "guest"),
"Logging in");
amqp_channel_open(conn, 1);
die_on_amqp_error(amqp_get_rpc_reply(conn), "Opening channel");
- amqp_queue_bind(conn, 1,
- amqp_cstring_bytes(queue),
- amqp_cstring_bytes(exchange),
- amqp_cstring_bytes(bindingkey),
+ amqp_queue_bind(conn, 1, amqp_cstring_bytes(queue),
+ amqp_cstring_bytes(exchange), amqp_cstring_bytes(bindingkey),
amqp_empty_table);
die_on_amqp_error(amqp_get_rpc_reply(conn), "Unbinding");
- die_on_amqp_error(amqp_channel_close(conn, 1, AMQP_REPLY_SUCCESS), "Closing channel");
- die_on_amqp_error(amqp_connection_close(conn, AMQP_REPLY_SUCCESS), "Closing connection");
+ die_on_amqp_error(amqp_channel_close(conn, 1, AMQP_REPLY_SUCCESS),
+ "Closing channel");
+ die_on_amqp_error(amqp_connection_close(conn, AMQP_REPLY_SUCCESS),
+ "Closing connection");
die_on_error(amqp_destroy_connection(conn), "Ending connection");
return 0;
}