-typedef enum { CS_DISCHARGING, CS_CHARGING, CS_FULL } charging_status_t;
-enum { ORDER_RUN, ORDER_WLAN, ORDER_ETH, ORDER_BATTERY, ORDER_CPU_TEMPERATURE, ORDER_LOAD, ORDER_TIME, ORDER_IPV6, MAX_ORDER };
+#define THERMAL_ZONE "hw.acpi.thermal.tz%d.temperature"
+#define BATT_LIFE "hw.acpi.battery.life"
+#define BATT_TIME "hw.acpi.battery.time"
+#define BATT_STATE "hw.acpi.battery.state"
+
+#endif
+
+#if defined(__FreeBSD_kernel__) && defined(__GLIBC__)
+
+#include <sys/stat.h>
+#include <sys/param.h>
+
+#endif
+
+/* Allows for the definition of a variable without opening a new scope, thus
+ * suited for usage in a macro. Idea from wmii. */
+#define with(type, var, init) \
+ for (type var = (type)-1; (var == (type)-1) && ((var=(init)) || 1); )
+
+#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)