mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 11:02:24 +00:00
Uppercase internal SYSTEM.H types address, int*, uint*. Phase 1.
This commit is contained in:
parent
1935f63cd6
commit
baeb2db81f
205 changed files with 8388 additions and 8311 deletions
|
|
@ -1,9 +1,9 @@
|
|||
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
#define LONGINT INT32
|
||||
#define SET UINT32
|
||||
|
||||
#include "SYSTEM.h"
|
||||
|
||||
|
|
@ -14,92 +14,92 @@ typedef
|
|||
Platform_ArgPtr (*Platform_ArgVec)[1024];
|
||||
|
||||
typedef
|
||||
int32 (*Platform_ArgVecPtr)[1];
|
||||
INT32 (*Platform_ArgVecPtr)[1];
|
||||
|
||||
typedef
|
||||
CHAR (*Platform_EnvPtr)[1024];
|
||||
|
||||
typedef
|
||||
struct Platform_FileIdentity {
|
||||
int32 volume, index, mtime;
|
||||
INT32 volume, index, mtime;
|
||||
} Platform_FileIdentity;
|
||||
|
||||
typedef
|
||||
void (*Platform_HaltProcedure)(int32);
|
||||
void (*Platform_HaltProcedure)(INT32);
|
||||
|
||||
typedef
|
||||
void (*Platform_SignalHandler)(int32);
|
||||
void (*Platform_SignalHandler)(INT32);
|
||||
|
||||
|
||||
export BOOLEAN Platform_LittleEndian;
|
||||
export int32 Platform_MainStackFrame;
|
||||
export int32 Platform_HaltCode;
|
||||
export int16 Platform_PID;
|
||||
export INT32 Platform_MainStackFrame;
|
||||
export INT32 Platform_HaltCode;
|
||||
export INT16 Platform_PID;
|
||||
export CHAR Platform_CWD[256];
|
||||
export int16 Platform_ArgCount;
|
||||
export int32 Platform_ArgVector;
|
||||
export INT16 Platform_ArgCount;
|
||||
export INT32 Platform_ArgVector;
|
||||
static Platform_HaltProcedure Platform_HaltHandler;
|
||||
static int32 Platform_TimeStart;
|
||||
export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd;
|
||||
static INT32 Platform_TimeStart;
|
||||
export INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd;
|
||||
export CHAR Platform_NL[3];
|
||||
|
||||
export address *Platform_FileIdentity__typ;
|
||||
export ADDRESS *Platform_FileIdentity__typ;
|
||||
|
||||
export BOOLEAN Platform_Absent (int16 e);
|
||||
export int16 Platform_ArgPos (CHAR *s, LONGINT s__len);
|
||||
export void Platform_AssertFail (int32 code);
|
||||
export int16 Platform_Chdir (CHAR *n, LONGINT n__len);
|
||||
export int16 Platform_Close (int32 h);
|
||||
export BOOLEAN Platform_ConnectionFailed (int16 e);
|
||||
export void Platform_Delay (int32 ms);
|
||||
export BOOLEAN Platform_DifferentFilesystems (int16 e);
|
||||
static void Platform_DisplayHaltCode (int32 code);
|
||||
export int16 Platform_Error (void);
|
||||
export void Platform_Exit (int16 code);
|
||||
export void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len);
|
||||
export void Platform_GetClock (int32 *t, int32 *d);
|
||||
export BOOLEAN Platform_Absent (INT16 e);
|
||||
export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len);
|
||||
export void Platform_AssertFail (INT32 code);
|
||||
export INT16 Platform_Chdir (CHAR *n, LONGINT n__len);
|
||||
export INT16 Platform_Close (INT32 h);
|
||||
export BOOLEAN Platform_ConnectionFailed (INT16 e);
|
||||
export void Platform_Delay (INT32 ms);
|
||||
export BOOLEAN Platform_DifferentFilesystems (INT16 e);
|
||||
static void Platform_DisplayHaltCode (INT32 code);
|
||||
export INT16 Platform_Error (void);
|
||||
export void Platform_Exit (INT16 code);
|
||||
export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len);
|
||||
export void Platform_GetClock (INT32 *t, INT32 *d);
|
||||
export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len);
|
||||
export void Platform_GetIntArg (int16 n, int32 *val);
|
||||
export void Platform_GetTimeOfDay (int32 *sec, int32 *usec);
|
||||
export void Platform_Halt (int32 code);
|
||||
export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ);
|
||||
export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ);
|
||||
export BOOLEAN Platform_Inaccessible (int16 e);
|
||||
export void Platform_Init (int32 argc, int32 argvadr);
|
||||
export BOOLEAN Platform_Interrupted (int16 e);
|
||||
export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d);
|
||||
export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h);
|
||||
export BOOLEAN Platform_NoSuchDirectory (int16 e);
|
||||
export int32 Platform_OSAllocate (int32 size);
|
||||
export void Platform_OSFree (int32 address);
|
||||
export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h);
|
||||
export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h);
|
||||
export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n);
|
||||
export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n);
|
||||
export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len);
|
||||
export void Platform_GetIntArg (INT16 n, INT32 *val);
|
||||
export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec);
|
||||
export void Platform_Halt (INT32 code);
|
||||
export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ);
|
||||
export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ);
|
||||
export BOOLEAN Platform_Inaccessible (INT16 e);
|
||||
export void Platform_Init (INT32 argc, INT32 argvadr);
|
||||
export BOOLEAN Platform_Interrupted (INT16 e);
|
||||
export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d);
|
||||
export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h);
|
||||
export BOOLEAN Platform_NoSuchDirectory (INT16 e);
|
||||
export INT32 Platform_OSAllocate (INT32 size);
|
||||
export void Platform_OSFree (INT32 address);
|
||||
export INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h);
|
||||
export INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h);
|
||||
export INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n);
|
||||
export INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n);
|
||||
export INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len);
|
||||
export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2);
|
||||
export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2);
|
||||
export int16 Platform_Seek (int32 h, int32 offset, int16 whence);
|
||||
export INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence);
|
||||
export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler);
|
||||
export void Platform_SetHalt (Platform_HaltProcedure p);
|
||||
export void Platform_SetInterruptHandler (Platform_SignalHandler handler);
|
||||
export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source);
|
||||
export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source);
|
||||
export void Platform_SetQuitHandler (Platform_SignalHandler handler);
|
||||
export int16 Platform_Size (int32 h, int32 *l);
|
||||
export int16 Platform_Sync (int32 h);
|
||||
export int16 Platform_System (CHAR *cmd, LONGINT cmd__len);
|
||||
export INT16 Platform_Size (INT32 h, INT32 *l);
|
||||
export INT16 Platform_Sync (INT32 h);
|
||||
export INT16 Platform_System (CHAR *cmd, LONGINT cmd__len);
|
||||
static void Platform_TestLittleEndian (void);
|
||||
export int32 Platform_Time (void);
|
||||
export BOOLEAN Platform_TimedOut (int16 e);
|
||||
export BOOLEAN Platform_TooManyFiles (int16 e);
|
||||
export int16 Platform_Truncate (int32 h, int32 l);
|
||||
export int16 Platform_Unlink (CHAR *n, LONGINT n__len);
|
||||
export int16 Platform_Write (int32 h, int32 p, int32 l);
|
||||
static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d);
|
||||
export INT32 Platform_Time (void);
|
||||
export BOOLEAN Platform_TimedOut (INT16 e);
|
||||
export BOOLEAN Platform_TooManyFiles (INT16 e);
|
||||
export INT16 Platform_Truncate (INT32 h, INT32 l);
|
||||
export INT16 Platform_Unlink (CHAR *n, LONGINT n__len);
|
||||
export INT16 Platform_Write (INT32 h, INT32 p, INT32 l);
|
||||
static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d);
|
||||
static void Platform_errch (CHAR c);
|
||||
static void Platform_errint (int32 l);
|
||||
static void Platform_errint (INT32 l);
|
||||
static void Platform_errln (void);
|
||||
static void Platform_errposint (int32 l);
|
||||
static void Platform_errposint (INT32 l);
|
||||
export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len);
|
||||
|
||||
#include <errno.h>
|
||||
|
|
@ -127,7 +127,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT
|
|||
#define Platform_EXDEV() EXDEV
|
||||
extern void Heap_InitHeap();
|
||||
#define Platform_HeapInitHeap() Heap_InitHeap()
|
||||
#define Platform_allocate(size) (address)((void*)malloc((size_t)size))
|
||||
#define Platform_allocate(size) (ADDRESS)((void*)malloc((size_t)size))
|
||||
#define Platform_chdir(n, n__len) chdir((char*)n)
|
||||
#define Platform_closefile(fd) close(fd)
|
||||
#define Platform_err() errno
|
||||
|
|
@ -147,13 +147,13 @@ extern void Heap_InitHeap();
|
|||
#define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664)
|
||||
#define Platform_openro(n, n__len) open((char*)n, O_RDONLY)
|
||||
#define Platform_openrw(n, n__len) open((char*)n, O_RDWR)
|
||||
#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(address)(p), l)
|
||||
#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(ADDRESS)(p), l)
|
||||
#define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n)
|
||||
#define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s)
|
||||
#define Platform_seekcur() SEEK_CUR
|
||||
#define Platform_seekend() SEEK_END
|
||||
#define Platform_seekset() SEEK_SET
|
||||
#define Platform_sethandler(s, h) SystemSetHandler(s, (address)h)
|
||||
#define Platform_sethandler(s, h) SystemSetHandler(s, (ADDRESS)h)
|
||||
#define Platform_stat(n, n__len) stat((char*)n, &s)
|
||||
#define Platform_statdev() (LONGINT)s.st_dev
|
||||
#define Platform_statino() (LONGINT)s.st_ino
|
||||
|
|
@ -170,63 +170,63 @@ extern void Heap_InitHeap();
|
|||
#define Platform_tvsec() tv.tv_sec
|
||||
#define Platform_tvusec() tv.tv_usec
|
||||
#define Platform_unlink(n, n__len) unlink((char*)n)
|
||||
#define Platform_writefile(fd, p, l) write(fd, (void*)(address)(p), l)
|
||||
#define Platform_writefile(fd, p, l) write(fd, (void*)(ADDRESS)(p), l)
|
||||
|
||||
BOOLEAN Platform_TooManyFiles (int16 e)
|
||||
BOOLEAN Platform_TooManyFiles (INT16 e)
|
||||
{
|
||||
return e == Platform_EMFILE() || e == Platform_ENFILE();
|
||||
}
|
||||
|
||||
BOOLEAN Platform_NoSuchDirectory (int16 e)
|
||||
BOOLEAN Platform_NoSuchDirectory (INT16 e)
|
||||
{
|
||||
return e == Platform_ENOENT();
|
||||
}
|
||||
|
||||
BOOLEAN Platform_DifferentFilesystems (int16 e)
|
||||
BOOLEAN Platform_DifferentFilesystems (INT16 e)
|
||||
{
|
||||
return e == Platform_EXDEV();
|
||||
}
|
||||
|
||||
BOOLEAN Platform_Inaccessible (int16 e)
|
||||
BOOLEAN Platform_Inaccessible (INT16 e)
|
||||
{
|
||||
return (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN();
|
||||
}
|
||||
|
||||
BOOLEAN Platform_Absent (int16 e)
|
||||
BOOLEAN Platform_Absent (INT16 e)
|
||||
{
|
||||
return e == Platform_ENOENT();
|
||||
}
|
||||
|
||||
BOOLEAN Platform_TimedOut (int16 e)
|
||||
BOOLEAN Platform_TimedOut (INT16 e)
|
||||
{
|
||||
return e == Platform_ETIMEDOUT();
|
||||
}
|
||||
|
||||
BOOLEAN Platform_ConnectionFailed (int16 e)
|
||||
BOOLEAN Platform_ConnectionFailed (INT16 e)
|
||||
{
|
||||
return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH();
|
||||
}
|
||||
|
||||
BOOLEAN Platform_Interrupted (int16 e)
|
||||
BOOLEAN Platform_Interrupted (INT16 e)
|
||||
{
|
||||
return e == Platform_EINTR();
|
||||
}
|
||||
|
||||
int32 Platform_OSAllocate (int32 size)
|
||||
INT32 Platform_OSAllocate (INT32 size)
|
||||
{
|
||||
return Platform_allocate(size);
|
||||
}
|
||||
|
||||
void Platform_OSFree (int32 address)
|
||||
void Platform_OSFree (INT32 address)
|
||||
{
|
||||
Platform_free(address);
|
||||
}
|
||||
|
||||
void Platform_Init (int32 argc, int32 argvadr)
|
||||
void Platform_Init (INT32 argc, INT32 argvadr)
|
||||
{
|
||||
Platform_ArgVecPtr av = NIL;
|
||||
Platform_MainStackFrame = argvadr;
|
||||
Platform_ArgCount = __VAL(int16, argc);
|
||||
Platform_ArgCount = __VAL(INT16, argc);
|
||||
av = (Platform_ArgVecPtr)(address)argvadr;
|
||||
Platform_ArgVector = (*av)[0];
|
||||
Platform_HaltCode = -128;
|
||||
|
|
@ -254,7 +254,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len)
|
|||
__DEL(var);
|
||||
}
|
||||
|
||||
void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len)
|
||||
void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len)
|
||||
{
|
||||
Platform_ArgVec av = NIL;
|
||||
if (n < Platform_ArgCount) {
|
||||
|
|
@ -263,10 +263,10 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len)
|
|||
}
|
||||
}
|
||||
|
||||
void Platform_GetIntArg (int16 n, int32 *val)
|
||||
void Platform_GetIntArg (INT16 n, INT32 *val)
|
||||
{
|
||||
CHAR s[64];
|
||||
int32 k, d, i;
|
||||
INT32 k, d, i;
|
||||
s[0] = 0x00;
|
||||
Platform_GetArg(n, (void*)s, 64);
|
||||
i = 0;
|
||||
|
|
@ -274,11 +274,11 @@ void Platform_GetIntArg (int16 n, int32 *val)
|
|||
i = 1;
|
||||
}
|
||||
k = 0;
|
||||
d = (int16)s[__X(i, 64)] - 48;
|
||||
d = (INT16)s[__X(i, 64)] - 48;
|
||||
while ((d >= 0 && d <= 9)) {
|
||||
k = k * 10 + d;
|
||||
i += 1;
|
||||
d = (int16)s[__X(i, 64)] - 48;
|
||||
d = (INT16)s[__X(i, 64)] - 48;
|
||||
}
|
||||
if (s[0] == '-') {
|
||||
k = -k;
|
||||
|
|
@ -289,9 +289,9 @@ void Platform_GetIntArg (int16 n, int32 *val)
|
|||
}
|
||||
}
|
||||
|
||||
int16 Platform_ArgPos (CHAR *s, LONGINT s__len)
|
||||
INT16 Platform_ArgPos (CHAR *s, LONGINT s__len)
|
||||
{
|
||||
int16 i;
|
||||
INT16 i;
|
||||
CHAR arg[256];
|
||||
__DUP(s, s__len, CHAR);
|
||||
i = 0;
|
||||
|
|
@ -319,57 +319,57 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler)
|
|||
Platform_sethandler(4, handler);
|
||||
}
|
||||
|
||||
static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d)
|
||||
static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d)
|
||||
{
|
||||
*d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da;
|
||||
*t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se;
|
||||
}
|
||||
|
||||
void Platform_GetClock (int32 *t, int32 *d)
|
||||
void Platform_GetClock (INT32 *t, INT32 *d)
|
||||
{
|
||||
Platform_gettimeval();
|
||||
Platform_sectotm(Platform_tvsec());
|
||||
Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d);
|
||||
}
|
||||
|
||||
void Platform_GetTimeOfDay (int32 *sec, int32 *usec)
|
||||
void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec)
|
||||
{
|
||||
Platform_gettimeval();
|
||||
*sec = Platform_tvsec();
|
||||
*usec = Platform_tvusec();
|
||||
}
|
||||
|
||||
int32 Platform_Time (void)
|
||||
INT32 Platform_Time (void)
|
||||
{
|
||||
int32 ms;
|
||||
INT32 ms;
|
||||
Platform_gettimeval();
|
||||
ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000;
|
||||
return (int)__MOD(ms - Platform_TimeStart, 2147483647);
|
||||
}
|
||||
|
||||
void Platform_Delay (int32 ms)
|
||||
void Platform_Delay (INT32 ms)
|
||||
{
|
||||
int32 s, ns;
|
||||
INT32 s, ns;
|
||||
s = __DIV(ms, 1000);
|
||||
ns = (int)__MOD(ms, 1000) * 1000000;
|
||||
Platform_nanosleep(s, ns);
|
||||
}
|
||||
|
||||
int16 Platform_System (CHAR *cmd, LONGINT cmd__len)
|
||||
INT16 Platform_System (CHAR *cmd, LONGINT cmd__len)
|
||||
{
|
||||
__DUP(cmd, cmd__len, CHAR);
|
||||
__DEL(cmd);
|
||||
return Platform_system(cmd, cmd__len);
|
||||
}
|
||||
|
||||
int16 Platform_Error (void)
|
||||
INT16 Platform_Error (void)
|
||||
{
|
||||
return Platform_err();
|
||||
}
|
||||
|
||||
int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h)
|
||||
INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h)
|
||||
{
|
||||
int16 fd;
|
||||
INT16 fd;
|
||||
fd = Platform_openro(n, n__len);
|
||||
if (fd < 0) {
|
||||
return Platform_err();
|
||||
|
|
@ -380,9 +380,9 @@ int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h)
|
|||
__RETCHK;
|
||||
}
|
||||
|
||||
int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h)
|
||||
INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h)
|
||||
{
|
||||
int16 fd;
|
||||
INT16 fd;
|
||||
fd = Platform_openrw(n, n__len);
|
||||
if (fd < 0) {
|
||||
return Platform_err();
|
||||
|
|
@ -393,9 +393,9 @@ int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h)
|
|||
__RETCHK;
|
||||
}
|
||||
|
||||
int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h)
|
||||
INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h)
|
||||
{
|
||||
int16 fd;
|
||||
INT16 fd;
|
||||
fd = Platform_opennew(n, n__len);
|
||||
if (fd < 0) {
|
||||
return Platform_err();
|
||||
|
|
@ -406,7 +406,7 @@ int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h)
|
|||
__RETCHK;
|
||||
}
|
||||
|
||||
int16 Platform_Close (int32 h)
|
||||
INT16 Platform_Close (INT32 h)
|
||||
{
|
||||
if (Platform_closefile(h) < 0) {
|
||||
return Platform_err();
|
||||
|
|
@ -416,7 +416,7 @@ int16 Platform_Close (int32 h)
|
|||
__RETCHK;
|
||||
}
|
||||
|
||||
int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ)
|
||||
INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ)
|
||||
{
|
||||
Platform_structstats();
|
||||
if (Platform_fstat(h) < 0) {
|
||||
|
|
@ -428,7 +428,7 @@ int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *iden
|
|||
return 0;
|
||||
}
|
||||
|
||||
int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ)
|
||||
INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ)
|
||||
{
|
||||
__DUP(n, n__len, CHAR);
|
||||
Platform_structstats();
|
||||
|
|
@ -453,18 +453,18 @@ BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i
|
|||
return i1.mtime == i2.mtime;
|
||||
}
|
||||
|
||||
void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source)
|
||||
void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source)
|
||||
{
|
||||
(*target).mtime = source.mtime;
|
||||
}
|
||||
|
||||
void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d)
|
||||
void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d)
|
||||
{
|
||||
Platform_sectotm(i.mtime);
|
||||
Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d);
|
||||
}
|
||||
|
||||
int16 Platform_Size (int32 h, int32 *l)
|
||||
INT16 Platform_Size (INT32 h, INT32 *l)
|
||||
{
|
||||
Platform_structstats();
|
||||
if (Platform_fstat(h) < 0) {
|
||||
|
|
@ -474,7 +474,7 @@ int16 Platform_Size (int32 h, int32 *l)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n)
|
||||
INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n)
|
||||
{
|
||||
*n = Platform_readfile(h, p, l);
|
||||
if (*n < 0) {
|
||||
|
|
@ -486,7 +486,7 @@ int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n)
|
|||
__RETCHK;
|
||||
}
|
||||
|
||||
int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n)
|
||||
INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n)
|
||||
{
|
||||
*n = Platform_readfile(h, (address)b, b__len);
|
||||
if (*n < 0) {
|
||||
|
|
@ -498,9 +498,9 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n)
|
|||
__RETCHK;
|
||||
}
|
||||
|
||||
int16 Platform_Write (int32 h, int32 p, int32 l)
|
||||
INT16 Platform_Write (INT32 h, INT32 p, INT32 l)
|
||||
{
|
||||
int32 written;
|
||||
INT32 written;
|
||||
written = Platform_writefile(h, p, l);
|
||||
if (written < 0) {
|
||||
return Platform_err();
|
||||
|
|
@ -510,7 +510,7 @@ int16 Platform_Write (int32 h, int32 p, int32 l)
|
|||
__RETCHK;
|
||||
}
|
||||
|
||||
int16 Platform_Sync (int32 h)
|
||||
INT16 Platform_Sync (INT32 h)
|
||||
{
|
||||
if (Platform_fsync(h) < 0) {
|
||||
return Platform_err();
|
||||
|
|
@ -520,7 +520,7 @@ int16 Platform_Sync (int32 h)
|
|||
__RETCHK;
|
||||
}
|
||||
|
||||
int16 Platform_Seek (int32 h, int32 offset, int16 whence)
|
||||
INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence)
|
||||
{
|
||||
if (Platform_lseek(h, offset, whence) < 0) {
|
||||
return Platform_err();
|
||||
|
|
@ -530,7 +530,7 @@ int16 Platform_Seek (int32 h, int32 offset, int16 whence)
|
|||
__RETCHK;
|
||||
}
|
||||
|
||||
int16 Platform_Truncate (int32 h, int32 l)
|
||||
INT16 Platform_Truncate (INT32 h, INT32 l)
|
||||
{
|
||||
if (Platform_ftruncate(h, l) < 0) {
|
||||
return Platform_err();
|
||||
|
|
@ -540,7 +540,7 @@ int16 Platform_Truncate (int32 h, int32 l)
|
|||
__RETCHK;
|
||||
}
|
||||
|
||||
int16 Platform_Unlink (CHAR *n, LONGINT n__len)
|
||||
INT16 Platform_Unlink (CHAR *n, LONGINT n__len)
|
||||
{
|
||||
if (Platform_unlink(n, n__len) < 0) {
|
||||
return Platform_err();
|
||||
|
|
@ -550,9 +550,9 @@ int16 Platform_Unlink (CHAR *n, LONGINT n__len)
|
|||
__RETCHK;
|
||||
}
|
||||
|
||||
int16 Platform_Chdir (CHAR *n, LONGINT n__len)
|
||||
INT16 Platform_Chdir (CHAR *n, LONGINT n__len)
|
||||
{
|
||||
int16 r;
|
||||
INT16 r;
|
||||
if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) {
|
||||
return 0;
|
||||
} else {
|
||||
|
|
@ -561,7 +561,7 @@ int16 Platform_Chdir (CHAR *n, LONGINT n__len)
|
|||
__RETCHK;
|
||||
}
|
||||
|
||||
int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len)
|
||||
INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len)
|
||||
{
|
||||
if (Platform_rename(o, o__len, n, n__len) < 0) {
|
||||
return Platform_err();
|
||||
|
|
@ -571,7 +571,7 @@ int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len)
|
|||
__RETCHK;
|
||||
}
|
||||
|
||||
void Platform_Exit (int16 code)
|
||||
void Platform_Exit (INT16 code)
|
||||
{
|
||||
Platform_exit(code);
|
||||
}
|
||||
|
|
@ -586,7 +586,7 @@ static void Platform_errln (void)
|
|||
Platform_errch(0x0a);
|
||||
}
|
||||
|
||||
static void Platform_errposint (int32 l)
|
||||
static void Platform_errposint (INT32 l)
|
||||
{
|
||||
if (l > 10) {
|
||||
Platform_errposint(__DIV(l, 10));
|
||||
|
|
@ -594,7 +594,7 @@ static void Platform_errposint (int32 l)
|
|||
Platform_errch((CHAR)(48 + (int)__MOD(l, 10)));
|
||||
}
|
||||
|
||||
static void Platform_errint (int32 l)
|
||||
static void Platform_errint (INT32 l)
|
||||
{
|
||||
if (l < 0) {
|
||||
Platform_errch('-');
|
||||
|
|
@ -603,7 +603,7 @@ static void Platform_errint (int32 l)
|
|||
Platform_errposint(l);
|
||||
}
|
||||
|
||||
static void Platform_DisplayHaltCode (int32 code)
|
||||
static void Platform_DisplayHaltCode (INT32 code)
|
||||
{
|
||||
switch (code) {
|
||||
case -1:
|
||||
|
|
@ -659,7 +659,7 @@ static void Platform_DisplayHaltCode (int32 code)
|
|||
}
|
||||
}
|
||||
|
||||
void Platform_Halt (int32 code)
|
||||
void Platform_Halt (INT32 code)
|
||||
{
|
||||
Platform_HaltCode = code;
|
||||
if (Platform_HaltHandler != NIL) {
|
||||
|
|
@ -672,10 +672,10 @@ void Platform_Halt (int32 code)
|
|||
Platform_DisplayHaltCode(code);
|
||||
}
|
||||
Platform_errln();
|
||||
Platform_exit(__VAL(int16, code));
|
||||
Platform_exit(__VAL(INT16, code));
|
||||
}
|
||||
|
||||
void Platform_AssertFail (int32 code)
|
||||
void Platform_AssertFail (INT32 code)
|
||||
{
|
||||
Platform_errstring((CHAR*)"Assertion failure.", 19);
|
||||
if (code != 0) {
|
||||
|
|
@ -684,7 +684,7 @@ void Platform_AssertFail (int32 code)
|
|||
Platform_errstring((CHAR*)".", 2);
|
||||
}
|
||||
Platform_errln();
|
||||
Platform_exit(__VAL(int16, code));
|
||||
Platform_exit(__VAL(INT16, code));
|
||||
}
|
||||
|
||||
void Platform_SetHalt (Platform_HaltProcedure p)
|
||||
|
|
@ -694,7 +694,7 @@ void Platform_SetHalt (Platform_HaltProcedure p)
|
|||
|
||||
static void Platform_TestLittleEndian (void)
|
||||
{
|
||||
int16 i;
|
||||
INT16 i;
|
||||
i = 1;
|
||||
__GET((address)&i, Platform_LittleEndian, BOOLEAN);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue