X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fconky.c;h=d9c82d6ebba05edee13c8515c40bdd3ff41c3b5f;hb=9a85812e06f8a278d36b988765c102eaf1c60f88;hp=94980da278397daef6992be878b4a60f34c24b62;hpb=ec174bedf2e4af270945973ed851a75c4801333d;p=monky diff --git a/src/conky.c b/src/conky.c index 94980da..d9c82d6 100644 --- a/src/conky.c +++ b/src/conky.c @@ -25,8 +25,10 @@ * */ +#include "config.h" #include "text_object.h" #include "conky.h" +#include "common.h" #include #include #include @@ -40,6 +42,7 @@ #endif #include #ifdef X11 +#include "x11.h" #include #ifdef HAVE_XDAMAGE #include @@ -55,6 +58,35 @@ #include #include +/* local headers */ +#include "build.h" +#include "diskio.h" +#include "fs.h" +#include "logging.h" +#include "mixer.h" +#include "mail.h" +#include "mboxscan.h" +#include "temphelper.h" +#include "top.h" + +/* check for OS and include appropriate headers */ +#if defined(__linux__) +#include "linux.h" +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +#include "freebsd.h" +#elif defined(__OpenBSD__) +#include "openbsd.h" +#endif + +/* FIXME: apm_getinfo is unused here. maybe it's meant for common.c */ +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \ + || defined(__OpenBSD__)) && (defined(i386) || defined(__i386__)) +int apm_getinfo(int fd, apm_info_t aip); +char *get_apm_adapter(void); +char *get_apm_battery_life(void); +char *get_apm_battery_time(void); +#endif + #ifdef HAVE_ICONV #include #endif @@ -66,10 +98,6 @@ #endif #endif -#include "build.h" - -#include "temphelper.h" - #ifndef S_ISSOCK #define S_ISSOCK(x) ((x & S_IFMT) == S_IFSOCK) #endif @@ -81,10 +109,30 @@ //#define SIGNAL_BLOCKING #undef SIGNAL_BLOCKING -/* debugging level */ +/* debugging level, used by logging.h */ int global_debug_level = 0; +/* two strings for internal use */ +static char *tmpstring1, *tmpstring2; + +/* variables holding various config settings */ +int short_units; +int cpu_separate; +static int use_spacer; +int top_cpu, top_mem; +#define TO_X 1 +#define TO_STDOUT 2 +static int output_methods; +static volatile int g_signal_pending; +/* Update interval */ +static double update_interval; + + +/* prototypes for internally used functions */ +static void signal_handler(int); static void print_version(void) __attribute__((noreturn)); +static void reload_config(void); +static void clean_up(void); static void print_version(void) { @@ -339,6 +387,10 @@ static void load_fonts(void) #endif /* X11 */ +/* struct that has all info to be shared between + * instances of the same text object */ +struct information info; + /* default config file */ static char *current_config; @@ -6931,7 +6983,7 @@ static void main_loop(void) static void load_config_file(const char *); /* reload the config file */ -void reload_config(void) +static void reload_config(void) { timed_thread_destroy_registered_threads(); @@ -7034,7 +7086,7 @@ void reload_config(void) } } -void clean_up(void) +static void clean_up(void) { timed_thread_destroy_registered_threads(); @@ -8399,7 +8451,7 @@ int main(int argc, char **argv) return 0; } -void signal_handler(int sig) +static void signal_handler(int sig) { /* signal handler is light as a feather, as it should be. * we will poll g_signal_pending with each loop of conky