home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
pasos2c1.zip
/
include
/
os2.hp
< prev
next >
Wrap
Text File
|
1993-12-17
|
4KB
|
120 lines
(*
* FileName: os2.inc
* $Source: $
* $Author: wjw $
* $Date: 1993/09/24 11:05:01 $
* $Locker: wjw $
* $State: Exp $
* $Revision: $
* Description:
* Part of the runtime library which comes with PASCAL for OS/2
*
* History:
* First created by Willem Jan Withagen ( wjw@eb.ele.tue.nl ),
* on Mon July 26 23:30:03 MET 1993
* Copyright:
* Copyright (c) 1993 by Willem Jan Withagen and
* Digital Information Systems group, TUE
* For copying and distribution information see the file COPYRIGHT.
*
*)
(* Used parts of OS/2 EMX/C
(* To be include in modules which want to interface with the EMX/C library
(* functions.
(* Or to the few functions coded in Assembler in the main assembler module.
*)
const
(* File modes *)
O_RDONLY = 0;
O_WRONLY = 1;
O_RDWR = 2;
O_ACCMODE = 3;
O_NDELAY = 4;
O_APPEND = 8;
O_TEXT = 16;
F_EOF = 32;
F_TERMIO = 64;
F_DEV = 128;
O_BINARY = 256;
O_CREAT = 512;
O_TRUNC = 1024;
O_EXCL = 2048;
F_NPIPE = 4096;
(* ioctl parameters and results *)
FIONREAD = 16;
FGETHTYPE = 32;
HT_FILE = 0;
HT_UPIPE = 1;
HT_NPIPE = 2;
HT_DEV_OTHER = 3;
HT_DEV_NUL = 4;
HT_DEV_CON = 5;
HT_DEV_CLK = 7;
(* HT_ISDEV(n) ((n) >= HT_DEV_OTHER && (n) <= HT_DEV_CLK) *)
(* The maximum size of a file name *)
MAX_PATH = 256;
(* We need some defines since the current PASCAL version doesn''t allow for
(* Constant expressions to be assigned to constants.
(* So this way the get include as full computed functions
*)
#define CR chr(13)
#define LF chr(10)
type
_word = integer;
_str = array[1..8] of char;
_filename = array[1..MAX_PATH] of char;
FUNCTION Copen (path: _str; (* The name to give to the file *)
openflag: _word
):_word; external; (* return the handle *)
FUNCTION Cclose(fhdl :_word (* handle to close *)
):_word; external;
FUNCTION Cwrite( fhdl: _word; (* Handle to write to *)
str: _str; (* String to write *)
cnt: _word (* Number of bytes to write *)
):_word; external;
FUNCTION Cread( fhdl: _word; (* Handle to read from *)
str: _str; (* String to read into *)
cnt: _word (* Number of bytes to read *)
):_word; external;
(* ioctl has two incarnations in C, only using one *)
FUNCTION Cioctl( fhdl: _word; (* Handle to work on *)
req: _word; (* what to do *)
VAR res: _word (* The result *)
):_word; external;
FUNCTION Cisatty( fhdl: _word
):_word; external;
PROCEDURE Cexit( val :_word (* Exit code *)
); external;
FUNCTION Cmalloc( Size :_word ):_word; external;
PROCEDURE Cfree ( Start :_word ); external;
(* And somethings coded in assembler *)
(* Copy a piece of memory, but it should not overlap *)
procedure $memcopy(VAR source, dest :_str; size :_word ); external;
(* Return the address of a string *)
function $StrAddr(Var src:_str):_word; external;
(* Logic operations *)
function $shl(v,s :_word): _word; external;
function $Andword(a,b :_word): _word; external;
function $Orword(a,b :_word): _word; external;
function $Invword(a :_word): _word; external;
(*
* $Log: $
*
* First created by Willem Jan Withagen ( wjw@eb.ele.tue.nl ),
* on Mon July 26 23:30:03 MET 1993
*)