agg_instance_t *next;
}; /* }}} */
-static lookup_t *lookup = NULL;
+static lookup_t *lookup;
static pthread_mutex_t agg_instance_list_lock = PTHREAD_MUTEX_INITIALIZER;
-static agg_instance_t *agg_instance_list_head = NULL;
+static agg_instance_t *agg_instance_list_head;
static bool agg_is_regex(char const *str) /* {{{ */
{
static const char *def_password = "guest";
static const char *def_exchange = "amq.fanout";
-static pthread_t *subscriber_threads = NULL;
+static pthread_t *subscriber_threads;
static size_t subscriber_threads_num = 0;
static bool subscriber_threads_running = true;
* Private variables
*/
/* Default values for contacting daemon */
-static char *conf_node = NULL;
-static char *conf_service = NULL;
+static char *conf_node;
+static char *conf_service;
/* Defaults to false for backwards compatibility. */
static bool conf_report_seconds;
static bool conf_persistent_conn = true;
* Private variables
*/
/* Default values for contacting daemon */
-static char *conf_device = NULL;
+static char *conf_device;
static int aquaero_config(oconfig_item_t *ci) {
for (int i = 0; i < ci->children_num; i++) {
#define PLAYER_INFO_STATIC_INIT \
{ -1, -1, -1, -1, -1 }
-static char *url = NULL;
-static char *user = NULL;
-static char *pass = NULL;
-static char *verify_peer = NULL;
-static char *verify_host = NULL;
-static char *cacert = NULL;
-static char *timeout = NULL;
+static char *url;
+static char *user;
+static char *pass;
+static char *verify_peer;
+static char *verify_host;
+static char *cacert;
+static char *timeout;
-static CURL *curl = NULL;
+static CURL *curl;
-static char *ascent_buffer = NULL;
+static char *ascent_buffer;
static size_t ascent_buffer_size = 0;
static size_t ascent_buffer_fill = 0;
static char ascent_curl_error[CURL_ERROR_SIZE];
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static char *config_device = NULL; /**< I2C bus device */
-static int config_oversample = 1; /**< averaging window */
+static char *config_device; /**< I2C bus device */
+static int config_oversample = 1; /**< averaging window */
static double config_press_offset = 0.0; /**< pressure offset */
static double config_temp_offset = 0.0; /**< temperature offset */
int ring_buffer_head;
} averaging_t;
-static averaging_t pressure_averaging = {NULL, 0, 0L, 0};
-static averaging_t temperature_averaging = {NULL, 0, 0L, 0};
+static averaging_t pressure_averaging;
+static averaging_t temperature_averaging;
/**
* Create / allocate averaging buffer
struct temperature_list_s *next; /**< next in the list */
} temperature_list_t;
-static temperature_list_t *temp_list = NULL;
+static temperature_list_t *temp_list;
/*
* Add new sensor to the temperature reference list
/* TODO: Remove time parsing code. */
static bool config_parse_time = true;
-static char *url = NULL;
+static char *url;
static int global_opcodes = 1;
static int global_qtypes = 1;
static int global_server_stats = 1;
static int global_memory_stats = 1;
static int timeout = -1;
-static cb_view_t *views = NULL;
+static cb_view_t *views;
static size_t views_num = 0;
-static CURL *curl = NULL;
+static CURL *curl;
-static char *bind_buffer = NULL;
+static char *bind_buffer;
static size_t bind_buffer_size = 0;
static size_t bind_buffer_fill = 0;
static char bind_curl_error[CURL_ERROR_SIZE];
static int convert_special_metrics = 1;
/** Array of daemons to monitor */
-static struct ceph_daemon **g_daemons = NULL;
+static struct ceph_daemon **g_daemons;
/** Number of elements in g_daemons */
static size_t g_num_daemons = 0;
static char const *config_keys[] = {"CGroup", "IgnoreSelected"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static ignorelist_t *il_cgroup = NULL;
+static ignorelist_t *il_cgroup;
__attribute__((nonnull(1))) __attribute__((nonnull(2))) static void
cgroups_submit_one(char const *plugin_instance, char const *type_instance,
extern char *optarg;
extern int optind, opterr, optopt;
-static char *socket_file_g = NULL;
-static char *value_string_g = NULL;
-static char *hostname_g = NULL;
+static char *socket_file_g;
+static char *value_string_g;
+static char *hostname_g;
static range_t range_critical_g;
static range_t range_warning_g;
static int consolitation_g = CON_NONE;
static bool nan_is_error_g;
-static char **match_ds_g = NULL;
+static char **match_ds_g;
static size_t match_ds_num_g = 0;
/* `strdup' is an XSI extension. I don't want to pull in all of XSI just for
static lcc_network_t *net;
-static c_heap_t *values_heap = NULL;
+static c_heap_t *values_heap;
static struct sigaction sigint_action;
static struct sigaction sigterm_action;
static int loop = 0;
static int restart = 0;
-static const char *pidfile = NULL;
+static const char *pidfile;
static pid_t collectd_pid = 0;
__attribute__((noreturn)) static void exit_usage(const char *name) {
};
typedef struct cpu_state_s cpu_state_t;
-static cpu_state_t *cpu_states = NULL;
+static cpu_state_t *cpu_states;
static size_t cpu_states_num = 0; /* #cpu_states allocated */
/* Highest CPU number in the current iteration. Used by the dispatch logic to
static const char *config_keys[] = {"DataDir", "StoreRates"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static char *datadir = NULL;
+static char *datadir;
static int store_rates = 0;
static int use_stdio = 0;
/*
* Global variables;
*/
-/* static CURLM *curl = NULL; */
-static web_page_t *pages_g = NULL;
+static web_page_t *pages_g;
/*
* Private functions
/*
* Private variables
*/
-static cf_callback_t *first_callback = NULL;
-static cf_complex_callback_t *complex_callback_head = NULL;
+static cf_callback_t *first_callback;
+static cf_complex_callback_t *complex_callback_head;
static cf_value_map_t cf_value_map[] = {{"TypesDB", dispatch_value_typesdb},
{"PluginDir", dispatch_value_plugindir},
/*
* Private variables
*/
-static c_avl_tree_t *plugins_loaded = NULL;
+static c_avl_tree_t *plugins_loaded;
static llist_t *list_init;
static llist_t *list_write;
static llist_t *list_log;
static llist_t *list_notification;
-static fc_chain_t *pre_cache_chain = NULL;
-static fc_chain_t *post_cache_chain = NULL;
+static fc_chain_t *pre_cache_chain;
+static fc_chain_t *post_cache_chain;
static c_avl_tree_t *data_sets;
-static char *plugindir = NULL;
+static char *plugindir;
#ifndef DEFAULT_MAX_READ_INTERVAL
#define DEFAULT_MAX_READ_INTERVAL TIME_T_TO_CDTIME_T_STATIC(86400)
#endif
-static c_heap_t *read_heap = NULL;
+static c_heap_t *read_heap;
static llist_t *read_list;
static int read_loop = 1;
static pthread_mutex_t read_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t read_cond = PTHREAD_COND_INITIALIZER;
-static pthread_t *read_threads = NULL;
+static pthread_t *read_threads;
static size_t read_threads_num = 0;
static cdtime_t max_read_interval = DEFAULT_MAX_READ_INTERVAL;
static bool write_loop = true;
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 pthread_t *write_threads;
static size_t write_threads_num = 0;
static pthread_key_t plugin_ctx_key;
cache_entry_t *entry;
};
-static c_avl_tree_t *cache_tree = NULL;
+static c_avl_tree_t *cache_tree;
static pthread_mutex_t cache_lock = PTHREAD_MUTEX_INITIALIZER;
static int cache_compare(const cache_entry_t *a, const cache_entry_t *b) {
#if !defined(HAVE_LEGACY_LIBDBI) || !HAVE_LEGACY_LIBDBI
static dbi_inst dbi_instance = 0;
#endif
-static udb_query_t **queries = NULL;
+static udb_query_t **queries;
static size_t queries_num = 0;
-static cdbi_database_t **databases = NULL;
+static cdbi_database_t **databases;
static size_t databases_num = 0;
static int cdbi_read_database(user_data_t *ud);
"ReportByDevice", "ReportInodes", "ValuesAbsolute", "ValuesPercentage"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static ignorelist_t *il_device = NULL;
-static ignorelist_t *il_mountpoint = NULL;
-static ignorelist_t *il_fstype = NULL;
+static ignorelist_t *il_device;
+static ignorelist_t *il_mountpoint;
+static ignorelist_t *il_fstype;
static bool by_device;
static bool report_inodes;
#if HAVE_LIBUDEV_H
#include <libudev.h>
-static char *conf_udev_name_attr = NULL;
+static char *conf_udev_name_attr;
static struct udev *handle_udev;
#endif
"UdevNameAttr"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static ignorelist_t *ignorelist = NULL;
+static ignorelist_t *ignorelist;
static int disk_config(const char *key, const char *value) {
if (ignorelist == NULL)
static int select_numeric_qtype = 1;
#define PCAP_SNAPLEN 1460
-static char *pcap_device = NULL;
+static char *pcap_device;
static derive_t tr_queries;
static derive_t tr_responses;
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
/* socket configuration */
-static char *sock_file = NULL;
-static char *sock_group = NULL;
+static char *sock_file;
+static char *sock_group;
static int sock_perms = S_IRWXU | S_IRWXG;
static int max_conns = MAX_CONNS;
static pthread_cond_t collector_available = PTHREAD_COND_INITIALIZER;
/* collector threads */
-static collector_t **collectors = NULL;
+static collector_t **collectors;
static pthread_mutex_t available_mutex = PTHREAD_MUTEX_INITIALIZER;
static int available_collectors;
};
typedef struct value_map_s value_map_t;
-static char **interfaces = NULL;
+static char **interfaces;
static size_t interfaces_num = 0;
-static c_avl_tree_t *value_map = NULL;
+static c_avl_tree_t *value_map;
static bool collect_mapped_only;
/*
* Private variables
*/
-static program_list_t *pl_head = NULL;
+static program_list_t *pl_head;
static pthread_mutex_t pl_lock = PTHREAD_MUTEX_INITIALIZER;
/*
};
typedef struct fc_directory_conf_s fc_directory_conf_t;
-static fc_directory_conf_t **directories = NULL;
+static fc_directory_conf_t **directories;
static size_t directories_num = 0;
static void fc_free_dir(fc_directory_conf_t *dir) {
typedef struct metric_map_s metric_map_t;
#define MC_RECEIVE_GROUP_DEFAULT "239.2.11.71"
-static char *mc_receive_group = NULL;
+static char *mc_receive_group;
#define MC_RECEIVE_PORT_DEFAULT "8649"
-static char *mc_receive_port = NULL;
+static char *mc_receive_port;
-static struct pollfd *mc_receive_sockets = NULL;
+static struct pollfd *mc_receive_sockets;
static size_t mc_receive_sockets_num = 0;
-static socket_entry_t *mc_send_sockets = NULL;
+static socket_entry_t *mc_send_sockets;
static size_t mc_send_sockets_num = 0;
static pthread_mutex_t mc_send_sockets_lock = PTHREAD_MUTEX_INITIALIZER;
{"pkts_out", "if_packets", "", "tx", -1, -1}};
static size_t metric_map_len_default = STATIC_ARRAY_SIZE(metric_map_default);
-static metric_map_t *metric_map = NULL;
+static metric_map_t *metric_map;
static size_t metric_map_len = 0;
static c_avl_tree_t *staging_tree;
static const char *config_keys[] = {"Host", "Port"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static char *hddtemp_host = NULL;
+static char *hddtemp_host;
static char hddtemp_port[16];
/*
};
typedef struct rdt_ctx_s rdt_ctx_t;
-static rdt_ctx_t *g_rdt = NULL;
+static rdt_ctx_t *g_rdt;
static rdt_config_status g_state = UNKNOWN;
};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static ignorelist_t *ignorelist = NULL;
+static ignorelist_t *ignorelist;
static bool report_inactive = true;
/*
* Module global variables
*/
-static os_handler_t *os_handler = NULL;
-static c_ipmi_instance_t *instances = NULL;
+static os_handler_t *os_handler;
+static c_ipmi_instance_t *instances;
/*
* Misc private functions
char name[64];
} ip_chain_t;
-static ip_chain_t **chain_list = NULL;
+static ip_chain_t **chain_list;
static int chain_num = 0;
static int iptables_config(const char *key, const char *value) {
static const char *config_keys[] = {"Irq", "IgnoreSelected"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static ignorelist_t *ignorelist = NULL;
+static ignorelist_t *ignorelist;
/*
* Private functions
/*
* Global variables
*/
-static JavaVM *jvm = NULL;
+static JavaVM *jvm;
static pthread_key_t jvm_env_key;
/* Configuration options for the JVM. */
-static char **jvm_argv = NULL;
+static char **jvm_argv;
static size_t jvm_argc = 0;
/* List of class names to load */
-static java_plugin_class_t *java_classes_list = NULL;
+static java_plugin_class_t *java_classes_list;
static size_t java_classes_list_len;
/* List of config, init, and shutdown callbacks. */
-static cjni_callback_info_t *java_callbacks = NULL;
+static cjni_callback_info_t *java_callbacks;
static size_t java_callbacks_num = 0;
static pthread_mutex_t java_callbacks_lock = PTHREAD_MUTEX_INITIALIZER;
-static oconfig_item_t *config_block = NULL;
+static oconfig_item_t *config_block;
/*
* Prototypes
static pthread_mutex_t file_lock = PTHREAD_MUTEX_INITIALIZER;
-static char *log_file = NULL;
+static char *log_file;
static const char *config_keys[] = {"LogLevel", "File"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
static pthread_mutex_t file_lock = PTHREAD_MUTEX_INITIALIZER;
-static char *log_file = NULL;
+static char *log_file;
static int print_timestamp = 1;
static int print_severity = 0;
#error "No applicable input method."
#endif
-#include <linux/wireless.h>
#include "madwifi.h"
+#include <linux/wireless.h>
struct stat_spec {
uint16_t flags;
"MiscAdd", "MiscRemove", "MiscSet"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static ignorelist_t *ignorelist = NULL;
+static ignorelist_t *ignorelist;
static int use_sysfs = 1;
static int init_state = 0;
static const char *config_keys[] = {"Host", "Port", NULL};
static int config_keys_num = 2;
-static char *mbmon_host = NULL;
-static char *mbmon_port = NULL;
+static char *mbmon_host;
+static char *mbmon_port;
/*
* NAME
static const char *config_keys[] = {"Device", "IgnoreSelected"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static ignorelist_t *ignorelist = NULL;
+static ignorelist_t *ignorelist;
static int md_config(const char *key, const char *value) {
if (ignorelist == NULL)
/*
* Global variables;
*/
-static web_page_t *pages_g = NULL;
+static web_page_t *pages_g;
/*
* Private functions
vl.values = &value;
vl.values_len = 1;
sstrncpy(vl.plugin, (wp->plugin_name != NULL) ? wp->plugin_name : "memcachec",
- sizeof (vl.plugin));
+ sizeof(vl.plugin));
sstrncpy(vl.plugin_instance, wp->instance, sizeof(vl.plugin_instance));
sstrncpy(vl.type, wm->type, sizeof(vl.type));
sstrncpy(vl.type_instance, wm->instance, sizeof(vl.type_instance));
static MicDeviceOnSystem mics[MAX_MICS];
static U32 num_mics = 0;
-static HANDLE mic_handle = NULL;
+static HANDLE mic_handle;
static int const therm_ids[] = {
eMicThermalDie, eMicThermalDevMem, eMicThermalFin, eMicThermalFout,
static bool show_cpu_cores = true;
static bool show_memory = true;
static bool show_temps = true;
-static ignorelist_t *temp_ignore = NULL;
+static ignorelist_t *temp_ignore;
static bool show_power = true;
-static ignorelist_t *power_ignore = NULL;
+static ignorelist_t *power_ignore;
static int mic_init(void) {
U32 ret;
/*
* Global variables
*/
-static mb_data_t *data_definitions = NULL;
+static mb_data_t *data_definitions;
/*
* Functions
};
typedef struct mqtt_client_conf mqtt_client_conf_t;
-static mqtt_client_conf_t **subscribers = NULL;
+static mqtt_client_conf_t **subscribers;
static size_t subscribers_num = 0;
/*
};
static int ir_ignorelist_invert = 1;
-static ir_ignorelist_t *ir_ignorelist_head = NULL;
+static ir_ignorelist_t *ir_ignorelist_head;
static struct mnl_socket *nl;
-static char **iflist = NULL;
+static char **iflist;
static size_t iflist_len = 0;
static const char *config_keys[] = {"Interface", "VerboseInterface",
static bool network_config_forward;
static bool network_config_stats;
-static sockent_t *sending_sockets = NULL;
+static sockent_t *sending_sockets;
-static receive_list_entry_t *receive_list_head = NULL;
-static receive_list_entry_t *receive_list_tail = NULL;
+static receive_list_entry_t *receive_list_head;
+static receive_list_entry_t *receive_list_tail;
static pthread_mutex_t receive_list_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t receive_list_cond = PTHREAD_COND_INITIALIZER;
static uint64_t receive_list_length = 0;
-static sockent_t *listen_sockets = NULL;
-static struct pollfd *listen_sockets_pollfd = NULL;
+static sockent_t *listen_sockets;
+static struct pollfd *listen_sockets_pollfd;
static size_t listen_sockets_num = 0;
/* The receive and dispatch threads will run as long as `listen_loop' is set to
#include <curl/curl.h>
-static char *url = NULL;
-static char *user = NULL;
-static char *pass = NULL;
-static char *verify_peer = NULL;
-static char *verify_host = NULL;
-static char *cacert = NULL;
-static char *timeout = NULL;
-
-static CURL *curl = NULL;
+static char *url;
+static char *user;
+static char *pass;
+static char *verify_peer;
+static char *verify_host;
+static char *cacert;
+static char *timeout;
+
+static CURL *curl;
static char nginx_buffer[16384];
static size_t nginx_buffer_len = 0;
static smtp_session_t session;
static pthread_mutex_t session_lock = PTHREAD_MUTEX_INITIALIZER;
static smtp_message_t message;
-static auth_context_t authctx = NULL;
+static auth_context_t authctx;
static int smtp_port = 25;
-static char *smtp_host = NULL;
-static char *smtp_user = NULL;
-static char *smtp_password = NULL;
-static char *email_from = NULL;
-static char *email_subject = NULL;
+static char *smtp_host;
+static char *smtp_user;
+static char *smtp_password;
+static char *email_from;
+static char *email_subject;
#define DEFAULT_SMTP_HOST "localhost"
#define DEFAULT_SMTP_FROM "root@localhost"
#define NTPD_DEFAULT_HOST "localhost"
#define NTPD_DEFAULT_PORT "123"
static int sock_descr = -1;
-static char *ntpd_host = NULL;
+static char *ntpd_host;
static char ntpd_port[16];
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
static int verify_peer = 0; // Initialized to default of 0 (false)
static int ssl_flags = UPSCLI_CONN_TRYSSL;
static int connect_timeout = -1;
-static char *ca_path = NULL;
+static char *ca_path;
static int nut_read(user_data_t *user_data);
"CollectRoutes", "CollectTopology"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static char *config_node = NULL;
-static char *config_service = NULL;
+static char *config_node;
+static char *config_service;
#define OLSRD_WANT_NOT 0
#define OLSRD_WANT_SUMMARY 1
/* features_num = */ 1}};
static int ow_family_features_num = STATIC_ARRAY_SIZE(ow_family_features);
-static char *device_g = NULL;
+static char *device_g;
static cdtime_t ow_interval = 0;
static bool direct_access;
struct direct_access_element_s *next; /**< Next in the list */
} direct_access_element_t;
-static direct_access_element_t *direct_list = NULL;
+static direct_access_element_t *direct_list;
/* ===================================================================================
*/
/*
* Global variables
*/
-static udb_query_t **queries = NULL;
+static udb_query_t **queries;
static size_t queries_num = 0;
-static o_database_t **databases = NULL;
+static o_database_t **databases;
static size_t databases_num = 0;
OCIEnv *oci_env = NULL;
/* if perl_threads != NULL perl_threads->head must
* point to the "base" thread */
-static c_ithread_list_t *perl_threads = NULL;
+static c_ithread_list_t *perl_threads;
/* the key used to store each pthread's ithread */
static pthread_key_t perl_thr_key;
static int perl_argc = 0;
-static char **perl_argv = NULL;
+static char **perl_argv;
static char base_name[DATA_MAX_NAME_LEN] = "";
* Module global variables
*/
/* {{{ */
-static pinba_statnode_t *stat_nodes = NULL;
+static pinba_statnode_t *stat_nodes;
static unsigned int stat_nodes_num = 0;
static pthread_mutex_t stat_nodes_lock;
-static char *conf_node = NULL;
-static char *conf_service = NULL;
+static char *conf_node;
+static char *conf_service;
static bool collector_thread_running;
static bool collector_thread_do_shutdown;
/*
* Private variables
*/
-static hostlist_t *hostlist_head = NULL;
+static hostlist_t *hostlist_head;
static int ping_af = PING_DEF_AF;
-static char *ping_source = NULL;
+static char *ping_source;
#ifdef HAVE_OPING_1_3
-static char *ping_device = NULL;
+static char *ping_device;
#endif
-static char *ping_data = NULL;
+static char *ping_data;
static int ping_ttl = PING_DEF_TTL;
static double ping_interval = 1.0;
static double ping_timeout = 0.9;
"table_states", "disk_io", "disk_usage"};
static int def_queries_num = STATIC_ARRAY_SIZE(def_queries);
-static c_psql_database_t **databases = NULL;
+static c_psql_database_t **databases;
static size_t databases_num = 0;
-static udb_query_t **queries = NULL;
+static udb_query_t **queries;
static size_t queries_num = 0;
-static c_psql_writer_t *writers = NULL;
+static c_psql_writer_t *writers;
static size_t writers_num = 0;
static int c_psql_begin(c_psql_database_t *db) {
{"uptime", "uptime", NULL}}; /* }}} */
static int lookup_table_length = STATIC_ARRAY_SIZE(lookup_table);
-static llist_t *list = NULL;
+static llist_t *list;
#define PDNS_LOCAL_SOCKPATH LOCALSTATEDIR "/run/" PACKAGE_NAME "-powerdns"
-static char *local_sockpath = NULL;
+static char *local_sockpath;
/* TODO: Do this before 4.4:
* - Update the collectd.conf(5) manpage.
struct procstat_entry_s *instances;
} procstat_t;
-static procstat_t *list_head_g = NULL;
+static procstat_t *list_head_g;
static bool want_init = true;
static bool report_ctx_switch;
#endif /* HAVE_PROCINFO_H */
#if HAVE_LIBTASKSTATS
-static ts_t *taskstats_handle = NULL;
+static ts_t *taskstats_handle;
#endif
/* put name of process from config to list_head_g tree
};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static ignorelist_t *values_list = NULL;
+static ignorelist_t *values_list;
/*
* Functions
static PyObject *Config_repr(PyObject *s) {
Config *self = (Config *)s;
PyObject *ret = NULL;
- static PyObject *node_prefix = NULL, *root_prefix = NULL, *ending = NULL;
+ static PyObject *node_prefix, *root_prefix, *ending;
/* This is ok because we have the GIL, so this is thread-save by default. */
if (node_prefix == NULL)
static PyObject *cpy_common_repr(PyObject *s) {
PyObject *ret, *tmp;
- static PyObject *l_type = NULL, *l_type_instance = NULL, *l_plugin = NULL,
- *l_plugin_instance = NULL;
- static PyObject *l_host = NULL, *l_time = NULL;
+ static PyObject *l_type, *l_type_instance, *l_plugin, *l_plugin_instance;
+ static PyObject *l_host, *l_time;
PluginData *self = (PluginData *)s;
if (l_type == NULL)
static PyObject *PluginData_repr(PyObject *s) {
PyObject *ret;
- static PyObject *l_closing = NULL;
+ static PyObject *l_closing;
if (l_closing == NULL)
l_closing = cpy_string_to_unicode_or_bytes(")");
static PyObject *Values_repr(PyObject *s) {
PyObject *ret, *tmp;
- static PyObject *l_interval = NULL, *l_values = NULL, *l_meta = NULL,
- *l_closing = NULL;
+ static PyObject *l_interval, *l_values, *l_meta, *l_closing;
Values *self = (Values *)s;
if (l_interval == NULL)
static PyObject *Notification_repr(PyObject *s) {
PyObject *ret, *tmp;
- static PyObject *l_severity = NULL, *l_message = NULL, *l_meta = NULL,
- *l_closing = NULL;
+ static PyObject *l_severity, *l_message, *l_meta, *l_closing;
Notification *self = (Notification *)s;
if (l_severity == NULL)
redis_node_t *next;
};
-static redis_node_t *nodes_head = NULL;
+static redis_node_t *nodes_head;
static int redis_node_add(const redis_node_t *rn) /* {{{ */
{
/*
* Private variables
*/
-static char *datadir = NULL;
-static char *daemon_address = NULL;
+static char *datadir;
+static char *daemon_address;
static bool config_create_files = true;
static bool config_collect_stats = true;
static rrdcreate_config_t rrdcreate_config = {
/* If datadir is zero, the daemon's basedir is used. If stepsize or heartbeat
* is zero a default, depending on the `interval' member of the value list is
* being used. */
-static char *datadir = NULL;
+static char *datadir;
static double write_rate = 0.0;
static rrdcreate_config_t rrdcreate_config = {
/* stepsize = */ 0,
static cdtime_t cache_flush_timeout = 0;
static cdtime_t random_timeout = 0;
static cdtime_t cache_flush_last;
-static c_avl_tree_t *cache = NULL;
+static c_avl_tree_t *cache;
static pthread_mutex_t cache_lock = PTHREAD_MUTEX_INITIALIZER;
-static rrd_queue_t *queue_head = NULL;
-static rrd_queue_t *queue_tail = NULL;
-static rrd_queue_t *flushq_head = NULL;
-static rrd_queue_t *flushq_tail = NULL;
+static rrd_queue_t *queue_head;
+static rrd_queue_t *queue_tail;
+static rrd_queue_t *flushq_head;
+static rrd_queue_t *flushq_tail;
static pthread_t queue_thread;
static int queue_thread_running = 1;
static pthread_mutex_t queue_lock = PTHREAD_MUTEX_INITIALIZER;
struct featurelist *next;
} featurelist_t;
-static char *conffile = NULL;
+static char *conffile;
static bool use_labels;
/* #endif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500) */
"as bug."
#endif
-static featurelist_t *first_feature = NULL;
+static featurelist_t *first_feature;
static ignorelist_t *sensor_list;
#if SENSORS_API_VERSION < 0x400
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static ignorelist_t *ignorelist = NULL;
+static ignorelist_t *ignorelist;
static int ignore_sleep_mode = 0;
static int use_serial = 0;
/*
* Private variables
*/
-static data_definition_t *data_head = NULL;
+static data_definition_t *data_head;
/*
* Prototypes
};
typedef struct snmp_agent_ctx_s snmp_agent_ctx_t;
-static snmp_agent_ctx_t *g_agent = NULL;
+static snmp_agent_ctx_t *g_agent;
#define CHECK_DD_TYPE(_dd, _p, _pi, _t, _ti) \
(_dd->plugin ? !strcmp(_dd->plugin, _p) : 0) && \
};
typedef struct statsd_metric_s statsd_metric_t;
-static c_avl_tree_t *metrics_tree = NULL;
+static c_avl_tree_t *metrics_tree;
static pthread_mutex_t metrics_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_t network_thread;
static bool network_thread_running;
static bool network_thread_shutdown;
-static char *conf_node = NULL;
-static char *conf_service = NULL;
+static char *conf_node;
+static char *conf_service;
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 double *conf_timer_percentile;
static size_t conf_timer_percentile_num;
static bool conf_counter_sum;
/* #endif defined(VM_SWAPUSAGE) */
#elif HAVE_LIBKVM_GETSWAPINFO
-static kvm_t *kvm_obj = NULL;
+static kvm_t *kvm_obj;
int kvm_pagesize;
/* #endif HAVE_LIBKVM_GETSWAPINFO */
};
typedef struct ctail_config_match_s ctail_config_match_t;
-static cu_tail_match_t **tail_match_list = NULL;
+static cu_tail_match_t **tail_match_list;
static size_t tail_match_list_num = 0;
static cdtime_t tail_match_list_intervals[255];
return 0;
} /* int ctail_config_add_match_dstype */
-static int ctail_config_add_match(cu_tail_match_t *tm,
- const char *plugin_name,
+static int ctail_config_add_match(cu_tail_match_t *tm, const char *plugin_name,
const char *plugin_instance,
oconfig_item_t *ci, cdtime_t interval) {
ctail_config_match_t cm = {0};
// TODO(octo): there's nothing "simple" about the latency stuff …
status = tail_match_add_match_simple(
tm, cm.regex, cm.excluderegex, cm.flags,
- (plugin_name != NULL) ? plugin_name : "tail", plugin_instance,
- cm.type, cm.type_instance, cm.latency, interval);
+ (plugin_name != NULL) ? plugin_name : "tail", plugin_instance, cm.type,
+ cm.type_instance, cm.latency, interval);
if (status != 0)
ERROR("tail plugin: tail_match_add_match_simple failed.");
int status = 0;
if (strcasecmp("Plugin", option->key) == 0)
- status = cf_util_get_string (option, &plugin_name);
+ status = cf_util_get_string(option, &plugin_name);
else if (strcasecmp("Instance", option->key) == 0)
status = cf_util_get_string(option, &plugin_instance);
else if (strcasecmp("Interval", option->key) == 0)
typedef struct instance_definition_s instance_definition_t;
/* Private */
-static metric_definition_t *metric_head = NULL;
+static metric_definition_t *metric_head;
static int tcsv_submit(instance_definition_t *id, metric_definition_t *md,
value_t v, cdtime_t t) {
static int port_collect_listening = 0;
static int port_collect_total = 0;
-static port_entry_t *port_list_head = NULL;
+static port_entry_t *port_list_head;
static uint32_t count_total[TCP_STATE_MAX + 1];
#if KERNEL_LINUX
int port;
struct vserver_list_s *next;
} vserver_list_t;
-static vserver_list_t *server_list = NULL;
+static vserver_list_t *server_list;
/* Host data */
-static char *config_host = NULL;
-static char *config_port = NULL;
+static char *config_host;
+static char *config_port;
-static FILE *global_read_fh = NULL;
-static FILE *global_write_fh = NULL;
+static FILE *global_read_fh;
+static FILE *global_write_fh;
/* Config data */
static const char *config_keys[] = {"Host", "Port", "Server"};
#define DEFAULT_DEVICE "/dev/ttyUSB0"
-static char *conf_device = NULL;
+static char *conf_device;
static int conf_retries = 0;
static int fd = -1;
static const char *config_keys[] = {"Host", "Port"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static char *config_host = NULL;
-static char *config_port = NULL;
+static char *config_host;
+static char *config_port;
-static TCRDB *rdb = NULL;
+static TCRDB *rdb;
static int tt_config(const char *key, const char *value) {
if (strcasecmp("Host", key) == 0) {
/* socket configuration */
static int sock_fd = -1;
-static char *sock_file = NULL;
-static char *sock_group = NULL;
+static char *sock_file;
+static char *sock_group;
static int sock_perms = S_IRWXU | S_IRWXG;
static bool delete_socket;
*/
#if HAVE_PCAP_H
-static pcap_t *pcap_obj = NULL;
+static pcap_t *pcap_obj;
#endif
-static ip_list_t *IgnoreList = NULL;
+static ip_list_t *IgnoreList;
#if HAVE_PCAP_H
-static void (*Callback)(const rfc1035_header_t *) = NULL;
+static void (*Callback)(const rfc1035_header_t *);
static int query_count_intvl = 0;
static int query_count_total = 0;
static pthread_mutex_t librrd_lock = PTHREAD_MUTEX_INITIALIZER;
#endif
-static async_create_file_t *async_creation_list = NULL;
+static async_create_file_t *async_creation_list;
static pthread_mutex_t async_creation_lock = PTHREAD_MUTEX_INITIALIZER;
/*
#define UUID_PRINTABLE_COMPACT_LENGTH (UUID_RAW_LENGTH * 2)
#define UUID_PRINTABLE_NORMAL_LENGTH (UUID_PRINTABLE_COMPACT_LENGTH + 4)
-static char *uuidfile = NULL;
+static char *uuidfile;
static const char *config_keys[] = {"UUIDFile"};
/* Connection. */
static virConnectPtr conn = 0;
-static char *conn_string = NULL;
+static char *conn_string;
static c_complain_t conn_complain = C_COMPLAIN_INIT_STATIC;
/* Node information required for %CPU */
static int interval = 60;
/* List of domains, if specified. */
-static ignorelist_t *il_domains = NULL;
+static ignorelist_t *il_domains;
/* List of block devices, if specified. */
-static ignorelist_t *il_block_devices = NULL;
+static ignorelist_t *il_block_devices;
/* List of network interface devices, if specified. */
-static ignorelist_t *il_interface_devices = NULL;
+static ignorelist_t *il_interface_devices;
static int ignore_device_match(ignorelist_t *, const char *domname,
const char *devpath);
int reference_count;
};
-static char *sensu_tags = NULL;
-static char **sensu_attrs = NULL;
+static char *sensu_tags;
+static char **sensu_attrs;
static size_t sensu_attrs_num;
static int add_str_to_list(struct str_list *strs,
#define ZOOKEEPER_DEF_HOST "127.0.0.1"
#define ZOOKEEPER_DEF_PORT "2181"
-static char *zk_host = NULL;
-static char *zk_port = NULL;
+static char *zk_host;
+static char *zk_port;
static const char *config_keys[] = {"Host", "Port"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);