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,
char filename[PATH_MAX];
int status;
- ssnprintf(filename, sizeof(filename), "%s/%s/%s", dir, power_supply,
- basename);
+ snprintf(filename, sizeof(filename), "%s/%s/%s", dir, power_supply, basename);
status = (int)read_file_contents(filename, buffer, buffer_size - 1);
if (status < 0)
char const *plugin_instance;
char buffer[32];
gauge_t v = NAN;
- _Bool discharging = 0;
+ bool discharging = 0;
int status;
/* Ignore non-battery directories, such as AC power. */
FILE *fh;
- ssnprintf(filename, sizeof(filename), "%s/%s/info", dir, power_supply);
+ snprintf(filename, sizeof(filename), "%s/%s/info", dir, power_supply);
fh = fopen(filename, "r");
if (fh == NULL)
return errno;
gauge_t capacity_charged = NAN;
gauge_t capacity_full = NAN;
gauge_t capacity_design = NAN;
- _Bool charging = 0;
- _Bool is_current = 0;
+ bool charging = 0;
+ bool is_current = 0;
char const *plugin_instance;
char filename[PATH_MAX];
FILE *fh;
- ssnprintf(filename, sizeof(filename), "%s/%s/state", dir, power_supply);
+ snprintf(filename, sizeof(filename), "%s/%s/state", dir, power_supply);
fh = fopen(filename, "r");
if (fh == NULL) {
if ((errno == EAGAIN) || (errno == EINTR) || (errno == ENOENT))
gauge_t voltage = NAN;
gauge_t charge = NAN;
- ssnprintf(filename, sizeof(filename), PROC_PMU_PATH_FORMAT, i);
+ snprintf(filename, sizeof(filename), PROC_PMU_PATH_FORMAT, i);
if (access(filename, R_OK) != 0)
break;
- ssnprintf(plugin_instance, sizeof(plugin_instance), "%i", i);
+ snprintf(plugin_instance, sizeof(plugin_instance), "%i", i);
fh = fopen(filename, "r");
if (fh == NULL) {