blob: 4516d396028b5429eb4f733a540d26e2ea5b5d36 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
#ifndef __DEVICES_H__
#define __DEVICES_H__
#include "hardinfo.h"
#include "processor-platform.h"
#include "dmi_util.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);
gchar *processor_get_detailed_info(Processor * processor);
gchar *processor_get_info(GSList * processors);
gchar *processor_name(GSList * processors);
gchar *processor_name_default(GSList * processors);
gchar *processor_describe(GSList * processors);
gchar *processor_describe_default(GSList * processors);
gchar *processor_describe_by_counting_names(GSList * processors);
gchar *processor_frequency_desc(GSList *processors);
/* Printers */
void init_cups(void);
/* Battery */
void scan_battery_do(void);
/* PCI */
void scan_pci_do(void);
/* Printers */
void scan_printers_do(void);
/* Sensors */
#define SENSORS_GROUP_BY_TYPE 1
void scan_sensors_do(void);
void sensor_init(void);
void sensor_shutdown(void);
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 *sensor_icons;
extern gchar *storage_icons;
extern gchar *storage_list;
extern gchar *usb_list;
extern gchar *usb_icons;
extern GHashTable *_pci_devices;
extern GHashTable *sensor_compute;
extern GHashTable *sensor_labels;
extern GModule *cups;
extern gchar *dmi_info;
extern gchar *dtree_info;
extern gchar *gpu_list;
extern gchar *gpu_summary;
#endif /* __DEVICES_H__ */
|