ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/statgrab.h
(Generate patch)

Comparing projects/libstatgrab/src/libstatgrab/statgrab.h (file contents):
Revision 1.37 by ats, Tue Apr 6 22:09:22 2004 UTC vs.
Revision 1.53 by ats, Sun Jul 18 20:44:01 2004 UTC

# Line 21 | Line 21
21   * $Id$
22   */
23  
24 + #ifndef STATGRAB_H
25 + #define STATGRAB_H
26 +
27   #include <sys/types.h>
28  
29   /* FIXME typedefs for 32/64-bit types */
30   /* FIXME maybe tidy up field names? */
28 /* FIXME tab/space damage */
29 /* FIXME prefixes for util functions too */
31   /* FIXME comments for less obvious fields */
32  
33   int sg_init(void);
34   int sg_drop_privileges(void);
35  
36   typedef enum {
37 <        SG_ERROR_NONE = 0
37 >        SG_ERROR_NONE = 0,
38 >        SG_ERROR_ASPRINTF,
39 >        SG_ERROR_DEVSTAT_GETDEVS,
40 >        SG_ERROR_DEVSTAT_SELECTDEVS,
41 >        SG_ERROR_ENOENT,
42 >        SG_ERROR_GETIFADDRS,
43 >        SG_ERROR_GETMNTINFO,
44 >        SG_ERROR_GETPAGESIZE,
45 >        SG_ERROR_KSTAT_DATA_LOOKUP,
46 >        SG_ERROR_KSTAT_LOOKUP,
47 >        SG_ERROR_KSTAT_OPEN,
48 >        SG_ERROR_KSTAT_READ,
49 >        SG_ERROR_KVM_GETSWAPINFO,
50 >        SG_ERROR_KVM_OPENFILES,
51 >        SG_ERROR_MALLOC,
52 >        SG_ERROR_OPEN,
53 >        SG_ERROR_OPENDIR,
54 >        SG_ERROR_PARSE,
55 >        SG_ERROR_SETEGID,
56 >        SG_ERROR_SETEUID,
57 >        SG_ERROR_SETMNTENT,
58 >        SG_ERROR_SOCKET,
59 >        SG_ERROR_SWAPCTL,
60 >        SG_ERROR_SYSCONF,
61 >        SG_ERROR_SYSCTL,
62 >        SG_ERROR_SYSCTLBYNAME,
63 >        SG_ERROR_SYSCTLNAMETOMIB,
64 >        SG_ERROR_UNAME,
65 >        SG_ERROR_UNSUPPORTED,
66 >        SG_ERROR_XSW_VER_MISMATCH
67   } sg_error;
68  
69   void sg_set_error(sg_error code, const char *arg);
70 + void sg_set_error_with_errno(sg_error code, const char *arg);
71   sg_error sg_get_error();
72 + const char *sg_get_error_arg();
73 + int sg_get_error_errno();
74   const char *sg_str_error(sg_error code);
75  
76   typedef struct {
# Line 52 | Line 85 | typedef struct {
85   sg_host_info *sg_get_host_info();
86  
87   typedef struct {
88 <        long long user;
89 <        long long kernel;
90 <        long long idle;
91 <        long long iowait;
92 <        long long swap;
93 <        long long nice;
94 <        long long total;
95 <        time_t systime;
88 >        long long user;
89 >        long long kernel;
90 >        long long idle;
91 >        long long iowait;
92 >        long long swap;
93 >        long long nice;
94 >        long long total;
95 >        time_t systime;
96   } sg_cpu_stats;
97  
98   sg_cpu_stats *sg_get_cpu_stats();
99   sg_cpu_stats *sg_get_cpu_stats_diff();
100  
101   typedef struct {
102 <        float user;
103 <        float kernel;
104 <        float idle;
105 <        float iowait;
106 <        float swap;
107 <        float nice;
102 >        float user;
103 >        float kernel;
104 >        float idle;
105 >        float iowait;
106 >        float swap;
107 >        float nice;
108          time_t time_taken;
109   } sg_cpu_percents;
110  
# Line 110 | Line 143 | typedef struct {
143   sg_swap_stats *sg_get_swap_stats();
144  
145   typedef struct {
146 <        char *device_name;
146 >        char *device_name;
147          char *fs_type;
148 <        char *mnt_point;
149 <        long long size;
150 <        long long used;
151 <        long long avail;
152 <        long long total_inodes;
148 >        char *mnt_point;
149 >        long long size;
150 >        long long used;
151 >        long long avail;
152 >        long long total_inodes;
153          long long used_inodes;
154 <        long long free_inodes;
154 >        long long free_inodes;
155   } sg_fs_stats;
156  
157   sg_fs_stats *sg_get_fs_stats(int *entries);
158  
159 + int sg_fs_compare_device_name(const void *va, const void *vb);
160 + int sg_fs_compare_mnt_point(const void *va, const void *vb);
161 +
162   typedef struct {
163          char *disk_name;
164          long long read_bytes;
# Line 133 | Line 169 | typedef struct {
169   sg_disk_io_stats *sg_get_disk_io_stats(int *entries);
170   sg_disk_io_stats *sg_get_disk_io_stats_diff(int *entries);
171  
172 + int sg_disk_io_compare_name(const void *va, const void *vb);
173 +
174   typedef struct {
175          char *interface_name;
176          long long tx;
# Line 148 | Line 186 | typedef struct {
186   sg_network_io_stats *sg_get_network_io_stats(int *entries);
187   sg_network_io_stats *sg_get_network_io_stats_diff(int *entries);
188  
189 + int sg_network_io_compare_name(const void *va, const void *vb);
190 +
191   typedef enum {
192          SG_IFACE_DUPLEX_FULL,
193          SG_IFACE_DUPLEX_HALF,
# Line 163 | Line 203 | typedef struct {
203  
204   sg_network_iface_stats *sg_get_network_iface_stats(int *entries);
205  
206 + int sg_network_iface_compare_name(const void *va, const void *vb);
207 +
208   typedef struct {
209          long long pages_pagein;
210          long long pages_pageout;
# Line 203 | Line 245 | typedef struct {
245  
246   sg_process_stats *sg_get_process_stats(int *entries);
247  
248 + int sg_process_compare_name(const void *va, const void *vb);
249 + int sg_process_compare_pid(const void *va, const void *vb);
250 + int sg_process_compare_uid(const void *va, const void *vb);
251 + int sg_process_compare_gid(const void *va, const void *vb);
252 + int sg_process_compare_size(const void *va, const void *vb);
253 + int sg_process_compare_res(const void *va, const void *vb);
254 + int sg_process_compare_cpu(const void *va, const void *vb);
255 + int sg_process_compare_time(const void *va, const void *vb);
256 +
257   typedef struct {
258          int total;
259          int running;
# Line 217 | Line 268 | sg_process_count *sg_get_process_count();
268   #include <statgrab_deprecated.h>
269   #endif
270  
271 + #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines