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__ */
62 #endif /* !__OpenBSD__ */
93 OBJ_diskiograph_write,
139 #if defined(__linux__)
145 OBJ_i8k_left_fan_status,
146 OBJ_i8k_right_fan_status,
147 OBJ_i8k_left_fan_rpm,
148 OBJ_i8k_right_fan_rpm,
150 OBJ_i8k_buttons_status,
163 OBJ_if_smapi_bat_installed,
165 /* information from sony_laptop kernel module
166 * /sys/devices/platform/sony-laptop */
178 OBJ_wireless_bitrate,
180 OBJ_wireless_link_qual,
181 OBJ_wireless_link_qual_max,
182 OBJ_wireless_link_qual_perc,
184 OBJ_wireless_link_bar,
186 #endif /* __linux__ */
187 #if defined(__FreeBSD__) || defined(__linux__)
213 OBJ_unforwarded_mails,
247 OBJ_running_processes,
280 #if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \
281 || defined(__OpenBSD__)) && (defined(i386) || defined(__i386__))
283 OBJ_apm_battery_time,
284 OBJ_apm_battery_life,
285 #endif /* __FreeBSD__ __OpenBSD__ */
287 OBJ_obsd_sensors_temp,
288 OBJ_obsd_sensors_fan,
289 OBJ_obsd_sensors_volt,
292 #endif /* __OpenBSD__ */
348 OBJ_xmms2_timesplayed,
349 OBJ_if_xmms2_connected,
352 OBJ_audacious_status,
354 OBJ_audacious_length,
355 OBJ_audacious_length_seconds,
356 OBJ_audacious_position,
357 OBJ_audacious_position_seconds,
358 OBJ_audacious_bitrate,
359 OBJ_audacious_frequency,
360 OBJ_audacious_channels,
361 OBJ_audacious_filename,
362 OBJ_audacious_playlist_length,
363 OBJ_audacious_playlist_position,
364 OBJ_audacious_main_volume,
387 #ifdef TCP_PORT_MONITOR
400 OBJ_entropy_poolsize,
415 OBJ_apcupsd_loadgraph,
416 OBJ_apcupsd_loadgauge,
419 OBJ_apcupsd_timeleft,
421 OBJ_apcupsd_lastxfer,
426 struct text_object *next, *prev; /* doubly linked list of text objects */
427 struct text_object *sub; /* for objects parsing text into objects */
429 char *s; /* some string */
430 int i; /* some integer */
431 long l; /* some other integer */
433 struct net_stat *net;
435 struct diskio_stat *diskio;
436 unsigned char loadavg[3];
437 unsigned int cpu_index;
446 char *tz; /* timezone variable */
447 char *fmt; /* time display formatting */
467 float factor, offset;
471 struct text_object *next;
489 /* If not -1, a file descriptor to read from when
490 * logfile is a FIFO. */
507 timed_thread *p_timed_thread;
513 #ifdef TCP_PORT_MONITOR
514 struct tcp_port_monitor_data tcp_port_monitor;
538 unsigned int nrspaces;
554 struct local_mail_s local_mail;
556 struct nvidia_s nvidia;
563 unsigned int c, d, e;
569 /* text object list helpers */
570 int append_object(struct text_object *root, struct text_object *obj);
574 * Opaque is a pointer to the address of the ifblock stack's top object.
575 * Calling clients should pass the address of a defined void pointer which
576 * was initialised to NULL (empty stack).
578 int obj_be_ifblock_if(void **opaque, struct text_object *);
579 int obj_be_ifblock_else(void **opaque, struct text_object *);
580 int obj_be_ifblock_endif(void **opaque, struct text_object *);
581 int ifblock_stack_empty(void **opaque);
583 #endif /* _TEXT_OBJECT_H */