home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / MISC / LSW270SR.ZIP / h / api16.h next >
Text File  |  2001-11-18  |  5KB  |  150 lines

  1. /*
  2.  *      Copyright (C) 1997-2001 Andrei Los.
  3.  *      This file is part of the lSwitcher source package.
  4.  *      lSwitcher is free software; you can redistribute it and/or modify
  5.  *      it under the terms of the GNU General Public License as published
  6.  *      by the Free Software Foundation, in version 2 as it comes in the
  7.  *      "COPYING" file of the lSwitcher main distribution.
  8.  *      This program is distributed in the hope that it will be useful,
  9.  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.  *      GNU General Public License for more details.
  12.  */
  13.  
  14.  
  15. #ifndef API16_H_INCLUDED
  16. #define API16_H_INCLUDED
  17.  
  18. #include <os2.h>
  19.  
  20. #define DCWW_WAIT   0
  21. #define DCWW_NOWAIT 1
  22.  
  23.  
  24. typedef struct _GINFOSEG {
  25.    ULONG   time;               /* time in seconds */
  26.    ULONG   msecs;              /* milliseconds    */
  27.    UCHAR   hour;               /* hours */
  28.    UCHAR   minutes;            /* minutes */
  29.    UCHAR   seconds;            /* seconds */
  30.    UCHAR   hundredths;         /* hundredths */
  31.    USHORT  timezone;           /* minutes from UTC */
  32.    USHORT  cusecTimerInterval; /* timer interval (units = 0.0001 seconds) */
  33.    UCHAR   day;                /* day */
  34.    UCHAR   month;              /* month */
  35.    USHORT  year;               /* year */
  36.    UCHAR   weekday;            /* day of week */
  37.    UCHAR   uchMajorVersion;    /* major version number */
  38.    UCHAR   uchMinorVersion;    /* minor version number */
  39.    UCHAR   chRevisionLetter;   /* revision letter */
  40.    UCHAR   sgCurrent;          /* current foreground session */
  41.    UCHAR   sgMax;              /* maximum number of sessions */
  42.    UCHAR   cHugeShift;         /* shift count for huge elements */
  43.    UCHAR   fProtectModeOnly;   /* protect mode only indicator */
  44.    USHORT  pidForeground;      /* pid of last process in foreground session */
  45.    UCHAR   fDynamicSched;      /* dynamic variation flag */
  46.    UCHAR   csecMaxWait;        /* max wait in seconds */
  47.    USHORT  cmsecMinSlice;      /* minimum timeslice (milliseconds) */
  48.    USHORT  cmsecMaxSlice;      /* maximum timeslice (milliseconds) */
  49.    USHORT  bootdrive;          /* drive from which the system was booted */
  50.    UCHAR   amecRAS[32];        /* system trace major code flag bits */
  51.    UCHAR   csgWindowableVioMax;/* maximum number of VIO windowable sessions */
  52.    UCHAR   csgPMMax;           /* maximum number of pres. services sessions */
  53. } GINFOSEG;
  54.  
  55. typedef GINFOSEG *PGINFOSEG;
  56.  
  57.  
  58. typedef struct _LINFOSEG {
  59.    PID     pidCurrent;        /* current process id */
  60.    PID     pidParent;         /* process id of parent */
  61.    USHORT  prtyCurrent;       /* priority of current thread */
  62.    TID     tidCurrent;        /* thread ID of current thread */
  63.    USHORT  sgCurrent;         /* session */
  64.    UCHAR   rfProcStatus;      /* process status */
  65.    UCHAR   dummy1;
  66.    BOOL    fForeground;       /* current process has keyboard focus */
  67.    UCHAR   typeProcess;       /* process type */
  68.    UCHAR   dummy2;
  69.    SEL     selEnvironment;    /* environment selector */
  70.    USHORT  offCmdLine;        /* command line offset */
  71.    USHORT  cbDataSegment;     /* length of data segment */
  72.    USHORT  cbStack;           /* stack size */
  73.    USHORT  cbHeap;            /* heap size */
  74.    HMODULE hmod;              /* module handle of the application */
  75.    SEL     selDS;             /* data segment handle of the application */
  76. } LINFOSEG;
  77.  
  78. typedef LINFOSEG *PLINFOSEG;
  79.  
  80.  
  81. #define DosGetInfoSeg DOS16GETINFOSEG
  82.  
  83. APIRET16 APIENTRY16 DosGetInfoSeg(PSEL GlobalSeg,PSEL LocalSeg);
  84.  
  85.  
  86. typedef SHANDLE HMONITOR;
  87. typedef HMONITOR *PHMONITOR;
  88.  
  89. #pragma pack(2)
  90. typedef struct _MONIN {
  91.         USHORT cb;
  92.         BYTE abReserved[18];
  93.         BYTE abBuffer[108];
  94. } MONIN;
  95. typedef MONIN *PMONIN;
  96.  
  97. #pragma pack(2)
  98. typedef struct _MONOUT {
  99.         USHORT cb;
  100.         UCHAR buffer[18];
  101.         BYTE abBuf[108];
  102. } MONOUT;
  103. typedef MONOUT *PMONOUT;
  104.  
  105.  
  106. //#pragma pack(2)
  107. //typedef struct _KBDKEYINFO {   /* kbci */
  108. //   UCHAR    chChar;             /* ASCII character code */
  109. //   UCHAR    chScan;             /* Scan Code */
  110. //   UCHAR    fbStatus;           /* State of the character */
  111. //   UCHAR    bNlsShift;          /* Reserved (set to zero) */
  112. //   USHORT   fsState;            /* State of the shift keys */
  113. //   ULONG    time;               /* Time stamp of keystroke (ms since ipl) */
  114. //} KBDKEYINFO;
  115.  
  116.  
  117. #pragma pack(2)
  118. typedef struct _keypacket {
  119.         USHORT     mnflags;
  120.         KBDKEYINFO cp;
  121.         USHORT     ddflags;
  122. } KEYPACKET;
  123.  
  124.  
  125. #pragma seg16(HKBD)
  126. #pragma seg16(MONIN)
  127. #pragma seg16(MONOUT)
  128. #pragma seg16(KEYPACKET)
  129.  
  130.  
  131. #define DosMonOpen    DOS16MONOPEN
  132. #define DosMonReg     DOS16MONREG
  133. #define DosMonClose   DOS16MONCLOSE
  134. #define DosMonRead    DOS16MONREAD
  135. #define DosMonWrite   DOS16MONWRITE
  136.  
  137.  
  138. APIRET16 APIENTRY16 DosMonOpen(PSZ DevName,PHMONITOR Handle);
  139. APIRET16 APIENTRY16 DosMonReg(HMONITOR Handle,PBYTE BufferI,PBYTE BufferO,USHORT Posflag,USHORT Index);
  140. APIRET16 APIENTRY16 DosMonClose(HMONITOR Handle);
  141. APIRET16 APIENTRY16 DosMonRead(PBYTE BufferI,USHORT WaitFlag,PBYTE DataBuffer,PUSHORT Bytecnt);
  142. APIRET16 APIENTRY16 DosMonWrite(PBYTE BufferO,PBYTE DataBuffer,USHORT Bytecnt);
  143. /* DosGetPrty = DOSCALLS.9 */
  144. APIRET16 APIENTRY16 DosGetPrty(USHORT usScope, PUSHORT pusPriority, USHORT pid);
  145.  
  146.  
  147. #pragma pack()
  148.  
  149. #endif
  150.