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.42 by tdb, Wed Apr 7 21:08:40 2004 UTC vs.
Revision 1.57 by tdb, Sat Sep 24 13:29:22 2005 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_snapshot();
35 + int sg_shutdown();
36   int sg_drop_privileges(void);
37  
38   typedef enum {
39          SG_ERROR_NONE = 0,
40          SG_ERROR_ASPRINTF,
41 +        SG_ERROR_DEVICES,
42          SG_ERROR_DEVSTAT_GETDEVS,
43          SG_ERROR_DEVSTAT_SELECTDEVS,
44 +        SG_ERROR_DISKINFO,
45          SG_ERROR_ENOENT,
46          SG_ERROR_GETIFADDRS,
47          SG_ERROR_GETMNTINFO,
48          SG_ERROR_GETPAGESIZE,
49 +        SG_ERROR_HOST,
50          SG_ERROR_KSTAT_DATA_LOOKUP,
51          SG_ERROR_KSTAT_LOOKUP,
52          SG_ERROR_KSTAT_OPEN,
# Line 48 | Line 54 | typedef enum {
54          SG_ERROR_KVM_GETSWAPINFO,
55          SG_ERROR_KVM_OPENFILES,
56          SG_ERROR_MALLOC,
57 +        SG_ERROR_MEMSTATUS,
58          SG_ERROR_OPEN,
59          SG_ERROR_OPENDIR,
60          SG_ERROR_PARSE,
61 +        SG_ERROR_PDHADD,
62 +        SG_ERROR_PDHCOLLECT,
63 +        SG_ERROR_PDHOPEN,
64 +        SG_ERROR_PDHREAD,
65 +        SG_ERROR_PERMISSION,
66 +        SG_ERROR_PSTAT,
67          SG_ERROR_SETEGID,
68          SG_ERROR_SETEUID,
69          SG_ERROR_SETMNTENT,
# Line 66 | Line 79 | typedef enum {
79   } sg_error;
80  
81   void sg_set_error(sg_error code, const char *arg);
82 + void sg_set_error_with_errno(sg_error code, const char *arg);
83   sg_error sg_get_error();
84 + const char *sg_get_error_arg();
85 + int sg_get_error_errno();
86   const char *sg_str_error(sg_error code);
87  
88   typedef struct {
# Line 148 | Line 164 | typedef struct {
164          long long total_inodes;
165          long long used_inodes;
166          long long free_inodes;
167 +        long long avail_inodes;
168 +        long long io_size;
169 +        long long block_size;
170 +        long long total_blocks;
171 +        long long free_blocks;
172 +        long long used_blocks;
173 +        long long avail_blocks;
174   } sg_fs_stats;
175  
176   sg_fs_stats *sg_get_fs_stats(int *entries);
177  
178 + int sg_fs_compare_device_name(const void *va, const void *vb);
179 + int sg_fs_compare_mnt_point(const void *va, const void *vb);
180 +
181   typedef struct {
182          char *disk_name;
183          long long read_bytes;
# Line 162 | Line 188 | typedef struct {
188   sg_disk_io_stats *sg_get_disk_io_stats(int *entries);
189   sg_disk_io_stats *sg_get_disk_io_stats_diff(int *entries);
190  
191 + int sg_disk_io_compare_name(const void *va, const void *vb);
192 +
193   typedef struct {
194          char *interface_name;
195          long long tx;
# Line 177 | Line 205 | typedef struct {
205   sg_network_io_stats *sg_get_network_io_stats(int *entries);
206   sg_network_io_stats *sg_get_network_io_stats_diff(int *entries);
207  
208 + int sg_network_io_compare_name(const void *va, const void *vb);
209 +
210   typedef enum {
211          SG_IFACE_DUPLEX_FULL,
212          SG_IFACE_DUPLEX_HALF,
# Line 186 | Line 216 | typedef enum {
216   typedef struct {
217          char *interface_name;
218          int speed;      /* In megabits/sec */
219 +        sg_iface_duplex duplex;
220 + #ifdef SG_ENABLE_DEPRECATED
221          sg_iface_duplex dup;
222 + #endif
223          int up;
224   } sg_network_iface_stats;
225  
226   sg_network_iface_stats *sg_get_network_iface_stats(int *entries);
227  
228 + int sg_network_iface_compare_name(const void *va, const void *vb);
229 +
230   typedef struct {
231          long long pages_pagein;
232          long long pages_pageout;
# Line 217 | Line 252 | typedef struct {
252          pid_t parent; /* Parent pid */
253          pid_t pgid;   /* process id of process group leader */
254  
255 + /* Windows does not have uid_t or gid_t types */
256 + #ifndef WIN32
257          uid_t uid;
258          uid_t euid;
259          gid_t gid;
260          gid_t egid;
261 + #else
262 +        int uid;
263 +        int euid;
264 +        int gid;
265 +        int egid;
266 + #endif
267  
268          unsigned long long proc_size; /* in bytes */
269          unsigned long long proc_resident; /* in bytes */
# Line 232 | Line 275 | typedef struct {
275  
276   sg_process_stats *sg_get_process_stats(int *entries);
277  
278 + int sg_process_compare_name(const void *va, const void *vb);
279 + int sg_process_compare_pid(const void *va, const void *vb);
280 + int sg_process_compare_uid(const void *va, const void *vb);
281 + int sg_process_compare_gid(const void *va, const void *vb);
282 + int sg_process_compare_size(const void *va, const void *vb);
283 + int sg_process_compare_res(const void *va, const void *vb);
284 + int sg_process_compare_cpu(const void *va, const void *vb);
285 + int sg_process_compare_time(const void *va, const void *vb);
286 +
287   typedef struct {
288          int total;
289          int running;
# Line 246 | Line 298 | sg_process_count *sg_get_process_count();
298   #include <statgrab_deprecated.h>
299   #endif
300  
301 + #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines