here comes the big header include rewrite
[monky] / src / common.h
index 710ee7e..d68d075 100644 (file)
@@ -1,5 +1,8 @@
-#ifndef COMMON_H_
-#define COMMON_H_
+#ifndef _COMMON_H
+#define _COMMON_H
+
+#include <stdio.h>
+#include <sys/socket.h>
 
 int check_mount(char *s);
 void update_diskio(void);
@@ -9,8 +12,10 @@ void update_meminfo(void);
 void update_net_stats(void);
 void update_cpu_usage(void);
 void update_total_processes(void);
+void update_uname(void);
 void update_running_processes(void);
 void update_i8k(void);
+void update_stuff(void);
 char get_freq(char *, size_t, const char *, int, unsigned int);
 void get_freq_dynamic(char *, size_t, const char *, int);
 char get_voltage(char *, size_t, const char *, int, unsigned int);     /* ptarjan */
@@ -19,6 +24,48 @@ void update_top(void);
 void free_all_processes(void);
 struct process *get_first_process(void);
 void get_cpu_count(void);
+double get_time(void);
+
+FILE *open_file(const char *, int *);
+void variable_substitute(const char *s, char *dest, unsigned int n);
+
+void format_seconds(char *buf, unsigned int n, long t);
+void format_seconds_short(char *buf, unsigned int n, long t);
+
+#ifdef X11
+void update_x11info(void);
+#endif
+
+int round_to_int(float);
+
+extern unsigned long long need_mask;
+extern int no_buffers;
+
+struct dns_data {
+        int nscount;
+        char **ns_list;
+};
+void free_dns_data(void);
+
+struct net_stat {
+        const char *dev;
+        int up;
+        long long last_read_recv, last_read_trans;
+        long long recv, trans;
+        double recv_speed, trans_speed;
+        struct sockaddr addr;
+        char* addrs;
+        double net_rec[15], net_trans[15];
+        // wireless extensions
+        char essid[32];
+        char bitrate[16];
+        char mode[16];
+        int link_qual;
+        int link_qual_max;
+        char ap[18];
+};
+void clear_net_stats(void);
+struct net_stat *get_net_stat(const char *);
 
 int open_sysfs_sensor(const char *dir, const char *dev, const char *type, int n,
        int *divisor, char *devtype);
@@ -44,4 +91,4 @@ void get_battery_stuff(char *buf, unsigned int n, const char *bat, int item);
 int get_battery_perct(const char *bat);
 int get_battery_perct_bar(const char *bat);
 
-#endif /*COMMON_H_*/
+#endif /* _COMMON_H */