home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: SysTools / SysTools.zip / pmp43.zip / PMPAPI.H < prev    next >
C/C++ Source or Header  |  1996-07-06  |  17KB  |  293 lines

  1. /***************************************************************************
  2. PM Patrol API C/C++ header
  3.  
  4. API: DCFGetStats (Data Collection Facility - retrieve stats)
  5. -----------------------------------------------------------------------------
  6.      Prototype:  APIRC APIENTRY DCFGetStats (PDCFSTATS pDCFStats)
  7.      Parms:      PPDCFSTATS         ... Address to DCFSTATS structure
  8.      Returns:    DCF_NO_ERROR       ... Succesfull with no errors
  9.                  DCF_PARM_ERROR     ... Invalid parm specified
  10.                  DCF_INACTIVE_ERROR ... DCF not active
  11.  
  12.      Notes:      Statistics are updated at frequencies defined in the PM Patrol
  13.                  "Refresh Settings" dialog under "Settings" options.
  14.                  Refer to PM Patrol on-line help for details and examples.
  15.  
  16. API: DCFVerify   (Data Collection Facility - verify DCF active state)
  17. -----------------------------------------------------------------------------
  18.      Prototype:  BOOL APIENTRY DCFVerify (void)
  19.      Parms:      None
  20.      Returns:    TRUE               ... DCF active
  21.                  FALSE              ... DCF not active
  22.  
  23. API: DCFUserDefined (Data Collection Facility - User defined monitor)
  24. -----------------------------------------------------------------------------
  25.      Prototype:  APIRC APIENTRY DCFUserDefined (PCHAR buffer)
  26.      Parms:      None
  27.      Returns:    DCF_NO_ERROR       ... Succesfull with no errors
  28.                  DCF_PARM_ERROR     ... Invalid parm specified
  29.                  DCF_INACTIVE_ERROR ... DCF not active
  30.  
  31. API: PMPShutDown (Shutdown PM Patrol and DCF)
  32. -----------------------------------------------------------------------------
  33.      Prototype:  BOOL APIENTRY PMPShutDown (void)
  34.      Parms:      None
  35.      Returns:    TRUE               ... Succesfull with no errors
  36.                  FALSE              ... PM Patrol not active
  37. ****************************************************************************/
  38.  
  39. /* double inclusion */
  40. #ifndef INCL_PMPAPI
  41. #define INCL_PMPAPI
  42.  
  43. /* define additional types */
  44. #if !defined(OS2_INCLUDED) && !defined(INCL_NEWTYPES1)
  45. #define INCL_NEWTYPES1
  46. typedef short            SHORT;
  47. typedef SHORT *          PSHORT;
  48. typedef unsigned short   USHORT;
  49. typedef USHORT *         PUSHORT;
  50. typedef long             LONG;
  51. typedef LONG *           PLONG;
  52. typedef unsigned long    ULONG;
  53. typedef ULONG *          PULONG;
  54. typedef char             CHAR;
  55. typedef CHAR *           PCHAR;
  56. typedef unsigned char    UCHAR;
  57. typedef UCHAR *          PUCHAR;
  58. typedef UCHAR            BYTE;
  59. typedef BYTE *           PBYTE;
  60. typedef int              INT;
  61. typedef INT *            PINT;
  62. typedef void             VOID;
  63. typedef VOID *           PVOID;
  64. typedef ULONG            BOOL;
  65. typedef BOOL *           PBOOL;
  66. #endif
  67.  
  68. #ifndef INCL_NEWTYPES2
  69. #define INCL_NEWTYPES2
  70. typedef double           DOUBLE;
  71. typedef DOUBLE *         PDOUBLE;
  72. typedef INT              FD;
  73.  
  74. #ifdef UNIX
  75. typedef INT              APIRC;
  76. typedef APIRC *          PAPIRC;
  77. typedef pid_t            PID;
  78. typedef unsigned int     TID;
  79. #ifndef APIENTRY
  80. #define APIENTRY
  81. #endif
  82. #else
  83. typedef ULONG            APIRC;
  84. typedef APIRC *          PAPIRC;
  85. typedef USHORT           APIRC16;
  86. typedef APIRC16 *        PAPIRC16;
  87. typedef USHORT           HFILE16;
  88. typedef HFILE16 *        PHFILE16;
  89. #ifndef APIENTRY
  90. #define APIENTRY         _System
  91. #endif
  92. #endif
  93. #endif
  94.  
  95. /* define DCF specifics */
  96. #define DCF_NETWID_SIZE                     15
  97. #define DCF_NETUID_SIZE                     15
  98. #define DCF_NETDID_SIZE                     15
  99. #define DCF_NETSID_SIZE                     15
  100. #define DCF_DRVONL_SIZE                     26
  101. #define DCF_GRAPH_SIZE                      11
  102. #define DCF_EXENAME_SIZE                    8
  103. #define DCF_PSTATS_SIZE                     64
  104. #define DCF_USER_SIZE                       20
  105. #define DCF_VERSION_SIZE                    12
  106.  
  107. #define DCF_NO_ERROR                        0
  108. #define DCF_PARM_ERROR                      1
  109. #define DCF_INACTIVE_ERROR                  2
  110.  
  111. /* structure definitions */
  112. #pragma pack(1)
  113. typedef struct dcfpstats
  114. {
  115.   ULONG         pid;                             /* process id               */
  116.   ULONG         ppid;                            /* parent process id        */
  117.   ULONG         sid;                             /* session id               */
  118.   ULONG         type;                            /* process type PROG_*      */
  119.   ULONG         ramSizeTot;                      /* tot ram allocated (pages)*/
  120.   ULONG         ramSizeRes;                      /* tot ram resident (pages) */
  121.   BOOL          mmt32Bit;                        /* 16 or 32-bit indicator   */
  122.   USHORT        modHandle;                       /* module handle            */
  123.   USHORT        tidCount;                        /* thread count             */
  124.   USHORT        semCount;                        /* sem count                */
  125.   USHORT        modCount;                        /* mod count                */
  126.   USHORT        shrCount;                        /* sharemem count           */
  127.   USHORT        maxClass;                        /* max thread pri class     */
  128.   LONG          startTime;                       /* start time (time_t)      */
  129.   USHORT        cpuPct;                          /* cpu percent              */
  130.   USHORT        runCnt;                          /* internal to PMP          */
  131.   CHAR          exeName[DCF_EXENAME_SIZE+1];     /* executable name (8.3)    */
  132. } DCFPSTATS, *PDCFPSTATS;
  133.  
  134. typedef struct dcfstats
  135. {
  136.   CHAR          pmpVersion[DCF_VERSION_SIZE+1];  /* PMP version              */
  137.   LONG          pmpStartTime;                    /* PMP start time (time_t)  */
  138.   BOOL          hpfs32ActInd;                    /* hpfs 386 active indicator*/
  139.   BOOL          memActInd;                       /* os2memu active indicator */
  140.   BOOL          mmActInd;                        /* mmos2 active indicator   */
  141.   BOOL          netActInd;                       /* net active indicator     */
  142.   BOOL          netLogonInd;                     /* net logged-on indicator  */
  143.   BOOL          lpt1ActInd;                      /* LPT1 monitor indicator   */
  144.   BOOL          lpt2ActInd;                      /* LPT2 monitor indicator   */
  145.   BOOL          lpt3ActInd;                      /* LPT3 monitor indicator   */
  146.   BOOL          spoolActInd;                     /* Spooler active indicator */
  147.   LONG          upDateTime;                      /* DCF up-date time (time_t)*/
  148.  
  149.   ULONG         upTimeSecs;                      /* system up-time seconds   */
  150.   ULONG         inetTimeSecs;                    /* internet connect seconds */
  151.   CHAR          netWSId    [DCF_NETWID_SIZE+1];  /* net workstation id       */
  152.   CHAR          netUserId  [DCF_NETUID_SIZE+1];  /* net logon id             */
  153.   CHAR          netDomainId[DCF_NETDID_SIZE+1];  /* net logon domain         */
  154.   CHAR          netServerId[DCF_NETSID_SIZE+1];  /* net logon server         */
  155.   DOUBLE        netIn;                           /* net req in bytes         */
  156.   DOUBLE        netOut;                          /* net req out bytes        */
  157.   DOUBLE        lpt1TotIO;                       /* lpt1 I/O total bytes     */
  158.   DOUBLE        lpt1TotTime;                     /* lpt1 total ms            */
  159.   ULONG         lpt1TotJobs;                     /* lpt1 total jobs          */
  160.   DOUBLE        lpt2TotIO;                       /* lpt2 I/O total bytes     */
  161.   DOUBLE        lpt2TotTime;                     /* lpt2 total ms            */
  162.   ULONG         lpt2TotJobs;                     /* lpt2 total jobs          */
  163.   DOUBLE        lpt3TotIO;                       /* lpt3 I/O total bytes     */
  164.   DOUBLE        lpt3TotTime;                     /* lpt3 total ms            */
  165.   ULONG         lpt3TotJobs;                     /* lpt3 total jobs          */
  166.   CHAR          drivesOnLine[DCF_DRVONL_SIZE+1]; /* drive map array          */
  167.   CHAR          drive1;                          /* drive letter             */
  168.   BOOL          drive1OffLine;                   /* drive off line indicator */
  169.   DOUBLE        drive1Size;                      /* drive size bytes         */
  170.   DOUBLE        drive1Free;                      /* drive free bytes         */
  171.   CHAR          drive2;                          /* drive letter             */
  172.   BOOL          drive2OffLine;                   /* drive off line indicator */
  173.   DOUBLE        drive2Size;                      /* drive size bytes         */
  174.   DOUBLE        drive2Free;                      /* drive free bytes         */
  175.   CHAR          drive3;                          /* drive letter             */
  176.   BOOL          drive3OffLine;                   /* drive off line indicator */
  177.   DOUBLE        drive3Size;                      /* drive size bytes         */
  178.   DOUBLE        drive3Free;                      /* drive free bytes         */
  179.   CHAR          drive4;                          /* drive letter             */
  180.   BOOL          drive4OffLine;                   /* drive off line indicator */
  181.   DOUBLE        drive4Size;                      /* drive size bytes         */
  182.   DOUBLE        drive4Free;                      /* drive free bytes         */
  183.   CHAR          drive5;                          /* drive letter             */
  184.   BOOL          drive5OffLine;                   /* drive off line indicator */
  185.   DOUBLE        drive5Size;                      /* drive size bytes         */
  186.   DOUBLE        drive5Free;                      /* drive free bytes         */
  187.   CHAR          drive6;                          /* drive letter             */
  188.   BOOL          drive6OffLine;                   /* drive off line indicator */
  189.   DOUBLE        drive6Size;                      /* drive size bytes         */
  190.   DOUBLE        drive6Free;                      /* drive free bytes         */
  191.   SHORT         batFreePct;                      /* battery life percent     */
  192.   ULONG         swpAllocReserved;                /* swap file bytes reserved */
  193.   ULONG         swpAllocInit;                    /* swap file bytes at boot  */
  194.   ULONG         swpAlloc;                        /* swap file bytes current  */
  195.   ULONG         swpFree;                         /* swap free bytes          */
  196.   USHORT        swpFreePct;                      /* swap free percent        */
  197.   CHAR          swpFreeGph[DCF_GRAPH_SIZE+1];    /* swap free graph          */
  198.   ULONG         swpUsed;                         /* swap used bytes          */
  199.   USHORT        swpUsedPct;                      /* swap used percent        */
  200.   CHAR          swpUsedGph[DCF_GRAPH_SIZE+1];    /* swap used graph          */
  201.   ULONG         ramPhys;                         /* physical memory bytes    */
  202.   DOUBLE        totVirt;                         /* virtual total bytes      */
  203.   ULONG         vramFree;                        /* virtual avail bytes      */
  204.   USHORT        vramFreePct;                     /* virtual avail percent    */
  205.   CHAR          vramFreeGph[DCF_GRAPH_SIZE+1];   /* virtual avail graph      */
  206.   ULONG         vramUsed;                        /* virtual used  bytes      */
  207.   USHORT        vramUsedPct;                     /* virtual used  percent    */
  208.   CHAR          vramUsedGph[DCF_GRAPH_SIZE+1];   /* virtual used  graph      */
  209.   ULONG         ramRes;                          /* resident memory bytes    */
  210.   USHORT        ramResPct;                       /* resident memory percent  */
  211.   CHAR          ramResGph[DCF_GRAPH_SIZE+1];     /* resident memory graph    */
  212.   ULONG         ramSwap;                         /* swappable memory bytes   */
  213.   USHORT        ramSwapPct;                      /* swappable memory percent */
  214.   CHAR          ramSwapGph[DCF_GRAPH_SIZE+1];    /* swappable memory graph   */
  215.   ULONG         ramFree;                         /* free memory bytes        */
  216.   USHORT        ramFreePct;                      /* free memory percent      */
  217.   CHAR          ramFreeGph[DCF_GRAPH_SIZE+1];    /* free memory graph        */
  218.   ULONG         ramUsed;                         /* used memory bytes        */
  219.   USHORT        ramUsedPct;                      /* used memory percent      */
  220.   CHAR          ramUsedGph[DCF_GRAPH_SIZE+1];    /* used memory graph        */
  221.   USHORT        hpfsRCachePct;                   /* hpfs386 cache read pct   */
  222.   CHAR          hpfsRCacheGph[DCF_GRAPH_SIZE+1]; /* hpfs386 cache read graph */
  223.   USHORT        hpfsWCachePct;                   /* hpfs386 cache write pct  */
  224.   CHAR          hpfsWCacheGph[DCF_GRAPH_SIZE+1]; /* hpfs386 cache write graph*/
  225.   USHORT        cpuMagPct;                       /* CPU magnified percent    */
  226.   USHORT        cpuAvgPct;                       /* CPU average percent      */
  227.   USHORT        cpuIdlePct;                      /* CPU idle percent         */
  228.   USHORT        cpuCurrPct;                      /* CPU current percent      */
  229.   CHAR          cpuCurrGph[DCF_GRAPH_SIZE+1];    /* CPU current graph        */
  230.   ULONG         winCount;                        /* total open windows       */
  231.   ULONG         fileCount;                       /* total open files         */
  232.   USHORT        tidCount;                        /* total threads            */
  233.   DOUBLE        osVer;                           /* OS/2 version             */
  234.   USHORT        cpuCnt;                          /* processors in machine    */
  235.   CHAR          userDefined[DCF_USER_SIZE+1];    /* user defined monitor     */
  236.  
  237.   USHORT        eventSwpGrowCnt;                 /* swap event count         */
  238.   ULONG         eventSwpGrowLAmt;                /* swap event last bytes    */
  239.   LONG          eventSwpGrowLTime;               /* swap event last time     */
  240.   USHORT        eventCpuAvgCnt;                  /* avg cpu event count      */
  241.   USHORT        eventCpuAvgLAmt;                 /* avg cpu event last pct   */
  242.   LONG          eventCpuAvgLTime;                /* avg cpu event last time  */
  243.   USHORT        eventVRamFreeCnt;                /* vram event count         */
  244.   ULONG         eventVRamFreeLAmt;               /* vram event last bytes    */
  245.   LONG          eventVRamFreeLTime;              /* vram event last time     */
  246.   USHORT        eventDrive1Cnt;                  /* drive1 event count       */
  247.   DOUBLE        eventDrive1LAmt;                 /* drive1 event last bytes  */
  248.   LONG          eventDrive1LTime;                /* drive1 event last time   */
  249.   USHORT        eventDrive2Cnt;                  /* drive2 event count       */
  250.   DOUBLE        eventDrive2LAmt;                 /* drive2 event last bytes  */
  251.   LONG          eventDrive2LTime;                /* drive2 event last time   */
  252.   USHORT        eventDrive3Cnt;                  /* drive3 event count       */
  253.   DOUBLE        eventDrive3LAmt;                 /* drive3 event last bytes  */
  254.   LONG          eventDrive3LTime;                /* drive3 event last time   */
  255.   USHORT        eventDrive4Cnt;                  /* drive4 event count       */
  256.   DOUBLE        eventDrive4LAmt;                 /* drive4 event last bytes  */
  257.   LONG          eventDrive4LTime;                /* drive4 event last time   */
  258.   USHORT        eventDrive5Cnt;                  /* drive5 event count       */
  259.   DOUBLE        eventDrive5LAmt;                 /* drive5 event last bytes  */
  260.   LONG          eventDrive5LTime;                /* drive5 event last time   */
  261.   USHORT        eventDrive6Cnt;                  /* drive6 event count       */
  262.   DOUBLE        eventDrive6LAmt;                 /* drive6 event last bytes  */
  263.   LONG          eventDrive6LTime;                /* drive6 event last time   */
  264.   USHORT        eventBatFreeCnt;                 /* battery event last pct   */
  265.   ULONG         eventBatFreeLAmt;                /* battery event count      */
  266.   LONG          eventBatFreeLTime;               /* battery event last time  */
  267.   USHORT        eventSwpFreeCnt;                 /* swap free event count    */
  268.   ULONG         eventSwpFreeLAmt;                /* swap free event last byte*/
  269.   LONG          eventSwpFreeLTime;               /* swap free event last time*/
  270.   USHORT        eventRamFreeCnt;                 /* ram free event count     */
  271.   ULONG         eventRamFreeLAmt;                /* ram free event last bytes*/
  272.   LONG          eventRamFreeLTime;               /* ram free event last time */
  273.  
  274.   USHORT        pidCount;                        /* total PIDs in DCFPSTATS  */
  275.   DCFPSTATS     pstatTbl[DCF_PSTATS_SIZE];       /* process status table     */
  276. } DCFSTATS, *PDCFSTATS;
  277. #pragma pack()
  278.  
  279. /* prototypes */
  280. #ifdef __cplusplus
  281. extern "C" {
  282. #endif
  283.  
  284. APIRC APIENTRY DCFGetStats    (PDCFSTATS pDCFStatsOut);
  285. BOOL  APIENTRY DCFVerify      (void);
  286. APIRC APIENTRY DCFUserDefined (PCHAR buffer);
  287. BOOL  APIENTRY PMPShutDown    (void);
  288.  
  289. #ifdef __cplusplus
  290. }
  291. #endif
  292. #endif
  293.