home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. CD ROM (Annual Premium Edition)
/
premium.zip
/
premium
/
IBMOS2_2
/
MAILMIND.ZIP
/
OS2.H
< prev
next >
Wrap
Text File
|
1992-03-11
|
4KB
|
121 lines
#ifndef OS2_H
#define OS2_H
/* os2.h - special OS/2 header for NETWKSQD & NETMMIND
* Thomas A. Marciniak, M.D. = ytm@nihccpc1.bitnet
* Division of Cancer Prevention & Control, NCI
*/
/* Revision history:
* 1.02 ytm 03/11/92 add DosAllocSeg
* 1.01 ytm 02/24/92 update for NETMMIND
* 1.00 ytm 02/13/92 first release
*/
/* general defines */
#define PASCAL pascal
#define FAR far
#define NEAR near
#define VOID void
#define API pascal far
/* DosPrintDestControl opcodes */
#define JOB_KILL 0
/* DosPrintDestStatus status codes */
#define PRINT_UNSOLICITED 0
#define PRINT_DONE 4
/* DosSetSigHandler signal numbers */
#define SIG_CTRLC 1 /* Control C */
#define SIG_BROKENPIPE 2 /* Broken Pipe */
#define SIG_KILLPROCESS 3 /* Program Termination */
#define SIG_CTRLBREAK 4 /* Control Break */
#define SIG_PFLG_A 5 /* Process Flag A */
#define SIG_PFLG_B 6 /* Process Flag B */
#define SIG_PFLG_C 7 /* Process Flag C */
#define SIG_CSIGNALS 8 /* number of signals plus one */
/* DosFlagProcess flag numbers */
#define PFLG_A 0 /* Process Flag A */
#define PFLG_B 1 /* Process Flag B */
#define PFLG_C 2 /* Process Flag C */
/* Signal actions */
#define SIGA_KILL 0
#define SIGA_IGNORE 1
#define SIGA_ACCEPT 2
#define SIGA_ERROR 3
#define SIGA_ACKNOWLEDGE 4
/* typedefs */
typedef char CHAR;
typedef unsigned char UCHAR;
typedef unsigned long ULONG;
typedef unsigned short USHORT;
typedef USHORT FAR *PUSHORT;
typedef VOID (API *PFNSIGHANDLER)(USHORT, USHORT);
typedef unsigned short SEL;
typedef SEL FAR *PSEL;
/* Create untyped far pointer from selector and offset */
#define MAKEULONG(l, h) ((ULONG)(((USHORT)(l)) | ((ULONG)((USHORT)(h))) << 16))
#define MAKEP(sel, off) ((VOID FAR *)MAKEULONG(off, sel))
/* structures */
typedef struct _FTIME { /* ftime */
unsigned twosecs : 5;
unsigned minutes : 6;
unsigned hours : 5;
} FTIME;
typedef FTIME FAR *PFTIME;
typedef struct _FDATE { /* fdate */
unsigned day : 5;
unsigned month : 4;
unsigned year : 7;
} FDATE;
typedef FDATE FAR *PFDATE;
typedef struct _FILEFINDBUF { /* findbuf */
FDATE fdateCreation;
FTIME ftimeCreation;
FDATE fdateLastAccess;
FTIME ftimeLastAccess;
FDATE fdateLastWrite;
FTIME ftimeLastWrite;
ULONG cbFile;
ULONG cbFileAlloc;
USHORT attrFile;
UCHAR cchName;
CHAR achName[13];
} FILEFINDBUF;
typedef FILEFINDBUF FAR *PFILEFINDBUF;
typedef struct _PIDINFO { /* pidi */
USHORT pid;
USHORT tid;
USHORT pidParent;
} PIDINFO;
typedef PIDINFO FAR *PPIDINFO;
/* function prototypes */
USHORT API DosAllocSeg(USHORT uiBytes, PSEL selPtr, USHORT uiFlag);
USHORT API DosPrintDestControl(char far *cfpServer,
char far *cfpDest, USHORT uiOpcode);
USHORT API DosPrintDestStatus(char far *cfpName,
USHORT uiPid, USHORT uiStatus, char far *cfpStatus);
USHORT API DosSetSigHandler(PFNSIGHANDLER pfnSigHandler,
PFNSIGHANDLER FAR * pfnPrev,
PUSHORT pfAction,
USHORT fAction,
USHORT usSigNumber);
USHORT API DosPrintJobDel(char far *sfServer, USHORT uiJobID);
USHORT API DosSleep(ULONG);
USHORT API DosFindFirst(CHAR FAR *, USHORT FAR *, USHORT, PFILEFINDBUF, USHORT, PUSHORT, ULONG);
USHORT API DosFindNext(USHORT, PFILEFINDBUF, USHORT, PUSHORT);
USHORT API DosGetPID(PPIDINFO);
#endif OS2_H