updated configure print summary with new XOAP flag
[monky] / src / common.h
index 9f3977c..ba2bb17 100644 (file)
@@ -27,6 +27,10 @@ struct process *get_first_process(void);
 void get_cpu_count(void);
 double get_time(void);
 
+/* Converts '~/...' paths to '/home/blah/...' assumes that 'dest' is at least
+ * DEFAULT_TEXT_BUFFER_SIZE.  It's similar to variable_substitute, except only
+ * cheques for $HOME and ~/ in path */
+void to_real_path(char *dest, const char *source);
 FILE *open_file(const char *, int *);
 void variable_substitute(const char *s, char *dest, unsigned int n);
 
@@ -37,7 +41,9 @@ void format_seconds_short(char *buf, unsigned int n, long t);
 void update_x11info(void);
 #endif
 
-int round_to_int(float);
+int round_to_int_temp(float);
+
+unsigned int round_to_int(float);
 
 extern unsigned long long need_mask;
 extern int no_buffers;
@@ -49,13 +55,15 @@ struct dns_data {
 void free_dns_data(void);
 
 struct net_stat {
-        const char *dev;
+        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;
+#if defined(__linux__)
+        char addrs[273];
+#endif /* __linux__ */
         double net_rec[15], net_trans[15];
         // wireless extensions
         char essid[32];
@@ -66,19 +74,8 @@ struct net_stat {
         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);
-
-#define open_i2c_sensor(dev, type, n, divisor, devtype) \
-       open_sysfs_sensor("/sys/bus/i2c/devices/", dev, type, n, divisor, devtype)
-#define open_platform_sensor(dev, type, n, divisor, devtype) \
-       open_sysfs_sensor("/sys/bus/platform/devices/", dev, type, n, divisor, devtype)
-#define open_hwmon_sensor(dev, type, n, divisor, devtype) \
-       open_sysfs_sensor("/sys/class/hwmon/", dev, type, n, divisor, devtype)
-
-double get_sysfs_info(int *fd, int arg, char *devtype, char *type);
+struct net_stat *get_net_stat(const char *dev, void *free_at_crash1, void *free_at_crash2);
+int interface_up(const char *dev);
 
 void get_adt746x_cpu(char *, size_t);
 void get_adt746x_fan(char *, size_t);
@@ -92,4 +89,14 @@ int get_battery_perct(const char *bat);
 int get_battery_perct_bar(const char *bat);
 void get_battery_short_status(char *buf, unsigned int n, const char *bat);
 
+/*
+ * used by RSS and Weather
+ */
+struct MemoryStruct {
+       char *memory;
+       size_t size;
+};
+
+size_t WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data);
+
 #endif /* _COMMON_H */