static write_queue_t *write_queue_head;
static write_queue_t *write_queue_tail;
static long write_queue_length = 0;
-static _Bool write_loop = 1;
+static bool write_loop = 1;
static pthread_mutex_t write_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t write_cond = PTHREAD_COND_INITIALIZER;
static pthread_t *write_threads = NULL;
static size_t write_threads_num = 0;
static pthread_key_t plugin_ctx_key;
-static _Bool plugin_ctx_key_initialized = 0;
+static bool plugin_ctx_key_initialized = 0;
static long write_limit_high = 0;
static long write_limit_low = 0;
static derive_t stats_values_dropped = 0;
-static _Bool record_statistics = 0;
+static bool record_statistics = 0;
/*
* Static functions
/* plugin_load_file loads the shared object "file" and calls its
* "module_register" function. Returns zero on success, non-zero otherwise. */
-static int plugin_load_file(char const *file, _Bool global) {
+static int plugin_load_file(char const *file, bool global) {
int flags = RTLD_NOW;
if (global)
flags |= RTLD_GLOBAL;
}
char name[THREAD_NAME_MAX];
- snprintf(name, sizeof(name), "reader#%zu", read_threads_num);
+ snprintf(name, sizeof(name), "reader#%" PRIsz, read_threads_num);
set_thread_name(read_threads[read_threads_num], name);
read_threads_num++;
if (read_threads == NULL)
return;
- INFO("collectd: Stopping %zu read threads.", read_threads_num);
+ INFO("collectd: Stopping %" PRIsz " read threads.", read_threads_num);
pthread_mutex_lock(&read_lock);
read_loop = 0;
}
char name[THREAD_NAME_MAX];
- snprintf(name, sizeof(name), "writer#%zu", write_threads_num);
+ snprintf(name, sizeof(name), "writer#%" PRIsz, write_threads_num);
set_thread_name(write_threads[write_threads_num], name);
write_threads_num++;
if (write_threads == NULL)
return;
- INFO("collectd: Stopping %zu write threads.", write_threads_num);
+ INFO("collectd: Stopping %" PRIsz " write threads.", write_threads_num);
pthread_mutex_lock(&write_lock);
write_loop = 0;
pthread_mutex_unlock(&write_lock);
if (i > 0) {
- WARNING("plugin: %zu value list%s left after shutting down "
+ WARNING("plugin: %" PRIsz " value list%s left after shutting down "
"the write threads.",
i, (i == 1) ? " was" : "s were");
}
ERROR("plugin_set_dir: strdup(\"%s\") failed", dir);
}
-static _Bool plugin_is_loaded(char const *name) {
+static bool plugin_is_loaded(char const *name) {
int status;
if (plugins_loaded == NULL)
}
#define BUFSIZE 512
-int plugin_load(char const *plugin_name, _Bool global) {
+int plugin_load(char const *plugin_name, bool global) {
DIR *dh;
const char *dir;
char filename[BUFSIZE] = "";
int status;
static c_complain_t no_write_complaint = C_COMPLAIN_INIT_STATIC;
- _Bool free_meta_data = 0;
+ bool free_meta_data = 0;
assert(vl != NULL);
#else
if (ds->ds_num != vl->values_len) {
ERROR("plugin_dispatch_values: ds->type = %s: "
- "(ds->ds_num = %zu) != "
- "(vl->values_len = %zu)",
+ "(ds->ds_num = %" PRIsz ") != "
+ "(vl->values_len = %" PRIsz ")",
ds->type, ds->ds_num, vl->values_len);
return -1;
}
return (double)pos / (double)size;
} /* }}} double get_drop_probability */
-static _Bool check_drop_value(void) /* {{{ */
+static bool check_drop_value(void) /* {{{ */
{
static cdtime_t last_message_time = 0;
static pthread_mutex_t last_message_lock = PTHREAD_MUTEX_INITIALIZER;
return 1;
else
return 0;
-} /* }}} _Bool check_drop_value */
+} /* }}} bool check_drop_value */
int plugin_dispatch_values(value_list_t const *vl) {
int status;
__attribute__((sentinel)) int
plugin_dispatch_multivalue(value_list_t const *template, /* {{{ */
- _Bool store_percentage, int store_type, ...) {
+ bool store_percentage, int store_type, ...) {
value_list_t *vl;
int failed = 0;
gauge_t sum = 0.0;
break;
}
case NM_TYPE_BOOLEAN: {
- meta->nm_value.nm_boolean = *((_Bool *)value);
+ meta->nm_value.nm_boolean = *((bool *)value);
break;
}
default: {
}
int plugin_notification_meta_add_boolean(notification_t *n, const char *name,
- _Bool value) {
+ bool value) {
return plugin_notification_meta_add(n, name, NM_TYPE_BOOLEAN, &value);
}