diff options
| author | Simon Quigley <tsimonq2@ubuntu.com> | 2017-06-19 15:19:47 -0500 | 
|---|---|---|
| committer | Simon Quigley <tsimonq2@ubuntu.com> | 2017-06-19 15:19:47 -0500 | 
| commit | 79c11b29d78a70ae1b04af3b7ca4ec9bb12dd8d7 (patch) | |
| tree | c4577e59ae13a8031f937991dcc3a63f68d18db5 /includes/devices.h | |
| parent | 62eb92d94fa902b4a34dafce45547680a2655b40 (diff) | |
| parent | 7aacc9f2510901c9e97b30fa9bcb550bb7f99c03 (diff) | |
Merge tag 'upstream/0.5.1+git20170605'
Upstream version 0.5.1+git20170605
Diffstat (limited to 'includes/devices.h')
| -rw-r--r-- | includes/devices.h | 95 | 
1 files changed, 95 insertions, 0 deletions
diff --git a/includes/devices.h b/includes/devices.h new file mode 100644 index 00000000..09c1c36f --- /dev/null +++ b/includes/devices.h @@ -0,0 +1,95 @@ +#ifndef __DEVICES_H__ +#define __DEVICES_H__ + +#include "hardinfo.h" +#include "processor-platform.h" + +typedef struct _Processor Processor; + +#define WALK_UNTIL(x)   while((*buf != '\0') && (*buf != x)) buf++ + +#define GET_STR(field_name,ptr)      					\ +  if (!ptr && strstr(tmp[0], field_name)) {				\ +    ptr = g_markup_escape_text(g_strstrip(tmp[1]), strlen(tmp[1]));	\ +    g_strfreev(tmp);                 					\ +    continue;                        					\ +  } + +#define get_str(field_name,ptr)               \ +  if (g_str_has_prefix(tmp[0], field_name)) { \ +    ptr = g_strdup(tmp[1]);                   \ +    g_strfreev(tmp);                          \ +    continue;                                 \ +  } +#define get_int(field_name,ptr)               \ +  if (g_str_has_prefix(tmp[0], field_name)) { \ +    ptr = atoi(tmp[1]);                       \ +    g_strfreev(tmp);                          \ +    continue;                                 \ +  } +#define get_float(field_name,ptr)             \ +  if (g_str_has_prefix(tmp[0], field_name)) { \ +    ptr = atof(tmp[1]);                       \ +    g_strfreev(tmp);                          \ +    continue;                                 \ +  } + + +/* Processor */ +GSList *processor_scan(void); +void get_processor_strfamily(Processor * processor); +void cpu_flags_init(void); +gchar *processor_get_capabilities_from_flags(gchar * strflags); +gchar *processor_get_detailed_info(Processor * processor); +gchar *processor_get_info(GSList * processors); + +/* Memory */ +void init_memory_labels(void); +void scan_memory_do(void); + +/* Printers */ +void init_cups(void); + +/* Battery */ +void scan_battery_do(void); + +/* PCI */ +void scan_pci_do(void); + +/* Printers */ +void scan_printers_do(void); + +/* Sensors */ +void scan_sensors_do(void); +void sensors_init(void); +void sensors_shutdown(void); + +#if defined(ARCH_x86) || defined(ARCH_x86_64) +/* SPD */ +void scan_spd_do(void); +#endif /* ARCH_x86 */ + +extern gchar *battery_list; +extern gchar *input_icons; +extern gchar *input_list; +extern gchar *lginterval; +extern gchar *meminfo; +extern gchar *pci_list; +extern gchar *printer_icons; +extern gchar *printer_list; +extern gchar *sensors; +extern gchar *storage_icons; +extern gchar *storage_list; +extern gchar *usb_list; +extern GHashTable *memlabels; +extern GHashTable *_pci_devices; +extern GHashTable *sensor_compute; +extern GHashTable *sensor_labels; +extern GModule *cups; + +#if defined(ARCH_x86) || defined(ARCH_x86_64) +extern gchar *dmi_info; +extern gchar *spd_info; +#endif + +#endif /* __DEVICES_H__ */  | 
