whitespace cleanup
[monky] / src / text_object.h
index 27fa67a..d87f597 100644 (file)
@@ -35,6 +35,7 @@
 #endif
 
 #include "mail.h"              /* local_mail_s */
+#include "fs.h"                        /* struct fs_stat */
 
 #ifdef NVIDIA
 #include "nvidia.h"            /* nvidia_s */
@@ -55,6 +56,7 @@ enum text_object_type {
        OBJ_battery_time,
        OBJ_battery_percent,
        OBJ_battery_bar,
+       OBJ_battery_short,
 #endif /* !__OpenBSD__ */
        OBJ_buffers,
        OBJ_cached,
@@ -130,10 +132,18 @@ enum text_object_type {
        OBJ_i8k_right_fan_rpm,
        OBJ_i8k_ac_status,
        OBJ_i8k_buttons_status,
+#if defined(IBM)
        OBJ_ibm_fan,
        OBJ_ibm_temps,
        OBJ_ibm_volume,
        OBJ_ibm_brightness,
+       OBJ_smapi,
+       OBJ_smapi_bat_bar,
+       OBJ_smapi_bat_perc,
+       OBJ_smapi_bat_temp,
+       OBJ_smapi_bat_power,
+       OBJ_if_smapi_bat_installed,
+#endif /* IBM */
        OBJ_if_up,
        OBJ_if_gw,
        OBJ_ioscheduler,
@@ -153,11 +163,13 @@ enum text_object_type {
        OBJ_wireless_link_bar,
 #endif /* __linux__ */
        OBJ_if_empty,
+       OBJ_if_match,
        OBJ_if_existing,
        OBJ_if_mounted,
        OBJ_if_running,
        OBJ_top,
        OBJ_top_mem,
+       OBJ_top_time,
        OBJ_tail,
        OBJ_head,
        OBJ_lines,
@@ -166,6 +178,17 @@ enum text_object_type {
        OBJ_loadavg,
        OBJ_machine,
        OBJ_mails,
+       OBJ_new_mails,
+       OBJ_seen_mails,
+       OBJ_unseen_mails,
+       OBJ_flagged_mails,
+       OBJ_unflagged_mails,
+       OBJ_forwarded_mails,
+       OBJ_unforwarded_mails,
+       OBJ_replied_mails,
+       OBJ_unreplied_mails,
+       OBJ_draft_mails,
+       OBJ_trashed_mails,
        OBJ_mboxscan,
        OBJ_mem,
        OBJ_memeasyfree,
@@ -187,7 +210,6 @@ enum text_object_type {
        OBJ_monitor_number,
 #endif
        OBJ_nameserver,
-       OBJ_new_mails,
        OBJ_nodename,
        OBJ_nvidia,
        OBJ_pre_exec,
@@ -336,14 +358,6 @@ enum text_object_type {
 #ifdef HDDTEMP
        OBJ_hddtemp,
 #endif
-#ifdef SMAPI
-       OBJ_smapi,
-       OBJ_smapi_bat_bar,
-       OBJ_smapi_bat_perc,
-       OBJ_smapi_bat_temp,
-       OBJ_smapi_bat_power,
-       OBJ_if_smapi_bat_installed,
-#endif
        OBJ_scroll,
        OBJ_entropy_avail,
        OBJ_entropy_poolsize,
@@ -352,6 +366,7 @@ enum text_object_type {
 
 struct text_object {
        struct text_object *next, *prev;        /* doubly linked list of text objects */
+       struct text_object *sub;                /* for objects parsing text into objects */
        union {
                char *s;                /* some string */
                int i;                  /* some integer */
@@ -485,10 +500,15 @@ struct text_object {
 /* text object list helpers */
 int append_object(struct text_object *root, struct text_object *obj);
 
-/* ifblock helpers */
-int obj_be_ifblock_if(struct text_object *);
-int obj_be_ifblock_else(struct text_object *);
-int obj_be_ifblock_endif(struct text_object *);
-int ifblock_stack_empty(void);
+/* ifblock helpers
+ *
+ * Opaque is a pointer to the address of the ifblock stack's top object.
+ * Calling clients should pass the address of a defined void pointer which
+ * was initialised to NULL (empty stack).
+ * */
+int obj_be_ifblock_if(void **opaque, struct text_object *);
+int obj_be_ifblock_else(void **opaque, struct text_object *);
+int obj_be_ifblock_endif(void **opaque, struct text_object *);
+int ifblock_stack_empty(void **opaque);
 
 #endif /* _TEXT_OBJECT_H */