char percentagebuf[16];
char remainingbuf[256];
char emptytimebuf[256];
+ char consumptionbuf[256];
const char *walk, *last;
char *outwalk = buffer;
int full_design = -1,
memset(percentagebuf, '\0', sizeof(percentagebuf));
memset(remainingbuf, '\0', sizeof(remainingbuf));
memset(emptytimebuf, '\0', sizeof(emptytimebuf));
+ memset(consumptionbuf, '\0', sizeof(consumptionbuf));
INSTANCE(path);
(void)snprintf(emptytimebuf, sizeof(emptytimebuf), "%02d:%02d:%02d",
max(empty_tm->tm_hour, 0), max(empty_tm->tm_min, 0), max(empty_tm->tm_sec, 0));
+ (void)snprintf(consumptionbuf, sizeof(consumptionbuf), "%1.2fW",
+ ((float)present_rate / 1000.0 / 1000.0));
+
END_COLOR;
}
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
} else if (strncmp(walk+1, "emptytime", strlen("emptytime")) == 0) {
outwalk += sprintf(outwalk, "%s", emptytimebuf);
walk += strlen("emptytime");
+ } else if (strncmp(walk+1, "consumption", strlen("consumption")) == 0) {
+ outwalk += sprintf(outwalk, "%s", consumptionbuf);
+ walk += strlen("consumptionbuf");
}
}