diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 8efb373c..867c33a4 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -48,6 +48,7 @@ typedef } Files_Rider; +export INT16 Files_MaxPathLength, Files_MaxNameLength; static Files_FileDesc *Files_files; static INT16 Files_tempno; static CHAR Files_HOME[1024]; @@ -1082,5 +1083,7 @@ export void *Files__init(void) Heap_FileCount = 0; Files_HOME[0] = 0x00; Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); + Files_MaxPathLength = Platform_MaxPathLength(); + Files_MaxNameLength = Platform_MaxNameLength(); __ENDMOD; } diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index a0bced1c..f0e783a2 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -22,6 +22,7 @@ typedef } Files_Rider; +import INT16 Files_MaxPathLength, Files_MaxNameLength; import ADDRESS *Files_FileDesc__typ; import ADDRESS *Files_Rider__typ; diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index b5bf3da8..5e716822 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -42,6 +42,8 @@ export BOOLEAN Platform_Inaccessible (INT16 e); export BOOLEAN Platform_Interrupted (INT16 e); export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +export INT16 Platform_MaxNameLength (void); +export INT16 Platform_MaxPathLength (void); export INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); export INT32 Platform_OSAllocate (INT32 size); @@ -79,6 +81,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS #include #include #include +#include #include #include #define Platform_EACCES() EACCES @@ -94,6 +97,8 @@ export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS #define Platform_EROFS() EROFS #define Platform_ETIMEDOUT() ETIMEDOUT #define Platform_EXDEV() EXDEV +#define Platform_NAMEMAX() NAME_MAX +#define Platform_PATHMAX() PATH_MAX #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) @@ -178,6 +183,16 @@ BOOLEAN Platform_Interrupted (INT16 e) return e == Platform_EINTR(); } +INT16 Platform_MaxNameLength (void) +{ + return Platform_NAMEMAX(); +} + +INT16 Platform_MaxPathLength (void) +{ + return Platform_PATHMAX(); +} + INT32 Platform_OSAllocate (INT32 size) { return Platform_allocate(size); @@ -189,13 +204,13 @@ void Platform_OSFree (INT32 address) } typedef - CHAR (*EnvPtr__78)[1024]; + CHAR (*EnvPtr__83)[1024]; BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { - EnvPtr__78 p = NIL; + EnvPtr__83 p = NIL; __DUP(var, var__len, CHAR); - p = (EnvPtr__78)(ADDRESS)Platform_getenv(var, var__len); + p = (EnvPtr__83)(ADDRESS)Platform_getenv(var, var__len); if (p != NIL) { __COPY(*p, val, val__len); } diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 6c2d79c8..3c3d06cb 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -40,6 +40,8 @@ import BOOLEAN Platform_Inaccessible (INT16 e); import BOOLEAN Platform_Interrupted (INT16 e); import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +import INT16 Platform_MaxNameLength (void); +import INT16 Platform_MaxPathLength (void); import INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); import INT32 Platform_OSAllocate (INT32 size); diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 8efb373c..867c33a4 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -48,6 +48,7 @@ typedef } Files_Rider; +export INT16 Files_MaxPathLength, Files_MaxNameLength; static Files_FileDesc *Files_files; static INT16 Files_tempno; static CHAR Files_HOME[1024]; @@ -1082,5 +1083,7 @@ export void *Files__init(void) Heap_FileCount = 0; Files_HOME[0] = 0x00; Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); + Files_MaxPathLength = Platform_MaxPathLength(); + Files_MaxNameLength = Platform_MaxNameLength(); __ENDMOD; } diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index a0bced1c..f0e783a2 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -22,6 +22,7 @@ typedef } Files_Rider; +import INT16 Files_MaxPathLength, Files_MaxNameLength; import ADDRESS *Files_FileDesc__typ; import ADDRESS *Files_Rider__typ; diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index b5bf3da8..5e716822 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -42,6 +42,8 @@ export BOOLEAN Platform_Inaccessible (INT16 e); export BOOLEAN Platform_Interrupted (INT16 e); export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +export INT16 Platform_MaxNameLength (void); +export INT16 Platform_MaxPathLength (void); export INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); export INT32 Platform_OSAllocate (INT32 size); @@ -79,6 +81,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS #include #include #include +#include #include #include #define Platform_EACCES() EACCES @@ -94,6 +97,8 @@ export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS #define Platform_EROFS() EROFS #define Platform_ETIMEDOUT() ETIMEDOUT #define Platform_EXDEV() EXDEV +#define Platform_NAMEMAX() NAME_MAX +#define Platform_PATHMAX() PATH_MAX #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) @@ -178,6 +183,16 @@ BOOLEAN Platform_Interrupted (INT16 e) return e == Platform_EINTR(); } +INT16 Platform_MaxNameLength (void) +{ + return Platform_NAMEMAX(); +} + +INT16 Platform_MaxPathLength (void) +{ + return Platform_PATHMAX(); +} + INT32 Platform_OSAllocate (INT32 size) { return Platform_allocate(size); @@ -189,13 +204,13 @@ void Platform_OSFree (INT32 address) } typedef - CHAR (*EnvPtr__78)[1024]; + CHAR (*EnvPtr__83)[1024]; BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { - EnvPtr__78 p = NIL; + EnvPtr__83 p = NIL; __DUP(var, var__len, CHAR); - p = (EnvPtr__78)(ADDRESS)Platform_getenv(var, var__len); + p = (EnvPtr__83)(ADDRESS)Platform_getenv(var, var__len); if (p != NIL) { __COPY(*p, val, val__len); } diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 6c2d79c8..3c3d06cb 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -40,6 +40,8 @@ import BOOLEAN Platform_Inaccessible (INT16 e); import BOOLEAN Platform_Interrupted (INT16 e); import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +import INT16 Platform_MaxNameLength (void); +import INT16 Platform_MaxPathLength (void); import INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); import INT32 Platform_OSAllocate (INT32 size); diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index e30bbdb0..dd5e8a22 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -48,6 +48,7 @@ typedef } Files_Rider; +export INT16 Files_MaxPathLength, Files_MaxNameLength; static Files_FileDesc *Files_files; static INT16 Files_tempno; static CHAR Files_HOME[1024]; @@ -1082,5 +1083,7 @@ export void *Files__init(void) Heap_FileCount = 0; Files_HOME[0] = 0x00; Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); + Files_MaxPathLength = Platform_MaxPathLength(); + Files_MaxNameLength = Platform_MaxNameLength(); __ENDMOD; } diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 9d81c004..f74b89a5 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -23,6 +23,7 @@ typedef } Files_Rider; +import INT16 Files_MaxPathLength, Files_MaxNameLength; import ADDRESS *Files_FileDesc__typ; import ADDRESS *Files_Rider__typ; diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index fa174db0..e578c349 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -42,6 +42,8 @@ export BOOLEAN Platform_Inaccessible (INT16 e); export BOOLEAN Platform_Interrupted (INT16 e); export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +export INT16 Platform_MaxNameLength (void); +export INT16 Platform_MaxPathLength (void); export INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); export INT64 Platform_OSAllocate (INT64 size); @@ -79,6 +81,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS #include #include #include +#include #include #include #define Platform_EACCES() EACCES @@ -94,6 +97,8 @@ export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS #define Platform_EROFS() EROFS #define Platform_ETIMEDOUT() ETIMEDOUT #define Platform_EXDEV() EXDEV +#define Platform_NAMEMAX() NAME_MAX +#define Platform_PATHMAX() PATH_MAX #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) @@ -178,6 +183,16 @@ BOOLEAN Platform_Interrupted (INT16 e) return e == Platform_EINTR(); } +INT16 Platform_MaxNameLength (void) +{ + return Platform_NAMEMAX(); +} + +INT16 Platform_MaxPathLength (void) +{ + return Platform_PATHMAX(); +} + INT64 Platform_OSAllocate (INT64 size) { return Platform_allocate(size); @@ -189,13 +204,13 @@ void Platform_OSFree (INT64 address) } typedef - CHAR (*EnvPtr__78)[1024]; + CHAR (*EnvPtr__83)[1024]; BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { - EnvPtr__78 p = NIL; + EnvPtr__83 p = NIL; __DUP(var, var__len, CHAR); - p = (EnvPtr__78)(ADDRESS)Platform_getenv(var, var__len); + p = (EnvPtr__83)(ADDRESS)Platform_getenv(var, var__len); if (p != NIL) { __COPY(*p, val, val__len); } diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 085c2257..fefe3da8 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -40,6 +40,8 @@ import BOOLEAN Platform_Inaccessible (INT16 e); import BOOLEAN Platform_Interrupted (INT16 e); import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +import INT16 Platform_MaxNameLength (void); +import INT16 Platform_MaxPathLength (void); import INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); import INT64 Platform_OSAllocate (INT64 size); diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index f5bfa63b..b6b62f3c 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -48,6 +48,7 @@ typedef } Files_Rider; +export INT16 Files_MaxPathLength, Files_MaxNameLength; static Files_FileDesc *Files_files; static INT16 Files_tempno; static CHAR Files_HOME[1024]; @@ -1082,5 +1083,7 @@ export void *Files__init(void) Heap_FileCount = 0; Files_HOME[0] = 0x00; Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); + Files_MaxPathLength = Platform_MaxPathLength(); + Files_MaxNameLength = Platform_MaxNameLength(); __ENDMOD; } diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 61cad689..2e6b98b9 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -22,6 +22,7 @@ typedef } Files_Rider; +import INT16 Files_MaxPathLength, Files_MaxNameLength; import ADDRESS *Files_FileDesc__typ; import ADDRESS *Files_Rider__typ; diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 62920520..9e7d70ee 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -44,6 +44,8 @@ export BOOLEAN Platform_Inaccessible (INT16 e); export BOOLEAN Platform_Interrupted (INT16 e); export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +export INT16 Platform_MaxNameLength (void); +export INT16 Platform_MaxPathLength (void); export INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); export INT32 Platform_OSAllocate (INT32 size); @@ -88,6 +90,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS #define Platform_ETIMEDOUT() WSAETIMEDOUT #define Platform_GetConsoleMode(h, m) GetConsoleMode((HANDLE)h, (DWORD*)m) #define Platform_GetTickCount() (LONGINT)(UINT32)GetTickCount() +#define Platform_MAXPATH() MAX_PATH #define Platform_SetConsoleMode(h, m) SetConsoleMode((HANDLE)h, (DWORD)m) #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h) @@ -191,6 +194,16 @@ BOOLEAN Platform_Interrupted (INT16 e) return e == Platform_EINTR(); } +INT16 Platform_MaxNameLength (void) +{ + return Platform_MAXPATH(); +} + +INT16 Platform_MaxPathLength (void) +{ + return Platform_MAXPATH(); +} + INT32 Platform_OSAllocate (INT32 size) { return Platform_allocate(size); diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index c447f2ba..9c125f90 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -41,6 +41,8 @@ import BOOLEAN Platform_Inaccessible (INT16 e); import BOOLEAN Platform_Interrupted (INT16 e); import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +import INT16 Platform_MaxNameLength (void); +import INT16 Platform_MaxPathLength (void); import INT16 Platform_New (CHAR *n, ADDRESS n__len, INT32 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); import INT32 Platform_OSAllocate (INT32 size); diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index d7a1a3e1..c473c7b3 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -49,6 +49,7 @@ typedef } Files_Rider; +export INT16 Files_MaxPathLength, Files_MaxNameLength; static Files_FileDesc *Files_files; static INT16 Files_tempno; static CHAR Files_HOME[1024]; @@ -1084,5 +1085,7 @@ export void *Files__init(void) Heap_FileCount = 0; Files_HOME[0] = 0x00; Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); + Files_MaxPathLength = Platform_MaxPathLength(); + Files_MaxNameLength = Platform_MaxNameLength(); __ENDMOD; } diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 658429ef..032d28c2 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -23,6 +23,7 @@ typedef } Files_Rider; +import INT16 Files_MaxPathLength, Files_MaxNameLength; import ADDRESS *Files_FileDesc__typ; import ADDRESS *Files_Rider__typ; diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 9f789ece..6f55e803 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -44,6 +44,8 @@ export BOOLEAN Platform_Inaccessible (INT16 e); export BOOLEAN Platform_Interrupted (INT16 e); export BOOLEAN Platform_IsConsole (INT64 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +export INT16 Platform_MaxNameLength (void); +export INT16 Platform_MaxPathLength (void); export INT16 Platform_New (CHAR *n, ADDRESS n__len, INT64 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); export INT64 Platform_OSAllocate (INT64 size); @@ -88,6 +90,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS #define Platform_ETIMEDOUT() WSAETIMEDOUT #define Platform_GetConsoleMode(h, m) GetConsoleMode((HANDLE)h, (DWORD*)m) #define Platform_GetTickCount() (LONGINT)(UINT32)GetTickCount() +#define Platform_MAXPATH() MAX_PATH #define Platform_SetConsoleMode(h, m) SetConsoleMode((HANDLE)h, (DWORD)m) #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h) @@ -191,6 +194,16 @@ BOOLEAN Platform_Interrupted (INT16 e) return e == Platform_EINTR(); } +INT16 Platform_MaxNameLength (void) +{ + return Platform_MAXPATH(); +} + +INT16 Platform_MaxPathLength (void) +{ + return Platform_MAXPATH(); +} + INT64 Platform_OSAllocate (INT64 size) { return Platform_allocate(size); diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index ee812dcd..ba866b78 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -41,6 +41,8 @@ import BOOLEAN Platform_Inaccessible (INT16 e); import BOOLEAN Platform_Interrupted (INT16 e); import BOOLEAN Platform_IsConsole (INT64 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +import INT16 Platform_MaxNameLength (void); +import INT16 Platform_MaxPathLength (void); import INT16 Platform_New (CHAR *n, ADDRESS n__len, INT64 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); import INT64 Platform_OSAllocate (INT64 size);