ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/win32.h
Revision: 1.1
Committed: Sat Sep 24 13:29:23 2005 UTC (18 years, 7 months ago) by tdb
Content type: text/plain
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_17, LIBSTATGRAB_0_16, LIBSTATGRAB_0_15, LIBSTATGRAB_0_14, LIBSTATGRAB_0_13, HEAD
Log Message:
Add WIN32 support via MINGW. We'll need to add stuff to the README file
about what this requires to build.

All the hard work done by: skel

File Contents

# User Rev Content
1 tdb 1.1 #ifdef WIN32
2     #include <pdh.h>
3    
4     typedef enum {
5     SG_WIN32_PROC_USER,
6     SG_WIN32_PROC_PRIV,
7     SG_WIN32_PROC_IDLE,
8     SG_WIN32_PROC_INT,
9     SG_WIN32_MEM_CACHE,
10     SG_WIN32_UPTIME,
11     SG_WIN32_PAGEIN,
12     SG_WIN32_PAGEOUT,
13     SG_WIN32_SIZE /* Leave this as last entry */
14     } pdh_enum;
15    
16     #define PDH_USER "\\Processor(_Total)\\% User Time"
17     #define PDH_PRIV "\\Processor(_Total)\\% Privileged Time"
18     #define PDH_IDLE "\\Processor(_Total)\\% Processor Time"
19     #define PDH_INTER "\\Processor(_Total)\\% Interrupt Time"
20     #define PDH_DISKIOREAD "\\PhysicalDisk(%s)\\Disk Read Bytes/sec"
21     #define PDH_DISKIOWRITE "\\PhysicalDisk(%s)\\Disk Write Bytes/sec"
22     #define PDH_MEM_CACHE "\\Memory\\Cache Bytes"
23     #define PDH_UPTIME "\\System\\System Up Time"
24     #define PDH_PAGEIN "\\Memory\\Pages Input/sec"
25     #define PDH_PAGEOUT "\\Memory\\Pages Output/sec"
26    
27     int add_counter(const char *fullCounterPath, HCOUNTER *phCounter);
28     int read_counter_double(pdh_enum counter, double *result);
29     int read_counter_large(pdh_enum counter, long long *result);
30     char *get_diskio(const int no, long long *read, long long *write);
31     int get_netio(const int no, char **name, long long *read, long long *write);
32    
33     int sg_win32_snapshot();
34     int sg_win32_start_capture();
35     void sg_win32_end_capture();
36    
37     #endif