<*+ CSTDLIB  *>
<*+ NOHEADER *>
<*+ M2EXTENSIONS *>

DEFINITION MODULE ["C"] osic;

FROM SYSTEM IMPORT BYTE, ADDRESS;

TYPE File=INTEGER;

PROCEDURE osic_WrStr(s:ARRAY OF CHAR; size:CARDINAL);
PROCEDURE osic_WrLn();
PROCEDURE osic_WrStrLn(s:ARRAY OF CHAR; size:CARDINAL);
PROCEDURE osic_WrFixed(x:REAL; place:INTEGER; witdh:CARDINAL);
PROCEDURE osic_WrUINT32(n, witdh:CARDINAL);
PROCEDURE osic_WrINT32(n, witdh:CARDINAL);
PROCEDURE osic_WrHex(n, witdh:CARDINAL);
PROCEDURE osic_OpenAppendLong(fn:ARRAY OF CHAR; size:CARDINAL):File;
PROCEDURE osic_OpenAppend(fn:ARRAY OF CHAR; size:CARDINAL):File;
PROCEDURE osic_OpenWrite(fn:ARRAY OF CHAR; size:CARDINAL):File;
PROCEDURE osic_OpenReadLong(fn:ARRAY OF CHAR; size:CARDINAL):File;
PROCEDURE osic_OpenRead(fn:ARRAY OF CHAR; size:CARDINAL):File;
PROCEDURE osic_OpenRW(fn:ARRAY OF CHAR; size:CARDINAL):File;
PROCEDURE osic_OpenNONBLOCK(fn:ARRAY OF CHAR; size:CARDINAL):File;
PROCEDURE osic_FdValid(fd:File):BOOLEAN;
PROCEDURE osic_Close(fd:File);
PROCEDURE osic_CloseSock(fd:File);
PROCEDURE osic_RdBin(fd:File; VAR s:ARRAY OF BYTE; size:CARDINAL; len:CARDINAL):INTEGER;
PROCEDURE osic_WrBin(fd:File; s:ARRAY OF BYTE; size:CARDINAL; len:CARDINAL);
PROCEDURE osic_Rename(s:ARRAY OF CHAR; size:CARDINAL; sn:ARRAY OF CHAR; sizen:CARDINAL);
PROCEDURE osic_Size(fd:File):INTEGER;
PROCEDURE osic_Seek(fd:File; pos:CARDINAL);
PROCEDURE osic_Seekcur(fd:File; rel:INTEGER);

PROCEDURE osic_Remove(fn:ARRAY OF CHAR; size:CARDINAL; VAR done:BOOLEAN);
PROCEDURE osic_Exists(fn:ARRAY OF CHAR; size:CARDINAL):BOOLEAN;
PROCEDURE osic_symblink(exists, newname:ARRAY OF CHAR):INTEGER;
PROCEDURE osic_NextArg(VAR s:ARRAY OF CHAR; size:CARDINAL);
PROCEDURE osic_Fill(adr:ADDRESS; len:CARDINAL; ch:CHAR);
PROCEDURE osic_Random():LONGREAL;

PROCEDURE osic_WerrLn();
PROCEDURE osic_WerrStr(s:ARRAY OF CHAR; size:CARDINAL);
PROCEDURE osic_WerrStrLn(s:ARRAY OF CHAR; size:CARDINAL);
PROCEDURE osic_getptsname(fd:File; VAR s:ARRAY OF BYTE; size:CARDINAL):INTEGER;
PROCEDURE osic_grantpts(fd:File):INTEGER;
PROCEDURE osic_unlockpts(fd:File):INTEGER;

PROCEDURE osic_sin(x:REAL):REAL;
PROCEDURE osic_cos(x:REAL):REAL;
PROCEDURE osic_tan(x:REAL):REAL;
PROCEDURE osic_ln(x:REAL):REAL;
PROCEDURE osic_exp(x:REAL):REAL;
PROCEDURE osic_sqrt(x:REAL):REAL;
PROCEDURE osic_arctan(x:REAL):REAL;
PROCEDURE osic_arccos(x:REAL):REAL;
PROCEDURE osic_power(base, exp:REAL):REAL;
PROCEDURE osic_floor(x:REAL):REAL;
PROCEDURE osic_flush();

PROCEDURE osic_alloc(VAR adr:ADDRESS; len:CARDINAL);
PROCEDURE osic_free(VAR adr:ADDRESS; len:CARDINAL);

PROCEDURE osic_time():CARDINAL;


END osic.
