1 /* Conky, a system monitor, based on torsmo
3 * Any original torsmo code is licensed under the BSD license
5 * All code written since the fork of torsmo is licensed under the GPL
7 * Please see COPYING for details
9 * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
10 * Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
12 * All rights reserved.
14 * This program is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation, either version 3 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program. If not, see <http://www.gnu.org/licenses/>.
27 #ifndef _TEXT_OBJECT_H
28 #define _TEXT_OBJECT_H
30 #include "config.h" /* for the defines */
31 #include "timed_thread.h" /* timed_thread */
33 #ifdef TCP_PORT_MONITOR
34 #include "tcp-portmon.h" /* tcp_port_monitor_data */
37 #include "mail.h" /* local_mail_s */
38 #include "fs.h" /* struct fs_stat */
41 #include "nvidia.h" /* nvidia_s */
44 enum text_object_type {
46 #if defined(__linux__)
48 #endif /* __linux__ */
60 #endif /* !__OpenBSD__ */
88 OBJ_diskiograph_write,
127 #if defined(__linux__)
133 OBJ_i8k_left_fan_status,
134 OBJ_i8k_right_fan_status,
135 OBJ_i8k_left_fan_rpm,
136 OBJ_i8k_right_fan_rpm,
138 OBJ_i8k_buttons_status,
149 OBJ_if_smapi_bat_installed,
151 /* information from sony_laptop kernel module
152 * /sys/devices/platform/sony-laptop */
164 OBJ_wireless_bitrate,
166 OBJ_wireless_link_qual,
167 OBJ_wireless_link_qual_max,
168 OBJ_wireless_link_qual_perc,
169 OBJ_wireless_link_bar,
170 #endif /* __linux__ */
171 #if defined(__FreeBSD__) || defined(__linux__)
197 OBJ_unforwarded_mails,
227 OBJ_running_processes,
256 #if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \
257 || defined(__OpenBSD__)) && (defined(i386) || defined(__i386__))
259 OBJ_apm_battery_time,
260 OBJ_apm_battery_life,
261 #endif /* __FreeBSD__ __OpenBSD__ */
263 OBJ_obsd_sensors_temp,
264 OBJ_obsd_sensors_fan,
265 OBJ_obsd_sensors_volt,
268 #endif /* __OpenBSD__ */
320 OBJ_xmms2_timesplayed,
321 OBJ_if_xmms2_connected,
324 OBJ_audacious_status,
326 OBJ_audacious_length,
327 OBJ_audacious_length_seconds,
328 OBJ_audacious_position,
329 OBJ_audacious_position_seconds,
330 OBJ_audacious_bitrate,
331 OBJ_audacious_frequency,
332 OBJ_audacious_channels,
333 OBJ_audacious_filename,
334 OBJ_audacious_playlist_length,
335 OBJ_audacious_playlist_position,
336 OBJ_audacious_main_volume,
353 #ifdef TCP_PORT_MONITOR
366 OBJ_entropy_poolsize,
378 OBJ_apcupsd_loadgraph,
380 OBJ_apcupsd_timeleft,
382 OBJ_apcupsd_lastxfer,
387 struct text_object *next, *prev; /* doubly linked list of text objects */
388 struct text_object *sub; /* for objects parsing text into objects */
390 char *s; /* some string */
391 int i; /* some integer */
392 long l; /* some other integer */
394 struct net_stat *net;
396 struct diskio_stat *diskio;
397 unsigned char loadavg[3];
398 unsigned int cpu_index;
407 char *tz; /* timezone variable */
408 char *fmt; /* time display formatting */
429 struct text_object *next;
447 /* If not -1, a file descriptor to read from when
448 * logfile is a FIFO. */
465 timed_thread *p_timed_thread;
471 #ifdef TCP_PORT_MONITOR
472 struct tcp_port_monitor_data tcp_port_monitor;
496 unsigned int nrspaces;
512 struct local_mail_s local_mail;
514 struct nvidia_s nvidia;
521 unsigned int c, d, e;
527 /* text object list helpers */
528 int append_object(struct text_object *root, struct text_object *obj);
532 * Opaque is a pointer to the address of the ifblock stack's top object.
533 * Calling clients should pass the address of a defined void pointer which
534 * was initialised to NULL (empty stack).
536 int obj_be_ifblock_if(void **opaque, struct text_object *);
537 int obj_be_ifblock_else(void **opaque, struct text_object *);
538 int obj_be_ifblock_endif(void **opaque, struct text_object *);
539 int ifblock_stack_empty(void **opaque);
541 #endif /* _TEXT_OBJECT_H */