+#define CASE_SEC(name) \
+ if (BEGINS_WITH(current, name)) \
+ with(cfg_t *, sec, cfg_getsec(cfg, name)) \
+ if (sec != NULL)
+
+#define CASE_SEC_TITLE(name) \
+ if (BEGINS_WITH(current, name)) \
+ with(const char *, title, current + strlen(name) + 1) \
+ with(cfg_t *, sec, cfg_gettsec(cfg, name, title)) \
+ if (sec != NULL)
+
+
+typedef enum { CS_DISCHARGING, CS_CHARGING, CS_FULL } charging_status_t;