X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fvarnish.c;h=b515be8909474450b5e306036c16596fe2c6baca;hp=08260dc27fe5c28e2a7eb58c6b7350735aa9a827;hb=d486225f89ea52d8ed2b4242eba2ad94c409f837;hpb=65bdbbfb9c6b287de835e5aa81faee8cd864c1e9 diff --git a/src/varnish.c b/src/varnish.c index 08260dc2..b515be89 100644 --- a/src/varnish.c +++ b/src/varnish.c @@ -50,50 +50,50 @@ typedef struct varnish_stats c_varnish_stats_t; struct user_config_s { char *instance; - _Bool collect_cache; - _Bool collect_connections; - _Bool collect_esi; - _Bool collect_backend; + bool collect_cache; + bool collect_connections; + bool collect_esi; + bool collect_backend; #ifdef HAVE_VARNISH_V3 - _Bool collect_dirdns; + bool collect_dirdns; #endif - _Bool collect_fetch; - _Bool collect_hcb; - _Bool collect_objects; + bool collect_fetch; + bool collect_hcb; + bool collect_objects; #if HAVE_VARNISH_V2 - _Bool collect_purge; + bool collect_purge; #else - _Bool collect_ban; + bool collect_ban; #endif - _Bool collect_session; - _Bool collect_shm; - _Bool collect_sms; + bool collect_session; + bool collect_shm; + bool collect_sms; #if HAVE_VARNISH_V2 - _Bool collect_sm; + bool collect_sm; #endif #if HAVE_VARNISH_V2 || HAVE_VARNISH_V4 || HAVE_VARNISH_V5 - _Bool collect_sma; + bool collect_sma; #endif - _Bool collect_struct; - _Bool collect_totals; + bool collect_struct; + bool collect_totals; #if HAVE_VARNISH_V3 || HAVE_VARNISH_V4 || HAVE_VARNISH_V5 - _Bool collect_uptime; + bool collect_uptime; #endif - _Bool collect_vcl; - _Bool collect_workers; + bool collect_vcl; + bool collect_workers; #if HAVE_VARNISH_V4 || HAVE_VARNISH_V5 - _Bool collect_vsm; - _Bool collect_lck; - _Bool collect_mempool; - _Bool collect_mgt; - _Bool collect_smf; - _Bool collect_vbe; - _Bool collect_mse; + bool collect_vsm; + bool collect_lck; + bool collect_mempool; + bool collect_mgt; + bool collect_smf; + bool collect_vbe; + bool collect_mse; #endif }; typedef struct user_config_s user_config_t; /* }}} */ -static _Bool have_instance = 0; +static bool have_instance; static int varnish_submit(const char *plugin_instance, /* {{{ */ const char *category, const char *type, @@ -1331,7 +1331,7 @@ static int varnish_read(user_data_t *ud) /* {{{ */ { #if HAVE_VARNISH_V3 || HAVE_VARNISH_V4 struct VSM_data *vd; - _Bool ok; + bool ok; const c_varnish_stats_t *stats; #elif HAVE_VARNISH_V5 struct vsm *vd; @@ -1480,45 +1480,45 @@ static int varnish_config_apply_default(user_config_t *conf) /* {{{ */ if (conf == NULL) return EINVAL; - conf->collect_backend = 1; - conf->collect_cache = 1; - conf->collect_connections = 1; + conf->collect_backend = true; + conf->collect_cache = true; + conf->collect_connections = true; #ifdef HAVE_VARNISH_V3 - conf->collect_dirdns = 0; + conf->collect_dirdns = false; #endif - conf->collect_esi = 0; - conf->collect_fetch = 0; - conf->collect_hcb = 0; - conf->collect_objects = 0; + conf->collect_esi = false; + conf->collect_fetch = false; + conf->collect_hcb = false; + conf->collect_objects = false; #if HAVE_VARNISH_V2 - conf->collect_purge = 0; + conf->collect_purge = false; #else - conf->collect_ban = 0; + conf->collect_ban = false; #endif - conf->collect_session = 0; - conf->collect_shm = 1; + conf->collect_session = false; + conf->collect_shm = true; #if HAVE_VARNISH_V2 - conf->collect_sm = 0; + conf->collect_sm = false; #endif #if HAVE_VARNISH_V2 || HAVE_VARNISH_V4 || HAVE_VARNISH_V5 - conf->collect_sma = 0; + conf->collect_sma = false; #endif - conf->collect_sms = 0; - conf->collect_struct = 0; - conf->collect_totals = 0; + conf->collect_sms = false; + conf->collect_struct = false; + conf->collect_totals = false; #if HAVE_VARNISH_V3 || HAVE_VARNISH_V4 || HAVE_VARNISH_V5 - conf->collect_uptime = 0; + conf->collect_uptime = false; #endif - conf->collect_vcl = 0; - conf->collect_workers = 0; + conf->collect_vcl = false; + conf->collect_workers = false; #if HAVE_VARNISH_V4 || HAVE_VARNISH_V5 - conf->collect_vsm = 0; - conf->collect_lck = 0; - conf->collect_mempool = 0; - conf->collect_mgt = 0; - conf->collect_smf = 0; - conf->collect_vbe = 0; - conf->collect_mse = 0; + conf->collect_vsm = false; + conf->collect_lck = false; + conf->collect_mempool = false; + conf->collect_mgt = false; + conf->collect_smf = false; + conf->collect_vbe = false; + conf->collect_mse = false; #endif return 0; @@ -1771,7 +1771,7 @@ static int varnish_config_instance(const oconfig_item_t *ci) /* {{{ */ .data = conf, .free_func = varnish_config_free, }); - have_instance = 1; + have_instance = true; return 0; } /* }}} int varnish_config_instance */