From cca0366c8fb08660478651c636e6942a4a76d7a3 Mon Sep 17 00:00:00 2001
From: Graham Nelson A version of our operating system interface suitable for POSIX-compliant operating systems. §1. The C standard library leaves many questions unanswered about how to deal
with the host operating system: for example, it knows very little about
@@ -259,25 +259,12 @@ string.
§12. Snprintf. The C standard library function snprintf is not as standard as one might
-like, and is oddly represented in some Cygwin libraries for Windows,
-sometimes being differently named.
- We would like to provide a wrapper function but this is troublesome with
-variadic arguments, so instead here is a macro for the function name.
-Happily, the Inform tools make very little use of this.
- §13. In MacOS 10.5, a new implementation of the C standard library
+ §12. In MacOS 10.5, a new implementation of the C standard library
crippled performance of system() by placing it behind a global mutex, so
that it was impossible for two cores to be calling the function at the same
time. The net effect of this is that the Inform test suite, executing in
@@ -304,7 +291,7 @@ memory space. Using posix_spa
extern char **environ;
-int Platform::system(const char *cmd) {
+int Platform::system(const char *cmd) {
char *argv[] = {"sh", "-c", (char *) cmd, NULL};
pid_t pid;
int status = posix_spawn(&pid, "/bin/sh", NULL, NULL, argv, environ);
@@ -318,11 +305,11 @@ memory space. Using posix_spa
return -1;
}
- §15. Timestamp and file size. There are implementations of the C standard library where time_t has
+ §14. Timestamp and file size. There are implementations of the C standard library where time_t has
super-weird behaviour, but on almost all POSIX systems, time 0 corresponds to
midnight on 1 January 1970. All we really need is that the "never" value
is one which is earlier than any possible timestamp on the files we'll
@@ -364,24 +351,24 @@ be dealing with.
§16. Sync. Both names here are of directories which do exist. The function makes
+ §15. Sync. Both names here are of directories which do exist. The function makes
the dest tree an exact copy of the source tree (and therefore deletes
anything different which was originally in dest).
§18. Notifications. The "submarine" sound is a gloomy thunk; the "bell" is the three-tone rising
+ §17. Notifications. The "submarine" sound is a gloomy thunk; the "bell" is the three-tone rising
alert noise which iPhones make when they receive texts, but which hackers of a
certain age will remember as the "I have ripped your music CD now" alert from
SoundJam, the program which Apple bought and rebranded as iTunes. Apple now
@@ -434,7 +421,7 @@ actually running a one-line AppleScript here.
§20. Terminal setup. The idea of this function is that if anything needs to be done to enable the
+ §19. Terminal setup. The idea of this function is that if anything needs to be done to enable the
output of ANSI-standard coloured terminal output, then this function has the
chance to do it; similarly, it may need to configure itself to receive console
output with the correct locale (calling Locales::get(CONSOLE_LOCALE) to
@@ -463,11 +450,11 @@ find this).
§21. Concurrency. The following abstracts the pthread library, so that it can all be done
+ §20. Concurrency. The following abstracts the pthread library, so that it can all be done
differently on Windows.
§23. This function returns the number of logical cores in the host computer —
+ §22. This function returns the number of logical cores in the host computer —
i.e., twice the number of physical cores if there's hyperthreading. The
result is used as a guess for an appropriate number of simultaneous threads
to launch.
@@ -515,27 +502,27 @@ MacOS does not support.
#include <sys/sysinfo.h>
§25. While MacOS lacks sysinfo.h, it does have sysctl.h:
+ §24. While MacOS lacks sysinfo.h, it does have sysctl.h:
§27. For Android it seems prudent simply to ignore multithreading:
+ §26. For Android it seems prudent simply to ignore multithreading:
A version of our operating system interface suitable for Microsoft Windows. §1. This Foundation module comes with two variant versions of the Platform::
section of code. The one you're reading compiles on Windows, and the other
@@ -156,20 +156,7 @@ just that installation and use of Foundation-built tools is less convenient.)
}
§7. Snprintf. The C standard library function snprintf is not as standard as one might
-like, and is oddly represented in some Cygwin libraries for Windows,
-sometimes being differently named.
- We would like to provide a wrapper function but this is troublesome with
-variadic arguments, so instead here is a macro for the function name.
-Happily, the Inform tools make very little use of this.
- §11. Sleep. The Windows Sleep call measures time in milliseconds, whereas
+ §10. Sleep. The Windows Sleep call measures time in milliseconds, whereas
POSIX sleep is for seconds.
§13. Terminal setup. The idea of this function is that if anything needs to be done to enable the
+ §12. Terminal setup. The idea of this function is that if anything needs to be done to enable the
output of ANSI-standard coloured terminal output, then this function has the
chance to do it; similarly, it may need to configure itself to receive console
output with the correct locale (calling Locales::get(CONSOLE_LOCALE) to
@@ -412,7 +399,7 @@ find this).
SetConsoleOutputCP(Win32_ConsoleOutCP);
}
-void Platform::configure_terminal(void) {
+void Platform::configure_terminal(void) {
HANDLE cons = GetStdHandle(STD_ERROR_HANDLE);
if (cons) {
if (GetConsoleMode(cons, &Win32_ConsoleMode)) {
@@ -434,11 +421,11 @@ find this).
if ((newCP != 0) && SetConsoleOutputCP(newCP))
Win32_ResetConsole |= WIN32CONS_RESET_OUTCP;
- if (Win32_ResetConsole != 0) atexit(Platform::Win32_ResetConsole);
+ if (Win32_ResetConsole != 0) atexit(Platform::Win32_ResetConsole);
}
§16. This function returns the number of logical cores in the host computer —
+ §15. This function returns the number of logical cores in the host computer —
i.e., twice the number of physical cores if there's hyperthreading. The
result is used as a guess for an appropriate number of simultaneous threads
to launch.
§17. Timestamp and file size. There are implementations of the C standard library where time_t has
+ §16. Timestamp and file size. There are implementations of the C standard library where time_t has
super-weird behaviour, but on almost all POSIX systems, time 0 corresponds to
midnight on 1 January 1970. All we really need is that the "never" value
is one which is earlier than any possible timestamp on the files we'll
@@ -513,24 +500,24 @@ be dealing with.
void Foundation::start(int argc, char **argv) {
CommandLine::set_locale(argc, argv);
- Platform::configure_terminal();
+ Platform::configure_terminal();
Memory::start();
Register the default stream writers8.1;
[[textliterals]];
diff --git a/docs/foundation-module/1-pp.html b/docs/foundation-module/1-pp.html
index e7068bd..e29db47 100644
--- a/docs/foundation-module/1-pp.html
+++ b/docs/foundation-module/1-pp.html
@@ -42,7 +42,7 @@
+
-int Platform::system(const char *cmd) {
+int Platform::system(const char *cmd) {
return system(cmd);
}
-
-define PLATFORM_SNPRINTF snprintf
-
-
-
+
-
+
+
-int Platform::mkdir(char *transcoded_pathname) {
+int Platform::mkdir(char *transcoded_pathname) {
errno = 0;
int rv = mkdir(transcoded_pathname, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
if (rv == 0) return TRUE;
@@ -330,12 +317,12 @@ memory space. Using posix_spa
return FALSE;
}
-void *Platform::opendir(char *dir_name) {
+void *Platform::opendir(char *dir_name) {
DIR *dirp = opendir(dir_name);
return (void *) dirp;
}
-int Platform::readdir(void *D, char *dir_name, char *leafname) {
+int Platform::readdir(void *D, char *dir_name, char *leafname) {
char path_to[2*MAX_FILENAME_LENGTH+2];
struct stat file_status;
int rv;
@@ -350,13 +337,13 @@ memory space. Using posix_spa
return TRUE;
}
-void Platform::closedir(void *D) {
+void Platform::closedir(void *D) {
DIR *dirp = (DIR *) D;
closedir(dirp);
}
-
-
+
-time_t Platform::never_time(void) {
+time_t Platform::never_time(void) {
return (time_t) 0;
}
-time_t Platform::timestamp(char *transcoded_filename) {
+time_t Platform::timestamp(char *transcoded_filename) {
struct stat filestat;
if (stat(transcoded_filename, &filestat) != -1) return filestat.st_mtime;
- return Platform::never_time();
+ return Platform::never_time();
}
-off_t Platform::size(char *transcoded_filename) {
+off_t Platform::size(char *transcoded_filename) {
struct stat filestat;
if (stat(transcoded_filename, &filestat) != -1) return filestat.st_size;
return (off_t) 0;
}
-
-
+
-
+
+
-void Platform::sleep(int seconds) {
+void Platform::sleep(int seconds) {
sleep((unsigned int) seconds);
}
-
-
+
-void Platform::notification(text_stream *text, int happy) {
+void Platform::notification(text_stream *text, int happy) {
char *sound_name = "Bell.aiff";
if (happy == FALSE) sound_name = "Submarine.aiff";
TEMPORARY_TEXT(TEMP)
@@ -444,15 +431,15 @@ actually running a one-line AppleScript here.
DISCARD_TEXT(TEMP)
}
-
-
+
+
-void Platform::notification(text_stream *text, int happy) {
+void Platform::notification(text_stream *text, int happy) {
}
-
-
+
-void Platform::configure_terminal(void) {
+void Platform::configure_terminal(void) {
}
-
-
+
-
+
-int Platform::create_thread(foundation_thread *pt,
+int Platform::create_thread(foundation_thread *pt,
const foundation_thread_attributes *pa, void *(*fn)(void *), void *arg) {
return pthread_create(pt, pa, fn, arg);
}
-int Platform::join_thread(foundation_thread pt, void** rv) {
+int Platform::join_thread(foundation_thread pt, void** rv) {
return pthread_join(pt, rv);
}
-void Platform::init_thread(foundation_thread_attributes *pa, size_t size) {
+void Platform::init_thread(foundation_thread_attributes *pa, size_t size) {
if (pthread_attr_init(pa) != 0) internal_error("thread initialisation failed");
if (pthread_attr_setstacksize(pa, size) != 0) internal_error("thread stack sizing failed");
}
-size_t Platform::get_thread_stack_size(foundation_thread_attributes *pa) {
+size_t Platform::get_thread_stack_size(foundation_thread_attributes *pa) {
size_t mystacksize;
pthread_attr_getstacksize(pa, &mystacksize);
return mystacksize;
}
-
-
+
-
+
-int Platform::get_core_count(void) {
+int Platform::get_core_count(void) {
int N = get_nprocs();
if (N < 1) return 1;
return N;
}
-
-
+
#include <sys/sysctl.h>
-
+
-int Platform::get_core_count(void) {
+int Platform::get_core_count(void) {
int N;
size_t N_size = sizeof(int);
sysctlbyname("hw.logicalcpu", &N, &N_size, NULL, 0);
@@ -543,17 +530,17 @@ MacOS does not support.
return N;
}
-
-
+
-int Platform::get_core_count(void) {
+int Platform::get_core_count(void) {
return 1;
}
-
-
+
+
define CREATE_MUTEX(name)
static pthread_mutex_t name = PTHREAD_MUTEX_INITIALIZER;
diff --git a/docs/foundation-module/1-wp.html b/docs/foundation-module/1-wp.html
index ee1512b..2826d78 100644
--- a/docs/foundation-module/1-wp.html
+++ b/docs/foundation-module/1-wp.html
@@ -50,7 +50,7 @@ function togglePopup(material_id) {
+
-define PLATFORM_SNPRINTF snprintf
-
-
-
+
Check the first element of the command: if it has path separators in
@@ -191,12 +178,12 @@ Happily, the Inform tools make very little use of this.
return 1;
}
-int Platform::system(const char *cmd) {
+int Platform::system(const char *cmd) {
char cmd_line[10*MAX_PATH];
Check if the command should be executed with the Windows cmd interpreter
or a Unix-like shell. */
- int unix = Platform::Win32_is_unix_cmd(cmd);
+ int unix = Platform::Win32_is_unix_cmd(cmd);
if (unix) {
For a Unix shell command, escape any double quotes and backslashes.
char *pcl;
@@ -243,10 +230,10 @@ Happily, the Inform tools make very little use of this.
}
-
+
-int Platform::mkdir(char *transcoded_pathname) {
+int Platform::mkdir(char *transcoded_pathname) {
errno = 0;
int rv = mkdir(transcoded_pathname);
if (rv == 0) return TRUE;
@@ -254,12 +241,12 @@ Happily, the Inform tools make very little use of this.
return FALSE;
}
-void *Platform::opendir(char *dir_name) {
+void *Platform::opendir(char *dir_name) {
DIR *dirp = opendir(dir_name);
return (void *) dirp;
}
-int Platform::readdir(void *D, char *dir_name,
+int Platform::readdir(void *D, char *dir_name,
char *leafname) {
char path_to[2*MAX_FILENAME_LENGTH+2];
struct _stat file_status;
@@ -276,13 +263,13 @@ Happily, the Inform tools make very little use of this.
return TRUE;
}
-void Platform::closedir(void *D) {
+void Platform::closedir(void *D) {
DIR *dirp = (DIR *) D;
closedir(dirp);
}
-
+
void Platform::path_add(const char* base, const char* add, char* path) {
@@ -295,20 +282,20 @@ Happily, the Inform tools make very little use of this.
strcat(path, add);
}
-void Platform::rsync(char *transcoded_source, char *transcoded_dest) {
+void Platform::rsync(char *transcoded_source, char *transcoded_dest) {
char srcPath[MAX_PATH], destPath[MAX_PATH];
WIN32_FIND_DATA findData = { 0 };
SHCreateDirectoryExA(0, transcoded_dest, NULL);
- Platform::path_add(transcoded_dest, "*", destPath);
+ Platform::path_add(transcoded_dest, "*", destPath);
HANDLE findHandle = FindFirstFileA(destPath, &findData);
if (findHandle != INVALID_HANDLE_VALUE) {
do {
if ((strcmp(findData.cFileName, ".") == 0) || (strcmp(findData.cFileName, "..") == 0))
continue;
- Platform::path_add(transcoded_source, findData.cFileName, srcPath);
+ Platform::path_add(transcoded_source, findData.cFileName, srcPath);
int remove = 1;
{
@@ -319,7 +306,7 @@ Happily, the Inform tools make very little use of this.
}
}
if (remove) {
- Platform::path_add(transcoded_dest, findData.cFileName, destPath);
+ Platform::path_add(transcoded_dest, findData.cFileName, destPath);
if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
SHFILEOPSTRUCTA oper = { 0 };
oper.wFunc = FO_DELETE;
@@ -334,19 +321,19 @@ Happily, the Inform tools make very little use of this.
FindClose(findHandle);
}
- Platform::path_add(transcoded_source, "*", srcPath);
+ Platform::path_add(transcoded_source, "*", srcPath);
findHandle = FindFirstFileA(srcPath, &findData);
if (findHandle != INVALID_HANDLE_VALUE) {
do {
if ((strcmp(findData.cFileName, ".") == 0) || (strcmp(findData.cFileName, "..") == 0))
continue;
- Platform::path_add(transcoded_source, findData.cFileName, srcPath);
- Platform::path_add(transcoded_dest, findData.cFileName, destPath);
+ Platform::path_add(transcoded_source, findData.cFileName, srcPath);
+ Platform::path_add(transcoded_dest, findData.cFileName, destPath);
if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
CreateDirectoryA(destPath, 0);
- Platform::rsync(srcPath, destPath);
+ Platform::rsync(srcPath, destPath);
} else {
int needCopy = 1;
{
@@ -371,24 +358,24 @@ Happily, the Inform tools make very little use of this.
}
-
-void Platform::sleep(int seconds) {
+void Platform::sleep(int seconds) {
Sleep((DWORD)(1000*seconds));
}
-
+
-void Platform::notification(text_stream *text, int happy) {
+void Platform::notification(text_stream *text, int happy) {
}
-
-
+
typedef HANDLE foundation_thread;
@@ -447,7 +434,7 @@ find this).
struct Win32_Thread_Start { void *(*fn)(void *); void* arg; };
-
+
DWORD WINAPI Platform::Win32_Thread_Func(LPVOID param) {
@@ -457,7 +444,7 @@ find this).
return 0;
}
-int Platform::create_thread(foundation_thread *pt, const foundation_thread_attributes *pa,
+int Platform::create_thread(foundation_thread *pt, const foundation_thread_attributes *pa,
void *(*fn)(void *), void *arg) {
struct Win32_Thread_Start* start = (struct Win32_Thread_Start*) malloc(sizeof (struct Win32_Thread_Start));
start->fn = fn;
@@ -472,26 +459,26 @@ find this).
}
}
-int Platform::join_thread(foundation_thread pt, void** rv) {
+int Platform::join_thread(foundation_thread pt, void** rv) {
return (WaitForSingleObject(pt, INFINITE) == WAIT_OBJECT_0) ? 0 : 1;
}
-void Platform::init_thread(foundation_thread_attributes* pa, size_t size) {
+void Platform::init_thread(foundation_thread_attributes* pa, size_t size) {
}
-size_t Platform::get_thread_stack_size(foundation_thread_attributes* pa) {
+size_t Platform::get_thread_stack_size(foundation_thread_attributes* pa) {
return 0;
}
-
-int Platform::get_core_count(void) {
+int Platform::get_core_count(void) {
int count = 0;
SYSTEM_INFO sysInfo;
GetSystemInfo(&sysInfo);
@@ -505,7 +492,7 @@ to launch.
}
-
-time_t Platform::never_time(void) {
+time_t Platform::never_time(void) {
return (time_t) 0;
}
-time_t Platform::timestamp(char *transcoded_filename) {
+time_t Platform::timestamp(char *transcoded_filename) {
struct stat filestat;
if (stat(transcoded_filename, &filestat) != -1) return filestat.st_mtime;
- return Platform::never_time();
+ return Platform::never_time();
}
-off_t Platform::size(char *transcoded_filename) {
+off_t Platform::size(char *transcoded_filename) {
struct stat filestat;
if (stat(transcoded_filename, &filestat) != -1) return filestat.st_size;
return (off_t) 0;
}
-
+
define CREATE_MUTEX(name)
static struct Win32_Mutex name = { INIT_ONCE_STATIC_INIT, { 0 }};
diff --git a/docs/foundation-module/2-lcl.html b/docs/foundation-module/2-lcl.html
index 40901a5..33497bb 100644
--- a/docs/foundation-module/2-lcl.html
+++ b/docs/foundation-module/2-lcl.html
@@ -81,7 +81,7 @@ operating system".
int locales_unset = TRUE;
int locale_settings[NO_DEFINED_LOCALE_VALUES];
-int Locales::get(int L) {
+int Locales::get(int L) {
if ((L < 0) || (L >= NO_DEFINED_LOCALE_VALUES)) Errors::fatal("locale out of range");
if (locales_unset) return Locales::platform_locale();
if (locale_settings[L] >= 0) return locale_settings[L];
diff --git a/docs/foundation-module/2-mmr.html b/docs/foundation-module/2-mmr.html
index 22a84a8..f1a7412 100644
--- a/docs/foundation-module/2-mmr.html
+++ b/docs/foundation-module/2-mmr.html
@@ -622,7 +622,7 @@ values of these functions are always non-
-void *Memory::calloc(int how_many, int size_in_bytes, int reason) {
+void *Memory::calloc(int how_many, int size_in_bytes, int reason) {
return Memory::alloc_inner(how_many, size_in_bytes, reason);
}
void *Memory::malloc(int size_in_bytes, int reason) {
@@ -699,7 +699,7 @@ rarely and to allocate large blocks of memory.
-void Memory::I7_free(void *pointer, int R, int bytes_freed) {
+void Memory::I7_free(void *pointer, int R, int bytes_freed) {
if ((R < 0) || (R >= NO_DEFINED_MREASON_VALUES)) internal_error("no such memory reason");
if (pointer == NULL) internal_error("can't free NULL memory");
LOCK_MUTEX(memory_statistics_mutex);
diff --git a/docs/foundation-module/2-wal.html b/docs/foundation-module/2-wal.html
index 9f85d73..6105d2d 100644
--- a/docs/foundation-module/2-wal.html
+++ b/docs/foundation-module/2-wal.html
@@ -312,14 +312,14 @@ file encodings, but expanding case 'c': case 'd': case 'i': case 'x': { char is promoted to int in variable arguments
int ival = va_arg(ap, int);
char temp[256];
- if (PLATFORM_SNPRINTF(temp, 255, format_string, ival) >= 255) strcpy(temp, "?");
+ if (snprintf(temp, 255, format_string, ival) >= 255) strcpy(temp, "?");
for (int j = 0; temp[j]; j++) Streams::putc(temp[j], stream);
break;
}
case 'g': {
double dval = va_arg(ap, double);
char temp[256];
- if (PLATFORM_SNPRINTF(temp, 255, format_string, dval) >= 255) strcpy(temp, "?");
+ if (snprintf(temp, 255, format_string, dval) >= 255) strcpy(temp, "?");
for (int j = 0; temp[j]; j++) Streams::putc(temp[j], stream);
break;
}
diff --git a/docs/foundation-module/3-drc.html b/docs/foundation-module/3-drc.html
index 189542a..4f30b2c 100644
--- a/docs/foundation-module/3-drc.html
+++ b/docs/foundation-module/3-drc.html
@@ -67,22 +67,27 @@ transcoded the other way.
-scan_directory *Directories::open(pathname *P) { +scan_directory *Directories::open_from(text_stream *name) { scan_directory *D = CREATE(scan_directory); - TEMPORARY_TEXT(pn) - WRITE_TO(pn, "%p", P); - Str::copy_to_locale_string(D->directory_name_written_out, pn, 4*MAX_FILENAME_LENGTH); - DISCARD_TEXT(pn) - D->directory_handle = Platform::opendir(D->directory_name_written_out); + Str::copy_to_locale_string(D->directory_name_written_out, name, 4*MAX_FILENAME_LENGTH); + D->directory_handle = Platform::opendir(D->directory_name_written_out); if (D->directory_handle == NULL) return NULL; return D; } -int Directories::next(scan_directory *D, text_stream *leafname) { +scan_directory *Directories::open(pathname *P) { + TEMPORARY_TEXT(pn) + WRITE_TO(pn, "%p", P); + scan_directory *D = Directories::open_from(pn); + DISCARD_TEXT(pn) + return D; +} + +int Directories::next(scan_directory *D, text_stream *leafname) { char leafname_Cs[MAX_FILENAME_LENGTH]; int rv = TRUE; while (rv) { - rv = Platform::readdir(D->directory_handle, D->directory_name_written_out, leafname_Cs); + rv = Platform::readdir(D->directory_handle, D->directory_name_written_out, leafname_Cs); if (leafname_Cs[0] != '.') break; } Str::clear(leafname); @@ -90,11 +95,23 @@ transcoded the other way. return rv; } -void Directories::close(scan_directory *D) { - Platform::closedir(D->directory_handle); +void Directories::close(scan_directory *D) { + Platform::closedir(D->directory_handle); }-
§3. It turns out to be useful to scan the contents of a directory in an order +
§3. Incredibly, this seems to be the most portable method for testing whether a +directory exists in the file system: +
+ ++int Directories::exists(pathname *P) { + scan_directory *TRY = Directories::open(P); + if (TRY == NULL) return FALSE; + Directories::close(TRY); + return TRUE; +} ++
§4. It turns out to be useful to scan the contents of a directory in an order which is predictable regardless of platform — Platform::readdir works in a different order on MacOS, Windows and Linux, even given the same directory of files to work on. So the following returns a linked list of the contents, @@ -129,7 +146,7 @@ directories holding upwards of 10,000 files or so, it'll be trivial. } Directories::close(D); } - qsort(listing_array, (size_t) used, sizeof(text_stream *), Directories::compare_names); + qsort(listing_array, (size_t) used, sizeof(text_stream *), Directories::compare_names); linked_list *L = NEW_LINKED_LIST(text_stream); for (int i=0; i<used; i++) ADD_TO_LINKED_LIST(listing_array[i], text_stream, L); Memory::I7_free(listing_array, ARRAY_SORTING_MREASON, capacity*((int) sizeof(text_stream *))); diff --git a/docs/foundation-module/3-fln.html b/docs/foundation-module/3-fln.html index 43e7f1c..2573c75 100644 --- a/docs/foundation-module/3-fln.html +++ b/docs/foundation-module/3-fln.html @@ -327,7 +327,7 @@ when printed out. TEMPORARY_TEXT(FN) WRITE_TO(FN, "%f", F); Str::copy_to_locale_string(transcoded_pathname, FN, 4*MAX_FILENAME_LENGTH); - time_t t = Platform::timestamp(transcoded_pathname); + time_t t = Platform::timestamp(transcoded_pathname); DISCARD_TEXT(FN) return t; } @@ -337,7 +337,7 @@ when printed out. TEMPORARY_TEXT(FN) WRITE_TO(FN, "%f", F); Str::copy_to_locale_string(transcoded_pathname, FN, 4*MAX_FILENAME_LENGTH); - int t = (int) Platform::size(transcoded_pathname); + int t = (int) Platform::size(transcoded_pathname); DISCARD_TEXT(FN) return t; } diff --git a/docs/foundation-module/3-pth.html b/docs/foundation-module/3-pth.html index f2efb87..392a423 100644 --- a/docs/foundation-module/3-pth.html +++ b/docs/foundation-module/3-pth.html @@ -317,7 +317,7 @@ on the file system with that path. WRITE_TO(pn, "%p", P); Str::copy_to_locale_string(transcoded_pathname, pn, 4*MAX_FILENAME_LENGTH); DISCARD_TEXT(pn) - P->known_to_exist = Platform::mkdir(transcoded_pathname); + P->known_to_exist = Platform::mkdir(transcoded_pathname); return P->known_to_exist; } @@ -338,7 +338,7 @@ anything different which was originally in WRITE_TO(pn2, "%p", dest); Str::copy_to_locale_string(transcoded_dest, pn2, 4*MAX_FILENAME_LENGTH); DISCARD_TEXT(pn2) - Platform::rsync(transcoded_source, transcoded_dest); + Platform::rsync(transcoded_source, transcoded_dest); }