home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: InfoMgt / InfoMgt.zip / MAILMIND.ZOO / OS2.H < prev    next >
Text File  |  1992-03-11  |  4KB  |  121 lines

  1. #ifndef OS2_H
  2. #define OS2_H
  3.  
  4. /* os2.h - special OS/2 header for NETWKSQD & NETMMIND
  5.  * Thomas A. Marciniak, M.D. = ytm@nihccpc1.bitnet
  6.  * Division of Cancer Prevention & Control, NCI
  7.  */
  8.  
  9. /* Revision history:
  10.  * 1.02  ytm  03/11/92  add DosAllocSeg
  11.  * 1.01  ytm  02/24/92  update for NETMMIND
  12.  * 1.00  ytm  02/13/92  first release
  13.  */
  14.  
  15. /* general defines */
  16. #define PASCAL  pascal
  17. #define FAR     far
  18. #define NEAR    near
  19. #define VOID    void
  20. #define API     pascal far
  21.  
  22. /* DosPrintDestControl opcodes */
  23. #define JOB_KILL 0
  24.  
  25. /* DosPrintDestStatus status codes */
  26. #define PRINT_UNSOLICITED 0
  27. #define PRINT_DONE        4
  28.  
  29. /* DosSetSigHandler signal numbers */
  30. #define SIG_CTRLC           1       /* Control C            */
  31. #define SIG_BROKENPIPE      2       /* Broken Pipe          */
  32. #define SIG_KILLPROCESS     3       /* Program Termination  */
  33. #define SIG_CTRLBREAK       4       /* Control Break        */
  34. #define SIG_PFLG_A          5       /* Process Flag A       */
  35. #define SIG_PFLG_B          6       /* Process Flag B       */
  36. #define SIG_PFLG_C          7       /* Process Flag C       */
  37. #define SIG_CSIGNALS        8       /* number of signals plus one */
  38.  
  39. /* DosFlagProcess flag numbers */
  40. #define PFLG_A            0        /* Process Flag A */
  41. #define PFLG_B            1        /* Process Flag B */
  42. #define PFLG_C            2        /* Process Flag C */
  43.  
  44. /* Signal actions */
  45. #define SIGA_KILL           0
  46. #define SIGA_IGNORE         1
  47. #define SIGA_ACCEPT         2
  48. #define SIGA_ERROR          3
  49. #define SIGA_ACKNOWLEDGE    4
  50.  
  51. /* typedefs */
  52. typedef char CHAR;
  53. typedef unsigned char UCHAR;
  54. typedef unsigned long ULONG;
  55. typedef unsigned short USHORT;
  56. typedef USHORT FAR *PUSHORT;
  57. typedef VOID (API *PFNSIGHANDLER)(USHORT, USHORT);
  58. typedef unsigned short SEL;
  59. typedef SEL FAR *PSEL;
  60.  
  61. /* Create untyped far pointer from selector and offset */
  62. #define MAKEULONG(l, h)  ((ULONG)(((USHORT)(l)) | ((ULONG)((USHORT)(h))) << 16))
  63. #define MAKEP(sel, off)  ((VOID FAR *)MAKEULONG(off, sel))
  64.  
  65. /* structures */
  66. typedef struct _FTIME {         /* ftime */
  67.     unsigned twosecs : 5;
  68.     unsigned minutes : 6;
  69.     unsigned hours   : 5;
  70. } FTIME;
  71. typedef FTIME FAR *PFTIME;
  72.  
  73. typedef struct _FDATE {         /* fdate */
  74.     unsigned day     : 5;
  75.     unsigned month   : 4;
  76.     unsigned year    : 7;
  77. } FDATE;
  78. typedef FDATE FAR *PFDATE;
  79.  
  80. typedef struct _FILEFINDBUF {   /* findbuf */
  81.     FDATE  fdateCreation;
  82.     FTIME  ftimeCreation;
  83.     FDATE  fdateLastAccess;
  84.     FTIME  ftimeLastAccess;
  85.     FDATE  fdateLastWrite;
  86.     FTIME  ftimeLastWrite;
  87.     ULONG  cbFile;
  88.     ULONG  cbFileAlloc;
  89.     USHORT attrFile;
  90.     UCHAR  cchName;
  91.     CHAR   achName[13];
  92. } FILEFINDBUF;
  93. typedef FILEFINDBUF FAR *PFILEFINDBUF;
  94.  
  95. typedef struct _PIDINFO {         /* pidi */
  96.     USHORT pid;
  97.     USHORT tid;
  98.     USHORT pidParent;
  99. } PIDINFO;
  100. typedef PIDINFO FAR *PPIDINFO;
  101.  
  102. /* function prototypes */
  103. USHORT API DosAllocSeg(USHORT uiBytes, PSEL selPtr, USHORT uiFlag);
  104. USHORT API DosPrintDestControl(char far *cfpServer, 
  105.   char far *cfpDest, USHORT uiOpcode);
  106. USHORT API DosPrintDestStatus(char far *cfpName,
  107.   USHORT uiPid, USHORT uiStatus, char far *cfpStatus);
  108. USHORT API DosSetSigHandler(PFNSIGHANDLER pfnSigHandler,
  109.                         PFNSIGHANDLER FAR * pfnPrev,
  110.                         PUSHORT pfAction,
  111.                         USHORT  fAction,
  112.                         USHORT  usSigNumber);
  113. USHORT API DosPrintJobDel(char far *sfServer, USHORT uiJobID);
  114. USHORT API DosSleep(ULONG);
  115.  
  116. USHORT API DosFindFirst(CHAR FAR *, USHORT FAR *, USHORT, PFILEFINDBUF, USHORT, PUSHORT, ULONG);
  117. USHORT API DosFindNext(USHORT, PFILEFINDBUF, USHORT, PUSHORT);
  118. USHORT API DosGetPID(PPIDINFO);
  119.  
  120. #endif OS2_H
  121.