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.52 by tdb, Fri Jul 16 15:28:02 2004 UTC vs.
Revision 1.59 by tdb, Sun Oct 3 18:35:58 2010 UTC

# Line 24 | Line 24
24   #ifndef STATGRAB_H
25   #define STATGRAB_H
26  
27 + #ifdef __cplusplus
28 + extern "C" {
29 + #endif
30 +
31   #include <sys/types.h>
32  
33   /* FIXME typedefs for 32/64-bit types */
# Line 31 | Line 35
35   /* FIXME comments for less obvious fields */
36  
37   int sg_init(void);
38 + int sg_snapshot();
39 + int sg_shutdown();
40   int sg_drop_privileges(void);
41  
42   typedef enum {
43          SG_ERROR_NONE = 0,
44          SG_ERROR_ASPRINTF,
45 +        SG_ERROR_DEVICES,
46          SG_ERROR_DEVSTAT_GETDEVS,
47          SG_ERROR_DEVSTAT_SELECTDEVS,
48 +        SG_ERROR_DISKINFO,
49          SG_ERROR_ENOENT,
50          SG_ERROR_GETIFADDRS,
51          SG_ERROR_GETMNTINFO,
52          SG_ERROR_GETPAGESIZE,
53 +        SG_ERROR_HOST,
54          SG_ERROR_KSTAT_DATA_LOOKUP,
55          SG_ERROR_KSTAT_LOOKUP,
56          SG_ERROR_KSTAT_OPEN,
# Line 49 | Line 58 | typedef enum {
58          SG_ERROR_KVM_GETSWAPINFO,
59          SG_ERROR_KVM_OPENFILES,
60          SG_ERROR_MALLOC,
61 +        SG_ERROR_MEMSTATUS,
62          SG_ERROR_OPEN,
63          SG_ERROR_OPENDIR,
64          SG_ERROR_PARSE,
65 +        SG_ERROR_PDHADD,
66 +        SG_ERROR_PDHCOLLECT,
67 +        SG_ERROR_PDHOPEN,
68 +        SG_ERROR_PDHREAD,
69 +        SG_ERROR_PERMISSION,
70 +        SG_ERROR_PSTAT,
71          SG_ERROR_SETEGID,
72          SG_ERROR_SETEUID,
73          SG_ERROR_SETMNTENT,
# Line 63 | Line 79 | typedef enum {
79          SG_ERROR_SYSCTLNAMETOMIB,
80          SG_ERROR_UNAME,
81          SG_ERROR_UNSUPPORTED,
82 <        SG_ERROR_XSW_VER_MISMATCH
82 >        SG_ERROR_XSW_VER_MISMATCH,
83 >        SG_ERROR_GETMSG,
84 >        SG_ERROR_PUTMSG
85   } sg_error;
86  
87   void sg_set_error(sg_error code, const char *arg);
88   void sg_set_error_with_errno(sg_error code, const char *arg);
89   sg_error sg_get_error();
90   const char *sg_get_error_arg();
91 < const int sg_get_error_errno();
91 > int sg_get_error_errno();
92   const char *sg_str_error(sg_error code);
93  
94   typedef struct {
# Line 152 | Line 170 | typedef struct {
170          long long total_inodes;
171          long long used_inodes;
172          long long free_inodes;
173 +        long long avail_inodes;
174 +        long long io_size;
175 +        long long block_size;
176 +        long long total_blocks;
177 +        long long free_blocks;
178 +        long long used_blocks;
179 +        long long avail_blocks;
180   } sg_fs_stats;
181  
182   sg_fs_stats *sg_get_fs_stats(int *entries);
# Line 197 | Line 222 | typedef enum {
222   typedef struct {
223          char *interface_name;
224          int speed;      /* In megabits/sec */
225 +        sg_iface_duplex duplex;
226 + #ifdef SG_ENABLE_DEPRECATED
227          sg_iface_duplex dup;
228 + #endif
229          int up;
230   } sg_network_iface_stats;
231  
# Line 214 | Line 242 | typedef struct {
242   sg_page_stats *sg_get_page_stats();
243   sg_page_stats *sg_get_page_stats_diff();
244  
245 + /* Recommend to add SG_PROCESS_STATE_IDLE */
246   typedef enum {
247          SG_PROCESS_STATE_RUNNING,
248          SG_PROCESS_STATE_SLEEPING,
# Line 230 | Line 259 | typedef struct {
259          pid_t parent; /* Parent pid */
260          pid_t pgid;   /* process id of process group leader */
261  
262 + /* Windows does not have uid_t or gid_t types */
263 + #ifndef WIN32
264          uid_t uid;
265          uid_t euid;
266          gid_t gid;
267          gid_t egid;
268 + #else
269 +        int uid;
270 +        int euid;
271 +        int gid;
272 +        int egid;
273 + #endif
274  
275          unsigned long long proc_size; /* in bytes */
276          unsigned long long proc_resident; /* in bytes */
# Line 266 | Line 303 | sg_process_count *sg_get_process_count();
303  
304   #ifdef SG_ENABLE_DEPRECATED
305   #include <statgrab_deprecated.h>
306 + #endif
307 +
308 + #ifdef __cplusplus
309 + }
310   #endif
311  
312   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines