X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Famqp.c;h=6d65bf838d274fc434c4196420aedb582eb5200c;hb=4e89060ceb1a14ec7f9abfe9caa6b0da7e76bd5c;hp=a8df88819b7909dd62963cefba94445145f18df7;hpb=084761bb8a360ac0f9e21ad43c82312676cc4a37;p=collectd.git diff --git a/src/amqp.c b/src/amqp.c index a8df8881..6d65bf83 100644 --- a/src/amqp.c +++ b/src/amqp.c @@ -66,7 +66,7 @@ int amqp_socket_close(amqp_socket_t *); * Data types */ struct camqp_config_s { - _Bool publish; + bool publish; char *name; char *host; @@ -83,7 +83,7 @@ struct camqp_config_s { /* publish only */ uint8_t delivery_mode; - _Bool store_rates; + bool store_rates; int format; /* publish & graphite format only */ char *prefix; @@ -94,8 +94,8 @@ struct camqp_config_s { /* subscribe only */ char *exchange_type; char *queue; - _Bool queue_durable; - _Bool queue_auto_delete; + bool queue_durable; + bool queue_auto_delete; amqp_connection_state_t connection; pthread_mutex_t lock; @@ -113,7 +113,7 @@ static const char *def_exchange = "amq.fanout"; static pthread_t *subscriber_threads = NULL; static size_t subscriber_threads_num = 0; -static _Bool subscriber_threads_running = 1; +static bool subscriber_threads_running = true; #define CONF(c, f) (((c)->f != NULL) ? (c)->f : def_##f) @@ -176,7 +176,7 @@ static char *camqp_bytes_cstring(amqp_bytes_t *in) /* {{{ */ return ret; } /* }}} char *camqp_bytes_cstring */ -static _Bool camqp_is_error(camqp_config_t *conf) /* {{{ */ +static bool camqp_is_error(camqp_config_t *conf) /* {{{ */ { amqp_rpc_reply_t r; @@ -185,7 +185,7 @@ static _Bool camqp_is_error(camqp_config_t *conf) /* {{{ */ return 0; return 1; -} /* }}} _Bool camqp_is_error */ +} /* }}} bool camqp_is_error */ static char *camqp_strerror(camqp_config_t *conf, /* {{{ */ char *buffer, size_t buffer_size) { @@ -503,7 +503,7 @@ static int camqp_connect(camqp_config_t *conf) /* {{{ */ static int camqp_shutdown(void) /* {{{ */ { - DEBUG("amqp plugin: Shutting down %zu subscriber threads.", + DEBUG("amqp plugin: Shutting down %" PRIsz " subscriber threads.", subscriber_threads_num); subscriber_threads_running = 0; @@ -825,7 +825,7 @@ static int camqp_config_set_format(oconfig_item_t *ci, /* {{{ */ } /* }}} int config_set_string */ static int camqp_config_connection(oconfig_item_t *ci, /* {{{ */ - _Bool publish) { + bool publish) { camqp_config_t *conf; int status; @@ -902,7 +902,7 @@ static int camqp_config_connection(oconfig_item_t *ci, /* {{{ */ else if (strcasecmp("RoutingKey", child->key) == 0) status = cf_util_get_string(child, &conf->routing_key); else if ((strcasecmp("Persistent", child->key) == 0) && publish) { - _Bool tmp = 0; + bool tmp = 0; status = cf_util_get_boolean(child, &tmp); if (tmp) conf->delivery_mode = CAMQP_DM_PERSISTENT;