mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 19:12:25 +00:00
Merge pull request #37 from vishaps/FileList
Remove limit on numeric value of OS handles from Files.Mod
This commit is contained in:
commit
c07485d5a4
198 changed files with 549 additions and 675 deletions
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
|
||||
|
||||
|
|
@ -13,6 +13,6 @@ export void *Configuration__init(void)
|
|||
__DEFMOD;
|
||||
__REGMOD("Configuration", 0);
|
||||
/* BEGIN */
|
||||
__MOVE("1.95 [2016/07/19] for gcc LP64 on cygwin", Configuration_versionLong, 41);
|
||||
__MOVE("1.95 [2016/07/21] for gcc LP64 on cygwin", Configuration_versionLong, 41);
|
||||
__ENDMOD;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Configuration__h
|
||||
#define Configuration__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "Platform.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Console__h
|
||||
#define Console__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "Configuration.h"
|
||||
#include "Console.h"
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
#include "Strings.h"
|
||||
|
||||
typedef
|
||||
struct Files_Handle *Files_File;
|
||||
struct Files_FileDesc *Files_File;
|
||||
|
||||
typedef
|
||||
struct Files_BufDesc {
|
||||
|
|
@ -24,14 +24,15 @@ typedef
|
|||
CHAR Files_FileName[101];
|
||||
|
||||
typedef
|
||||
struct Files_Handle {
|
||||
struct Files_FileDesc {
|
||||
Files_FileName workName, registerName;
|
||||
BOOLEAN tempFile;
|
||||
Platform_FileIdentity identity;
|
||||
LONGINT fd, len, pos;
|
||||
Files_Buffer bufs[4];
|
||||
INTEGER swapper, state;
|
||||
} Files_Handle;
|
||||
Files_File next;
|
||||
} Files_FileDesc;
|
||||
|
||||
typedef
|
||||
struct Files_Rider {
|
||||
|
|
@ -42,7 +43,7 @@ typedef
|
|||
} Files_Rider;
|
||||
|
||||
|
||||
static LONGINT Files_fileTab[256];
|
||||
static Files_File Files_files;
|
||||
static INTEGER Files_tempno;
|
||||
static CHAR Files_HOME[1024];
|
||||
static struct {
|
||||
|
|
@ -50,7 +51,7 @@ static struct {
|
|||
CHAR data[1];
|
||||
} *Files_SearchPath;
|
||||
|
||||
export LONGINT *Files_Handle__typ;
|
||||
export LONGINT *Files_FileDesc__typ;
|
||||
export LONGINT *Files_BufDesc__typ;
|
||||
export LONGINT *Files_Rider__typ;
|
||||
|
||||
|
|
@ -58,6 +59,7 @@ export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ);
|
|||
static Files_File Files_CacheEntry (Platform_FileIdentity identity);
|
||||
export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res);
|
||||
export void Files_Close (Files_File f);
|
||||
static void Files_CloseOSFile (Files_File f);
|
||||
static void Files_Create (Files_File f);
|
||||
export void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res);
|
||||
static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode);
|
||||
|
|
@ -68,7 +70,6 @@ export void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d);
|
|||
export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len);
|
||||
static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len);
|
||||
static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len);
|
||||
static void Files_Init (void);
|
||||
export LONGINT Files_Length (Files_File f);
|
||||
static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len);
|
||||
export Files_File Files_New (CHAR *name, LONGINT name__len);
|
||||
|
|
@ -225,26 +226,14 @@ static void Files_Create (Files_File f)
|
|||
error = Platform_Unlink((void*)f->workName, ((LONGINT)(101)));
|
||||
error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd);
|
||||
done = error == 0;
|
||||
if ((!done && Platform_TooManyFiles(error)) || (done && f->fd >= 256)) {
|
||||
if ((done && f->fd >= 256)) {
|
||||
error = Platform_Close(f->fd);
|
||||
}
|
||||
Heap_GC(1);
|
||||
error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd);
|
||||
done = f->fd == 0;
|
||||
}
|
||||
if (done) {
|
||||
if (f->fd >= 256) {
|
||||
error = Platform_Close(f->fd);
|
||||
Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0);
|
||||
} else {
|
||||
Files_fileTab[f->fd] = (LONGINT)(uintptr_t)f;
|
||||
f->next = Files_files;
|
||||
Files_files = f;
|
||||
Heap_FileCount += 1;
|
||||
Heap_RegisterFinalizer((void*)f, Files_Finalize);
|
||||
f->state = 0;
|
||||
f->pos = 0;
|
||||
error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ);
|
||||
}
|
||||
} else {
|
||||
if (Platform_NoSuchDirectory(error)) {
|
||||
__MOVE("no such directory", err, 18);
|
||||
|
|
@ -281,6 +270,27 @@ static void Files_Flush (Files_Buffer buf)
|
|||
}
|
||||
}
|
||||
|
||||
static void Files_CloseOSFile (Files_File f)
|
||||
{
|
||||
Files_File prev = NIL;
|
||||
INTEGER error;
|
||||
if (Files_files == f) {
|
||||
Files_files = f->next;
|
||||
} else {
|
||||
prev = Files_files;
|
||||
while ((prev != NIL && prev->next != f)) {
|
||||
prev = prev->next;
|
||||
}
|
||||
if (prev->next != NIL) {
|
||||
prev->next = f->next;
|
||||
}
|
||||
}
|
||||
error = Platform_Close(f->fd);
|
||||
f->fd = -1;
|
||||
f->state = 1;
|
||||
Heap_FileCount -= 1;
|
||||
}
|
||||
|
||||
void Files_Close (Files_File f)
|
||||
{
|
||||
LONGINT i;
|
||||
|
|
@ -296,11 +306,7 @@ void Files_Close (Files_File f)
|
|||
if (error != 0) {
|
||||
Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error);
|
||||
}
|
||||
Files_fileTab[f->fd] = 0;
|
||||
error = Platform_Close(f->fd);
|
||||
f->fd = -1;
|
||||
f->state = 1;
|
||||
Heap_FileCount -= 1;
|
||||
Files_CloseOSFile(f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -316,7 +322,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len)
|
|||
Files_File _o_result;
|
||||
Files_File f = NIL;
|
||||
__DUP(name, name__len, CHAR);
|
||||
__NEW(f, Files_Handle);
|
||||
__NEW(f, Files_FileDesc);
|
||||
f->workName[0] = 0x00;
|
||||
__COPY(name, f->registerName, ((LONGINT)(101)));
|
||||
f->fd = -1;
|
||||
|
|
@ -392,10 +398,9 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity)
|
|||
Files_File _o_result;
|
||||
Files_File f = NIL;
|
||||
INTEGER i, error;
|
||||
i = 0;
|
||||
while (i < 256) {
|
||||
f = (Files_File)(uintptr_t)Files_fileTab[i];
|
||||
if ((f != NIL && Platform_SameFile(identity, f->identity))) {
|
||||
f = Files_files;
|
||||
while (f != NIL) {
|
||||
if (Platform_SameFile(identity, f->identity)) {
|
||||
if (!Platform_SameFileTime(identity, f->identity)) {
|
||||
i = 0;
|
||||
while (i < 4) {
|
||||
|
|
@ -412,7 +417,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity)
|
|||
_o_result = f;
|
||||
return _o_result;
|
||||
}
|
||||
i += 1;
|
||||
f = f->next;
|
||||
}
|
||||
_o_result = NIL;
|
||||
return _o_result;
|
||||
|
|
@ -440,19 +445,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
|
|||
Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256)));
|
||||
}
|
||||
for (;;) {
|
||||
error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd);
|
||||
done = error == 0;
|
||||
if ((!done && Platform_TooManyFiles(error)) || (done && fd >= 256)) {
|
||||
if ((done && fd >= 256)) {
|
||||
error = Platform_Close(fd);
|
||||
}
|
||||
Heap_GC(1);
|
||||
error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd);
|
||||
done = error == 0;
|
||||
if ((!done && Platform_TooManyFiles(error))) {
|
||||
Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error);
|
||||
}
|
||||
}
|
||||
if ((!done && Platform_Inaccessible(error))) {
|
||||
error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd);
|
||||
done = error == 0;
|
||||
|
|
@ -468,17 +465,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
|
|||
error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ);
|
||||
f = Files_CacheEntry(identity);
|
||||
if (f != NIL) {
|
||||
error = Platform_Close(fd);
|
||||
_o_result = f;
|
||||
__DEL(name);
|
||||
return _o_result;
|
||||
} else if (fd >= 256) {
|
||||
error = Platform_Close(fd);
|
||||
Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0);
|
||||
} else {
|
||||
__NEW(f, Files_Handle);
|
||||
Files_fileTab[fd] = (LONGINT)(uintptr_t)f;
|
||||
Heap_FileCount += 1;
|
||||
__NEW(f, Files_FileDesc);
|
||||
Heap_RegisterFinalizer((void*)f, Files_Finalize);
|
||||
f->fd = fd;
|
||||
f->state = 0;
|
||||
|
|
@ -489,6 +480,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
|
|||
f->registerName[0] = 0x00;
|
||||
f->tempFile = 0;
|
||||
f->identity = identity;
|
||||
f->next = Files_files;
|
||||
Files_files = f;
|
||||
Heap_FileCount += 1;
|
||||
_o_result = f;
|
||||
__DEL(name);
|
||||
return _o_result;
|
||||
|
|
@ -1014,10 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o)
|
|||
LONGINT res;
|
||||
f = (Files_File)(uintptr_t)o;
|
||||
if (f->fd >= 0) {
|
||||
Files_fileTab[f->fd] = 0;
|
||||
res = Platform_Close(f->fd);
|
||||
f->fd = -1;
|
||||
Heap_FileCount -= 1;
|
||||
Files_CloseOSFile(f);
|
||||
if (f->tempFile) {
|
||||
res = Platform_Unlink((void*)f->workName, ((LONGINT)(101)));
|
||||
}
|
||||
|
|
@ -1036,27 +1027,13 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len)
|
|||
__DEL(path);
|
||||
}
|
||||
|
||||
static void Files_Init (void)
|
||||
{
|
||||
LONGINT i;
|
||||
i = 0;
|
||||
while (i < 256) {
|
||||
Files_fileTab[i] = 0;
|
||||
i += 1;
|
||||
}
|
||||
Files_tempno = -1;
|
||||
Heap_FileCount = 0;
|
||||
Files_SearchPath = NIL;
|
||||
Files_HOME[0] = 0x00;
|
||||
Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024)));
|
||||
}
|
||||
|
||||
static void EnumPtrs(void (*P)(void*))
|
||||
{
|
||||
P(Files_files);
|
||||
P(Files_SearchPath);
|
||||
}
|
||||
|
||||
__TDESC(Files_Handle, 1, 4) = {__TDFLDS("Handle", 248), {228, 232, 236, 240, -20}};
|
||||
__TDESC(Files_FileDesc, 1, 5) = {__TDFLDS("FileDesc", 252), {228, 232, 236, 240, 248, -24}};
|
||||
__TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4112), {0, -8}};
|
||||
__TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 20), {8, -8}};
|
||||
|
||||
|
|
@ -1069,10 +1046,13 @@ export void *Files__init(void)
|
|||
__MODULE_IMPORT(Platform);
|
||||
__MODULE_IMPORT(Strings);
|
||||
__REGMOD("Files", EnumPtrs);
|
||||
__INITYP(Files_Handle, Files_Handle, 0);
|
||||
__INITYP(Files_FileDesc, Files_FileDesc, 0);
|
||||
__INITYP(Files_BufDesc, Files_BufDesc, 0);
|
||||
__INITYP(Files_Rider, Files_Rider, 0);
|
||||
/* BEGIN */
|
||||
Files_Init();
|
||||
Files_tempno = -1;
|
||||
Heap_FileCount = 0;
|
||||
Files_HOME[0] = 0x00;
|
||||
Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024)));
|
||||
__ENDMOD;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */
|
||||
|
||||
#ifndef Files__h
|
||||
#define Files__h
|
||||
|
|
@ -6,14 +6,14 @@
|
|||
#include "SYSTEM.h"
|
||||
|
||||
typedef
|
||||
struct Files_Handle *Files_File;
|
||||
struct Files_FileDesc *Files_File;
|
||||
|
||||
typedef
|
||||
struct Files_Handle {
|
||||
struct Files_FileDesc {
|
||||
char _prvt0[216];
|
||||
LONGINT fd;
|
||||
char _prvt1[28];
|
||||
} Files_Handle;
|
||||
char _prvt1[32];
|
||||
} Files_FileDesc;
|
||||
|
||||
typedef
|
||||
struct Files_Rider {
|
||||
|
|
@ -24,7 +24,7 @@ typedef
|
|||
|
||||
|
||||
|
||||
import LONGINT *Files_Handle__typ;
|
||||
import LONGINT *Files_FileDesc__typ;
|
||||
import LONGINT *Files_Rider__typ;
|
||||
|
||||
import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */
|
||||
#include "SYSTEM.h"
|
||||
|
||||
struct Heap__1 {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */
|
||||
|
||||
#ifndef Heap__h
|
||||
#define Heap__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "Console.h"
|
||||
#include "Heap.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Modules__h
|
||||
#define Modules__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "OPM.h"
|
||||
#include "OPS.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef OPB__h
|
||||
#define OPB__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "Configuration.h"
|
||||
#include "OPM.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef OPC__h
|
||||
#define OPC__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "Configuration.h"
|
||||
#include "Console.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef OPM__h
|
||||
#define OPM__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "OPB.h"
|
||||
#include "OPM.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef OPP__h
|
||||
#define OPP__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "OPM.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */
|
||||
|
||||
#ifndef OPS__h
|
||||
#define OPS__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "OPM.h"
|
||||
#include "OPS.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef OPT__h
|
||||
#define OPT__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "OPC.h"
|
||||
#include "OPM.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef OPV__h
|
||||
#define OPV__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
|
||||
typedef
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Platform__h
|
||||
#define Platform__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Reals__h
|
||||
#define Reals__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Strings__h
|
||||
#define Strings__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "Files.h"
|
||||
#include "Modules.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Texts__h
|
||||
#define Texts__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkamSf */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkamSf */
|
||||
#include "SYSTEM.h"
|
||||
#include "Configuration.h"
|
||||
#include "Heap.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
|
||||
typedef
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef errors__h
|
||||
#define errors__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "Configuration.h"
|
||||
#include "Console.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef extTools__h
|
||||
#define extTools__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "Console.h"
|
||||
#include "Strings.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef vt100__h
|
||||
#define vt100__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
|
||||
|
||||
|
|
@ -13,6 +13,6 @@ export void *Configuration__init(void)
|
|||
__DEFMOD;
|
||||
__REGMOD("Configuration", 0);
|
||||
/* BEGIN */
|
||||
__MOVE("1.95 [2016/07/19] for gcc LP64 on cygwin", Configuration_versionLong, 41);
|
||||
__MOVE("1.95 [2016/07/21] for gcc LP64 on cygwin", Configuration_versionLong, 41);
|
||||
__ENDMOD;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Configuration__h
|
||||
#define Configuration__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "Platform.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Console__h
|
||||
#define Console__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "Configuration.h"
|
||||
#include "Console.h"
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
#include "Strings.h"
|
||||
|
||||
typedef
|
||||
struct Files_Handle *Files_File;
|
||||
struct Files_FileDesc *Files_File;
|
||||
|
||||
typedef
|
||||
struct Files_BufDesc {
|
||||
|
|
@ -24,14 +24,15 @@ typedef
|
|||
CHAR Files_FileName[101];
|
||||
|
||||
typedef
|
||||
struct Files_Handle {
|
||||
struct Files_FileDesc {
|
||||
Files_FileName workName, registerName;
|
||||
BOOLEAN tempFile;
|
||||
Platform_FileIdentity identity;
|
||||
LONGINT fd, len, pos;
|
||||
Files_Buffer bufs[4];
|
||||
INTEGER swapper, state;
|
||||
} Files_Handle;
|
||||
Files_File next;
|
||||
} Files_FileDesc;
|
||||
|
||||
typedef
|
||||
struct Files_Rider {
|
||||
|
|
@ -42,7 +43,7 @@ typedef
|
|||
} Files_Rider;
|
||||
|
||||
|
||||
static LONGINT Files_fileTab[256];
|
||||
static Files_File Files_files;
|
||||
static INTEGER Files_tempno;
|
||||
static CHAR Files_HOME[1024];
|
||||
static struct {
|
||||
|
|
@ -50,7 +51,7 @@ static struct {
|
|||
CHAR data[1];
|
||||
} *Files_SearchPath;
|
||||
|
||||
export LONGINT *Files_Handle__typ;
|
||||
export LONGINT *Files_FileDesc__typ;
|
||||
export LONGINT *Files_BufDesc__typ;
|
||||
export LONGINT *Files_Rider__typ;
|
||||
|
||||
|
|
@ -58,6 +59,7 @@ export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ);
|
|||
static Files_File Files_CacheEntry (Platform_FileIdentity identity);
|
||||
export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res);
|
||||
export void Files_Close (Files_File f);
|
||||
static void Files_CloseOSFile (Files_File f);
|
||||
static void Files_Create (Files_File f);
|
||||
export void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res);
|
||||
static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode);
|
||||
|
|
@ -68,7 +70,6 @@ export void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d);
|
|||
export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len);
|
||||
static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len);
|
||||
static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len);
|
||||
static void Files_Init (void);
|
||||
export LONGINT Files_Length (Files_File f);
|
||||
static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len);
|
||||
export Files_File Files_New (CHAR *name, LONGINT name__len);
|
||||
|
|
@ -225,26 +226,14 @@ static void Files_Create (Files_File f)
|
|||
error = Platform_Unlink((void*)f->workName, ((LONGINT)(101)));
|
||||
error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd);
|
||||
done = error == 0;
|
||||
if ((!done && Platform_TooManyFiles(error)) || (done && f->fd >= 256)) {
|
||||
if ((done && f->fd >= 256)) {
|
||||
error = Platform_Close(f->fd);
|
||||
}
|
||||
Heap_GC(1);
|
||||
error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd);
|
||||
done = f->fd == 0;
|
||||
}
|
||||
if (done) {
|
||||
if (f->fd >= 256) {
|
||||
error = Platform_Close(f->fd);
|
||||
Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0);
|
||||
} else {
|
||||
Files_fileTab[f->fd] = (LONGINT)(uintptr_t)f;
|
||||
f->next = Files_files;
|
||||
Files_files = f;
|
||||
Heap_FileCount += 1;
|
||||
Heap_RegisterFinalizer((void*)f, Files_Finalize);
|
||||
f->state = 0;
|
||||
f->pos = 0;
|
||||
error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ);
|
||||
}
|
||||
} else {
|
||||
if (Platform_NoSuchDirectory(error)) {
|
||||
__MOVE("no such directory", err, 18);
|
||||
|
|
@ -281,6 +270,27 @@ static void Files_Flush (Files_Buffer buf)
|
|||
}
|
||||
}
|
||||
|
||||
static void Files_CloseOSFile (Files_File f)
|
||||
{
|
||||
Files_File prev = NIL;
|
||||
INTEGER error;
|
||||
if (Files_files == f) {
|
||||
Files_files = f->next;
|
||||
} else {
|
||||
prev = Files_files;
|
||||
while ((prev != NIL && prev->next != f)) {
|
||||
prev = prev->next;
|
||||
}
|
||||
if (prev->next != NIL) {
|
||||
prev->next = f->next;
|
||||
}
|
||||
}
|
||||
error = Platform_Close(f->fd);
|
||||
f->fd = -1;
|
||||
f->state = 1;
|
||||
Heap_FileCount -= 1;
|
||||
}
|
||||
|
||||
void Files_Close (Files_File f)
|
||||
{
|
||||
LONGINT i;
|
||||
|
|
@ -296,11 +306,7 @@ void Files_Close (Files_File f)
|
|||
if (error != 0) {
|
||||
Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error);
|
||||
}
|
||||
Files_fileTab[f->fd] = 0;
|
||||
error = Platform_Close(f->fd);
|
||||
f->fd = -1;
|
||||
f->state = 1;
|
||||
Heap_FileCount -= 1;
|
||||
Files_CloseOSFile(f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -316,7 +322,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len)
|
|||
Files_File _o_result;
|
||||
Files_File f = NIL;
|
||||
__DUP(name, name__len, CHAR);
|
||||
__NEW(f, Files_Handle);
|
||||
__NEW(f, Files_FileDesc);
|
||||
f->workName[0] = 0x00;
|
||||
__COPY(name, f->registerName, ((LONGINT)(101)));
|
||||
f->fd = -1;
|
||||
|
|
@ -392,10 +398,9 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity)
|
|||
Files_File _o_result;
|
||||
Files_File f = NIL;
|
||||
INTEGER i, error;
|
||||
i = 0;
|
||||
while (i < 256) {
|
||||
f = (Files_File)(uintptr_t)Files_fileTab[i];
|
||||
if ((f != NIL && Platform_SameFile(identity, f->identity))) {
|
||||
f = Files_files;
|
||||
while (f != NIL) {
|
||||
if (Platform_SameFile(identity, f->identity)) {
|
||||
if (!Platform_SameFileTime(identity, f->identity)) {
|
||||
i = 0;
|
||||
while (i < 4) {
|
||||
|
|
@ -412,7 +417,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity)
|
|||
_o_result = f;
|
||||
return _o_result;
|
||||
}
|
||||
i += 1;
|
||||
f = f->next;
|
||||
}
|
||||
_o_result = NIL;
|
||||
return _o_result;
|
||||
|
|
@ -440,19 +445,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
|
|||
Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256)));
|
||||
}
|
||||
for (;;) {
|
||||
error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd);
|
||||
done = error == 0;
|
||||
if ((!done && Platform_TooManyFiles(error)) || (done && fd >= 256)) {
|
||||
if ((done && fd >= 256)) {
|
||||
error = Platform_Close(fd);
|
||||
}
|
||||
Heap_GC(1);
|
||||
error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd);
|
||||
done = error == 0;
|
||||
if ((!done && Platform_TooManyFiles(error))) {
|
||||
Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error);
|
||||
}
|
||||
}
|
||||
if ((!done && Platform_Inaccessible(error))) {
|
||||
error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd);
|
||||
done = error == 0;
|
||||
|
|
@ -468,17 +465,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
|
|||
error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ);
|
||||
f = Files_CacheEntry(identity);
|
||||
if (f != NIL) {
|
||||
error = Platform_Close(fd);
|
||||
_o_result = f;
|
||||
__DEL(name);
|
||||
return _o_result;
|
||||
} else if (fd >= 256) {
|
||||
error = Platform_Close(fd);
|
||||
Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0);
|
||||
} else {
|
||||
__NEW(f, Files_Handle);
|
||||
Files_fileTab[fd] = (LONGINT)(uintptr_t)f;
|
||||
Heap_FileCount += 1;
|
||||
__NEW(f, Files_FileDesc);
|
||||
Heap_RegisterFinalizer((void*)f, Files_Finalize);
|
||||
f->fd = fd;
|
||||
f->state = 0;
|
||||
|
|
@ -489,6 +480,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
|
|||
f->registerName[0] = 0x00;
|
||||
f->tempFile = 0;
|
||||
f->identity = identity;
|
||||
f->next = Files_files;
|
||||
Files_files = f;
|
||||
Heap_FileCount += 1;
|
||||
_o_result = f;
|
||||
__DEL(name);
|
||||
return _o_result;
|
||||
|
|
@ -1014,10 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o)
|
|||
LONGINT res;
|
||||
f = (Files_File)(uintptr_t)o;
|
||||
if (f->fd >= 0) {
|
||||
Files_fileTab[f->fd] = 0;
|
||||
res = Platform_Close(f->fd);
|
||||
f->fd = -1;
|
||||
Heap_FileCount -= 1;
|
||||
Files_CloseOSFile(f);
|
||||
if (f->tempFile) {
|
||||
res = Platform_Unlink((void*)f->workName, ((LONGINT)(101)));
|
||||
}
|
||||
|
|
@ -1036,27 +1027,13 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len)
|
|||
__DEL(path);
|
||||
}
|
||||
|
||||
static void Files_Init (void)
|
||||
{
|
||||
LONGINT i;
|
||||
i = 0;
|
||||
while (i < 256) {
|
||||
Files_fileTab[i] = 0;
|
||||
i += 1;
|
||||
}
|
||||
Files_tempno = -1;
|
||||
Heap_FileCount = 0;
|
||||
Files_SearchPath = NIL;
|
||||
Files_HOME[0] = 0x00;
|
||||
Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024)));
|
||||
}
|
||||
|
||||
static void EnumPtrs(void (*P)(void*))
|
||||
{
|
||||
P(Files_files);
|
||||
P(Files_SearchPath);
|
||||
}
|
||||
|
||||
__TDESC(Files_Handle, 1, 4) = {__TDFLDS("Handle", 248), {228, 232, 236, 240, -20}};
|
||||
__TDESC(Files_FileDesc, 1, 5) = {__TDFLDS("FileDesc", 252), {228, 232, 236, 240, 248, -24}};
|
||||
__TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4112), {0, -8}};
|
||||
__TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 20), {8, -8}};
|
||||
|
||||
|
|
@ -1069,10 +1046,13 @@ export void *Files__init(void)
|
|||
__MODULE_IMPORT(Platform);
|
||||
__MODULE_IMPORT(Strings);
|
||||
__REGMOD("Files", EnumPtrs);
|
||||
__INITYP(Files_Handle, Files_Handle, 0);
|
||||
__INITYP(Files_FileDesc, Files_FileDesc, 0);
|
||||
__INITYP(Files_BufDesc, Files_BufDesc, 0);
|
||||
__INITYP(Files_Rider, Files_Rider, 0);
|
||||
/* BEGIN */
|
||||
Files_Init();
|
||||
Files_tempno = -1;
|
||||
Heap_FileCount = 0;
|
||||
Files_HOME[0] = 0x00;
|
||||
Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024)));
|
||||
__ENDMOD;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */
|
||||
|
||||
#ifndef Files__h
|
||||
#define Files__h
|
||||
|
|
@ -6,14 +6,14 @@
|
|||
#include "SYSTEM.h"
|
||||
|
||||
typedef
|
||||
struct Files_Handle *Files_File;
|
||||
struct Files_FileDesc *Files_File;
|
||||
|
||||
typedef
|
||||
struct Files_Handle {
|
||||
struct Files_FileDesc {
|
||||
char _prvt0[216];
|
||||
LONGINT fd;
|
||||
char _prvt1[28];
|
||||
} Files_Handle;
|
||||
char _prvt1[32];
|
||||
} Files_FileDesc;
|
||||
|
||||
typedef
|
||||
struct Files_Rider {
|
||||
|
|
@ -24,7 +24,7 @@ typedef
|
|||
|
||||
|
||||
|
||||
import LONGINT *Files_Handle__typ;
|
||||
import LONGINT *Files_FileDesc__typ;
|
||||
import LONGINT *Files_Rider__typ;
|
||||
|
||||
import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */
|
||||
#include "SYSTEM.h"
|
||||
|
||||
struct Heap__1 {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */
|
||||
|
||||
#ifndef Heap__h
|
||||
#define Heap__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "Console.h"
|
||||
#include "Heap.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Modules__h
|
||||
#define Modules__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "OPM.h"
|
||||
#include "OPS.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef OPB__h
|
||||
#define OPB__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "Configuration.h"
|
||||
#include "OPM.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef OPC__h
|
||||
#define OPC__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "Configuration.h"
|
||||
#include "Console.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef OPM__h
|
||||
#define OPM__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "OPB.h"
|
||||
#include "OPM.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef OPP__h
|
||||
#define OPP__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "OPM.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */
|
||||
|
||||
#ifndef OPS__h
|
||||
#define OPS__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "OPM.h"
|
||||
#include "OPS.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef OPT__h
|
||||
#define OPT__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "OPC.h"
|
||||
#include "OPM.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef OPV__h
|
||||
#define OPV__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
|
||||
typedef
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Platform__h
|
||||
#define Platform__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Reals__h
|
||||
#define Reals__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Strings__h
|
||||
#define Strings__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "Files.h"
|
||||
#include "Modules.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Texts__h
|
||||
#define Texts__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkamSf */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkamSf */
|
||||
#include "SYSTEM.h"
|
||||
#include "Configuration.h"
|
||||
#include "Heap.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
|
||||
typedef
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef errors__h
|
||||
#define errors__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "Configuration.h"
|
||||
#include "Console.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef extTools__h
|
||||
#define extTools__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#include "SYSTEM.h"
|
||||
#include "Console.h"
|
||||
#include "Strings.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef vt100__h
|
||||
#define vt100__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#define LARGE
|
||||
#include "SYSTEM.h"
|
||||
|
||||
|
|
@ -14,6 +14,6 @@ export void *Configuration__init(void)
|
|||
__DEFMOD;
|
||||
__REGMOD("Configuration", 0);
|
||||
/* BEGIN */
|
||||
__MOVE("1.95 [2016/07/19] for gcc LP64 on cygwin", Configuration_versionLong, 41);
|
||||
__MOVE("1.95 [2016/07/21] for gcc LP64 on cygwin", Configuration_versionLong, 41);
|
||||
__ENDMOD;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Configuration__h
|
||||
#define Configuration__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#define LARGE
|
||||
#include "SYSTEM.h"
|
||||
#include "Platform.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Console__h
|
||||
#define Console__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */
|
||||
#define LARGE
|
||||
#include "SYSTEM.h"
|
||||
#include "Configuration.h"
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
#include "Strings.h"
|
||||
|
||||
typedef
|
||||
struct Files_Handle *Files_File;
|
||||
struct Files_FileDesc *Files_File;
|
||||
|
||||
typedef
|
||||
struct Files_BufDesc {
|
||||
|
|
@ -25,14 +25,15 @@ typedef
|
|||
CHAR Files_FileName[101];
|
||||
|
||||
typedef
|
||||
struct Files_Handle {
|
||||
struct Files_FileDesc {
|
||||
Files_FileName workName, registerName;
|
||||
BOOLEAN tempFile;
|
||||
Platform_FileIdentity identity;
|
||||
LONGINT fd, len, pos;
|
||||
Files_Buffer bufs[4];
|
||||
INTEGER swapper, state;
|
||||
} Files_Handle;
|
||||
Files_File next;
|
||||
} Files_FileDesc;
|
||||
|
||||
typedef
|
||||
struct Files_Rider {
|
||||
|
|
@ -43,7 +44,7 @@ typedef
|
|||
} Files_Rider;
|
||||
|
||||
|
||||
static LONGINT Files_fileTab[256];
|
||||
static Files_File Files_files;
|
||||
static INTEGER Files_tempno;
|
||||
static CHAR Files_HOME[1024];
|
||||
static struct {
|
||||
|
|
@ -51,7 +52,7 @@ static struct {
|
|||
CHAR data[1];
|
||||
} *Files_SearchPath;
|
||||
|
||||
export LONGINT *Files_Handle__typ;
|
||||
export LONGINT *Files_FileDesc__typ;
|
||||
export LONGINT *Files_BufDesc__typ;
|
||||
export LONGINT *Files_Rider__typ;
|
||||
|
||||
|
|
@ -59,6 +60,7 @@ export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ);
|
|||
static Files_File Files_CacheEntry (Platform_FileIdentity identity);
|
||||
export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res);
|
||||
export void Files_Close (Files_File f);
|
||||
static void Files_CloseOSFile (Files_File f);
|
||||
static void Files_Create (Files_File f);
|
||||
export void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res);
|
||||
static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode);
|
||||
|
|
@ -69,7 +71,6 @@ export void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d);
|
|||
export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len);
|
||||
static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len);
|
||||
static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len);
|
||||
static void Files_Init (void);
|
||||
export LONGINT Files_Length (Files_File f);
|
||||
static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len);
|
||||
export Files_File Files_New (CHAR *name, LONGINT name__len);
|
||||
|
|
@ -226,26 +227,14 @@ static void Files_Create (Files_File f)
|
|||
error = Platform_Unlink((void*)f->workName, ((LONGINT)(101)));
|
||||
error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd);
|
||||
done = error == 0;
|
||||
if ((!done && Platform_TooManyFiles(error)) || (done && f->fd >= 256)) {
|
||||
if ((done && f->fd >= 256)) {
|
||||
error = Platform_Close(f->fd);
|
||||
}
|
||||
Heap_GC(1);
|
||||
error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd);
|
||||
done = f->fd == 0;
|
||||
}
|
||||
if (done) {
|
||||
if (f->fd >= 256) {
|
||||
error = Platform_Close(f->fd);
|
||||
Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0);
|
||||
} else {
|
||||
Files_fileTab[f->fd] = (LONGINT)(uintptr_t)f;
|
||||
f->next = Files_files;
|
||||
Files_files = f;
|
||||
Heap_FileCount += 1;
|
||||
Heap_RegisterFinalizer((void*)f, Files_Finalize);
|
||||
f->state = 0;
|
||||
f->pos = 0;
|
||||
error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ);
|
||||
}
|
||||
} else {
|
||||
if (Platform_NoSuchDirectory(error)) {
|
||||
__MOVE("no such directory", err, 18);
|
||||
|
|
@ -282,6 +271,27 @@ static void Files_Flush (Files_Buffer buf)
|
|||
}
|
||||
}
|
||||
|
||||
static void Files_CloseOSFile (Files_File f)
|
||||
{
|
||||
Files_File prev = NIL;
|
||||
INTEGER error;
|
||||
if (Files_files == f) {
|
||||
Files_files = f->next;
|
||||
} else {
|
||||
prev = Files_files;
|
||||
while ((prev != NIL && prev->next != f)) {
|
||||
prev = prev->next;
|
||||
}
|
||||
if (prev->next != NIL) {
|
||||
prev->next = f->next;
|
||||
}
|
||||
}
|
||||
error = Platform_Close(f->fd);
|
||||
f->fd = -1;
|
||||
f->state = 1;
|
||||
Heap_FileCount -= 1;
|
||||
}
|
||||
|
||||
void Files_Close (Files_File f)
|
||||
{
|
||||
LONGINT i;
|
||||
|
|
@ -297,11 +307,7 @@ void Files_Close (Files_File f)
|
|||
if (error != 0) {
|
||||
Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error);
|
||||
}
|
||||
Files_fileTab[f->fd] = 0;
|
||||
error = Platform_Close(f->fd);
|
||||
f->fd = -1;
|
||||
f->state = 1;
|
||||
Heap_FileCount -= 1;
|
||||
Files_CloseOSFile(f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -317,7 +323,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len)
|
|||
Files_File _o_result;
|
||||
Files_File f = NIL;
|
||||
__DUP(name, name__len, CHAR);
|
||||
__NEW(f, Files_Handle);
|
||||
__NEW(f, Files_FileDesc);
|
||||
f->workName[0] = 0x00;
|
||||
__COPY(name, f->registerName, ((LONGINT)(101)));
|
||||
f->fd = -1;
|
||||
|
|
@ -393,10 +399,9 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity)
|
|||
Files_File _o_result;
|
||||
Files_File f = NIL;
|
||||
INTEGER i, error;
|
||||
i = 0;
|
||||
while (i < 256) {
|
||||
f = (Files_File)(uintptr_t)Files_fileTab[i];
|
||||
if ((f != NIL && Platform_SameFile(identity, f->identity))) {
|
||||
f = Files_files;
|
||||
while (f != NIL) {
|
||||
if (Platform_SameFile(identity, f->identity)) {
|
||||
if (!Platform_SameFileTime(identity, f->identity)) {
|
||||
i = 0;
|
||||
while (i < 4) {
|
||||
|
|
@ -413,7 +418,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity)
|
|||
_o_result = f;
|
||||
return _o_result;
|
||||
}
|
||||
i += 1;
|
||||
f = f->next;
|
||||
}
|
||||
_o_result = NIL;
|
||||
return _o_result;
|
||||
|
|
@ -441,19 +446,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
|
|||
Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256)));
|
||||
}
|
||||
for (;;) {
|
||||
error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd);
|
||||
done = error == 0;
|
||||
if ((!done && Platform_TooManyFiles(error)) || (done && fd >= 256)) {
|
||||
if ((done && fd >= 256)) {
|
||||
error = Platform_Close(fd);
|
||||
}
|
||||
Heap_GC(1);
|
||||
error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd);
|
||||
done = error == 0;
|
||||
if ((!done && Platform_TooManyFiles(error))) {
|
||||
Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error);
|
||||
}
|
||||
}
|
||||
if ((!done && Platform_Inaccessible(error))) {
|
||||
error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd);
|
||||
done = error == 0;
|
||||
|
|
@ -469,17 +466,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
|
|||
error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ);
|
||||
f = Files_CacheEntry(identity);
|
||||
if (f != NIL) {
|
||||
error = Platform_Close(fd);
|
||||
_o_result = f;
|
||||
__DEL(name);
|
||||
return _o_result;
|
||||
} else if (fd >= 256) {
|
||||
error = Platform_Close(fd);
|
||||
Files_Err((CHAR*)"too many files open", (LONGINT)20, f, 0);
|
||||
} else {
|
||||
__NEW(f, Files_Handle);
|
||||
Files_fileTab[fd] = (LONGINT)(uintptr_t)f;
|
||||
Heap_FileCount += 1;
|
||||
__NEW(f, Files_FileDesc);
|
||||
Heap_RegisterFinalizer((void*)f, Files_Finalize);
|
||||
f->fd = fd;
|
||||
f->state = 0;
|
||||
|
|
@ -490,6 +481,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
|
|||
f->registerName[0] = 0x00;
|
||||
f->tempFile = 0;
|
||||
f->identity = identity;
|
||||
f->next = Files_files;
|
||||
Files_files = f;
|
||||
Heap_FileCount += 1;
|
||||
_o_result = f;
|
||||
__DEL(name);
|
||||
return _o_result;
|
||||
|
|
@ -1015,10 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o)
|
|||
LONGINT res;
|
||||
f = (Files_File)(uintptr_t)o;
|
||||
if (f->fd >= 0) {
|
||||
Files_fileTab[f->fd] = 0;
|
||||
res = Platform_Close(f->fd);
|
||||
f->fd = -1;
|
||||
Heap_FileCount -= 1;
|
||||
Files_CloseOSFile(f);
|
||||
if (f->tempFile) {
|
||||
res = Platform_Unlink((void*)f->workName, ((LONGINT)(101)));
|
||||
}
|
||||
|
|
@ -1037,27 +1028,13 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len)
|
|||
__DEL(path);
|
||||
}
|
||||
|
||||
static void Files_Init (void)
|
||||
{
|
||||
LONGINT i;
|
||||
i = 0;
|
||||
while (i < 256) {
|
||||
Files_fileTab[i] = 0;
|
||||
i += 1;
|
||||
}
|
||||
Files_tempno = -1;
|
||||
Heap_FileCount = 0;
|
||||
Files_SearchPath = NIL;
|
||||
Files_HOME[0] = 0x00;
|
||||
Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024)));
|
||||
}
|
||||
|
||||
static void EnumPtrs(void (*P)(void*))
|
||||
{
|
||||
P(Files_files);
|
||||
P(Files_SearchPath);
|
||||
}
|
||||
|
||||
__TDESC(Files_Handle, 1, 4) = {__TDFLDS("Handle", 296), {256, 264, 272, 280, -40}};
|
||||
__TDESC(Files_FileDesc, 1, 5) = {__TDFLDS("FileDesc", 304), {256, 264, 272, 280, 296, -48}};
|
||||
__TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4128), {0, -16}};
|
||||
__TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 40), {16, -16}};
|
||||
|
||||
|
|
@ -1070,10 +1047,13 @@ export void *Files__init(void)
|
|||
__MODULE_IMPORT(Platform);
|
||||
__MODULE_IMPORT(Strings);
|
||||
__REGMOD("Files", EnumPtrs);
|
||||
__INITYP(Files_Handle, Files_Handle, 0);
|
||||
__INITYP(Files_FileDesc, Files_FileDesc, 0);
|
||||
__INITYP(Files_BufDesc, Files_BufDesc, 0);
|
||||
__INITYP(Files_Rider, Files_Rider, 0);
|
||||
/* BEGIN */
|
||||
Files_Init();
|
||||
Files_tempno = -1;
|
||||
Heap_FileCount = 0;
|
||||
Files_HOME[0] = 0x00;
|
||||
Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024)));
|
||||
__ENDMOD;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */
|
||||
|
||||
#ifndef Files__h
|
||||
#define Files__h
|
||||
|
|
@ -7,14 +7,14 @@
|
|||
#include "SYSTEM.h"
|
||||
|
||||
typedef
|
||||
struct Files_Handle *Files_File;
|
||||
struct Files_FileDesc *Files_File;
|
||||
|
||||
typedef
|
||||
struct Files_Handle {
|
||||
struct Files_FileDesc {
|
||||
char _prvt0[232];
|
||||
LONGINT fd;
|
||||
char _prvt1[56];
|
||||
} Files_Handle;
|
||||
char _prvt1[64];
|
||||
} Files_FileDesc;
|
||||
|
||||
typedef
|
||||
struct Files_Rider {
|
||||
|
|
@ -25,7 +25,7 @@ typedef
|
|||
|
||||
|
||||
|
||||
import LONGINT *Files_Handle__typ;
|
||||
import LONGINT *Files_FileDesc__typ;
|
||||
import LONGINT *Files_Rider__typ;
|
||||
|
||||
import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */
|
||||
#define LARGE
|
||||
#include "SYSTEM.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tskSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tskSfF */
|
||||
|
||||
#ifndef Heap__h
|
||||
#define Heap__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#define LARGE
|
||||
#include "SYSTEM.h"
|
||||
#include "Console.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Modules__h
|
||||
#define Modules__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#define LARGE
|
||||
#include "SYSTEM.h"
|
||||
#include "OPM.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef OPB__h
|
||||
#define OPB__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#define LARGE
|
||||
#include "SYSTEM.h"
|
||||
#include "Configuration.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef OPC__h
|
||||
#define OPC__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#define LARGE
|
||||
#include "SYSTEM.h"
|
||||
#include "Configuration.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef OPM__h
|
||||
#define OPM__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#define LARGE
|
||||
#include "SYSTEM.h"
|
||||
#include "OPB.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef OPP__h
|
||||
#define OPP__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */
|
||||
#define LARGE
|
||||
#include "SYSTEM.h"
|
||||
#include "OPM.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin tspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin tspkaSfF */
|
||||
|
||||
#ifndef OPS__h
|
||||
#define OPS__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
#define LARGE
|
||||
#include "SYSTEM.h"
|
||||
#include "OPM.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/07/19] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/07/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef OPT__h
|
||||
#define OPT__h
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue