static char *conf_node = NULL;
static char *conf_service = NULL;
/* Defaults to false for backwards compatibility. */
-static bool conf_report_seconds = 0;
+static bool conf_report_seconds;
static bool conf_persistent_conn = 1;
static int global_sockfd = -1;
static double config_altitude = NAN; /**< altitude */
static int config_normalize = 0; /**< normalization method */
-static bool configured = 0; /**< the whole plugin config status */
+static bool configured; /**< the whole plugin config status */
static int i2c_bus_fd = -1; /**< I2C bus device FD */
/* Used only for MPL115. MPL3115 supports real oversampling in the device so */
/* no need for any postprocessing. */
-static bool avg_initialized = 0; /**< already initialized by real values */
+static bool avg_initialized; /**< already initialized by real values */
typedef struct averaging_s {
long int *ring_buffer;
int battery_read_statefs(
void); /* defined in battery_statefs; used by StateFS backend */
-static bool report_percent = 0;
-static bool report_degraded = 0;
-static bool query_statefs = 0;
+static bool report_percent;
+static bool report_degraded;
+static bool query_statefs;
static void battery_submit2(char const *plugin_instance, /* {{{ */
char const *type, char const *type_instance,
static range_t range_critical_g;
static range_t range_warning_g;
static int consolitation_g = CON_NONE;
-static bool nan_is_error_g = 0;
+static bool nan_is_error_g;
static char **match_ds_g = NULL;
static size_t match_ds_num_g = 0;
static bool report_by_cpu = 1;
static bool report_by_state = 1;
-static bool report_percent = 0;
-static bool report_num_cpu = 0;
-static bool report_guest = 0;
+static bool report_percent;
+static bool report_num_cpu;
+static bool report_guest;
static bool subtract_guest = 1;
static const char *config_keys[] = {"ReportByCpu", "ReportByState",
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;
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;
/*
* Static functions
#include <pthread.h>
static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
-static bool have_seed = 0;
+static bool have_seed;
static unsigned short seed[3];
static void cdrand_seed(void) {
static ignorelist_t *il_mountpoint = NULL;
static ignorelist_t *il_fstype = NULL;
-static bool by_device = 0;
-static bool report_inodes = 0;
+static bool by_device;
+static bool report_inodes;
static bool values_absolute = 1;
-static bool values_percentage = 0;
+static bool values_percentage;
static int df_init(void) {
if (il_device == NULL)
static mach_port_t io_master_port = MACH_PORT_NULL;
/* This defaults to false for backwards compatibility. Please fix in the next
* major version. */
-static bool use_bsd_name = 0;
+static bool use_bsd_name;
/* #endif HAVE_IOKIT_IOKITLIB_H */
#elif KERNEL_LINUX
static c_avl_tree_t *value_map = NULL;
-static bool collect_mapped_only = 0;
+static bool collect_mapped_only;
static int ethstat_add_interface(const oconfig_item_t *ci) /* {{{ */
{
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
static bool values_absolute = 1;
-static bool values_percentage = 0;
+static bool values_percentage;
static int fhcount_config(const char *key, const char *value) {
int ret = -1;
static bool g_flag_rpt_mm = 1;
static bool g_values_pages = 1;
-static bool g_values_bytes = 0;
-static bool g_values_percent = 0;
+static bool g_values_bytes;
+static bool g_values_percent;
#define HP_HAVE_NR 0x01
#define HP_HAVE_SURPLUS 0x02
extern kstat_ctl_t *kc;
static kstat_t *ksp[MAX_NUMIF];
static int numif = 0;
-static bool unique_name = 0;
+static bool unique_name;
#endif /* HAVE_LIBKSTAT */
static int interface_config(const char *key, const char *value) {
*/
static bool have_gcrypt(void) /* {{{ */
{
- static bool result = 0;
+ static bool result;
static bool need_init = 1;
if (!need_init)
#include <sys/protosw.h>
#endif /* HAVE_PERFSTAT */
-static bool report_relative_load = 0;
+static bool report_relative_load;
static const char *config_keys[] = {"ReportRelative"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
static const char *config_keys[] = {"CpuPoolStats", "ReportBySerial"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static bool pool_stats = 0;
-static bool report_by_serial = 0;
+static bool pool_stats;
+static bool report_by_serial;
#if PERFSTAT_SUPPORTS_DONATION
-static bool donate_flag = 0;
+static bool donate_flag;
#endif
static char serial[SYS_NMLN];
};
typedef struct memcached_s memcached_t;
-static bool memcached_have_instances = 0;
+static bool memcached_have_instances;
static void memcached_free(void *arg) {
memcached_t *st = arg;
#endif
static bool values_absolute = 1;
-static bool values_percentage = 0;
+static bool values_percentage;
static int memory_config(oconfig_item_t *ci) /* {{{ */
{
static int network_config_ttl = 0;
/* Ethernet - (IPv6 + UDP) = 1500 - (40 + 8) = 1452 */
static size_t network_config_packet_size = 1452;
-static bool network_config_forward = 0;
-static bool network_config_stats = 0;
+static bool network_config_forward;
+static bool network_config_stats;
static sockent_t *sending_sockets = NULL;
} /* }}} int network_stats_read */
static int network_init(void) {
- static bool have_init = 0;
+ static bool have_init;
/* Check if we were already initialized. If so, just return - there's
* nothing more to do (for now, that is). */
/* This option only exists for backward compatibility. If it is false and two
* ntpd peers use the same refclock driver, the plugin will try to write
* simultaneous measurements from both to the same type instance. */
-static bool include_unit_id = 0;
+static bool include_unit_id;
#define NTPD_DEFAULT_HOST "localhost"
#define NTPD_DEFAULT_PORT "123"
static char *device_g = NULL;
static cdtime_t ow_interval = 0;
-static bool direct_access = 0;
+static bool direct_access;
static const char *config_keys[] = {"Device", "IgnoreSelected", "Sensor",
"Interval"};
static ignorelist_t *sensor_list;
-static bool regex_direct_initialized = 0;
+static bool regex_direct_initialized;
static regex_t regex_direct;
/**
};
typedef struct vpn_status_s vpn_status_t;
-static bool new_naming_schema = 0;
+static bool new_naming_schema;
static bool collect_compression = 1;
-static bool collect_user_count = 0;
+static bool collect_user_count;
static bool collect_individual_users = 1;
static const char *config_keys[] = {
static char *conf_node = NULL;
static char *conf_service = NULL;
-static bool collector_thread_running = 0;
-static bool collector_thread_do_shutdown = 0;
+static bool collector_thread_running;
+static bool collector_thread_do_shutdown;
static pthread_t collector_thread_id;
/* }}} */
c_psql_database_t *db;
char cb_name[DATA_MAX_NAME_LEN];
- static bool have_flush = 0;
+ static bool have_flush;
if ((1 != ci->values_num) || (OCONFIG_TYPE_STRING != ci->values[0].type)) {
log_err("<Database> expects a single string argument.");
static procstat_t *list_head_g = NULL;
static bool want_init = 1;
-static bool report_ctx_switch = 0;
-static bool report_fd_num = 0;
-static bool report_maps_num = 0;
-static bool report_delay = 0;
+static bool report_ctx_switch;
+static bool report_fd_num;
+static bool report_maps_num;
+static bool report_delay;
#if HAVE_THREAD_INFO
static mach_port_t port_host_self;
static pthread_t main_thread;
static PyOS_sighandler_t python_sigint_handler;
-static bool do_interactive = 0;
+static bool do_interactive;
/* This is our global thread state. Python saves some stuff in thread-local
* storage. So if we allow the interpreter to run in the background
} featurelist_t;
static char *conffile = NULL;
-static bool use_labels = 0;
+static bool use_labels;
/* #endif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500) */
#else /* if SENSORS_API_VERSION >= 0x500 */
static pthread_mutex_t metrics_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_t network_thread;
-static bool network_thread_running = 0;
-static bool network_thread_shutdown = 0;
+static bool network_thread_running;
+static bool network_thread_shutdown;
static char *conf_node = NULL;
static char *conf_service = NULL;
-static bool conf_delete_counters = 0;
-static bool conf_delete_timers = 0;
-static bool conf_delete_gauges = 0;
-static bool conf_delete_sets = 0;
+static bool conf_delete_counters;
+static bool conf_delete_timers;
+static bool conf_delete_gauges;
+static bool conf_delete_sets;
static double *conf_timer_percentile = NULL;
-static size_t conf_timer_percentile_num = 0;
+static size_t conf_timer_percentile_num;
-static bool conf_counter_sum = 0;
-static bool conf_timer_lower = 0;
-static bool conf_timer_upper = 0;
-static bool conf_timer_sum = 0;
-static bool conf_timer_count = 0;
+static bool conf_counter_sum;
+static bool conf_timer_lower;
+static bool conf_timer_upper;
+static bool conf_timer_sum;
+static bool conf_timer_count;
/* Must hold metrics_lock when calling this function. */
static statsd_metric_t *statsd_metric_lookup_unsafe(char const *name, /* {{{ */
#if KERNEL_LINUX
#define SWAP_HAVE_REPORT_BY_DEVICE 1
static derive_t pagesize;
-static bool report_bytes = 0;
-static bool report_by_device = 0;
+static bool report_bytes;
+static bool report_by_device;
/* #endif KERNEL_LINUX */
#elif HAVE_SWAPCTL && HAVE_SWAPCTL_TWO_ARGS
#define SWAP_HAVE_REPORT_BY_DEVICE 1
static derive_t pagesize;
-static bool report_by_device = 0;
+static bool report_by_device;
/* #endif HAVE_SWAPCTL && HAVE_SWAPCTL_TWO_ARGS */
#elif HAVE_SWAPCTL && HAVE_SWAPCTL_THREE_ARGS
#endif /* HAVE_LIBSTATGRAB */
static bool values_absolute = 1;
-static bool values_percentage = 0;
+static bool values_percentage;
static bool report_io = 1;
static int swap_config(oconfig_item_t *ci) /* {{{ */
} /* int tcsv_config */
static int tcsv_init(void) { /* {{{ */
- static bool have_init = 0;
+ static bool have_init;
metric_definition_t *md;
if (have_init)
static const char *const dirname_sysfs = "/sys/class/thermal";
static const char *const dirname_procfs = "/proc/acpi/thermal_zone";
-static bool force_procfs = 0;
+static bool force_procfs;
static ignorelist_t *device_list;
enum dev_type { TEMP = 0, COOLING_DEV };
#define EVEN_COUNTERS thread_even, core_even, package_even
static bool is_even = 1;
-static bool allocated = 0;
-static bool initialized = 0;
+static bool allocated;
+static bool initialized;
#define GET_THREAD(thread_base, thread_no, core_no, pkg_no) \
(thread_base + (pkg_no)*topology.num_cores * topology.num_threads + \
static char *sock_file = NULL;
static char *sock_group = NULL;
static int sock_perms = S_IRWXU | S_IRWXG;
-static bool delete_socket = 0;
+static bool delete_socket;
static pthread_t listen_thread = (pthread_t)0;
#include "testing.h"
#include "utils_vl_lookup.h"
-static bool expect_new_obj = 0;
-static bool have_new_obj = 0;
+static bool expect_new_obj;
+static bool have_new_obj;
static lookup_identifier_t last_class_ident;
static lookup_identifier_t last_obj_ident;
};
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,