+FILE *fileTable_createFile (fileTable ft, cstring fname)
+{
+# if defined (WIN32) && !defined (BCC32)
+ int fdesc = _open (cstring_toCharsSafe (fname),
+ O_WRONLY | O_CREAT | O_TRUNC | O_EXCL,
+ _S_IWRITE | S_IREAD);
+# else
+ int fdesc = open (cstring_toCharsSafe (fname),
+ O_WRONLY | O_CREAT | O_TRUNC | O_EXCL,
+ S_IRUSR | S_IWUSR);
+# endif
+
+ if (fdesc == -1)
+ {
+ osd_setTempError ();
+ llfatalerror (message ("Temporary file for "
+ "pre-processor output already exists. Trying to "
+ "open: %s.",
+ fname));
+
+ /*@notreached@*/ return NULL;
+ }
+ else
+ {
+ FILE *res = fdopen (fdesc, "w");
+
+ if (res != NULL)
+ {
+ fileTable_addOpen (ft, res, cstring_copy (fname));
+ DPRINTF (("Opening file: %s / %p", fname, res));
+ }
+ else
+ {
+ DPRINTF (("Error opening: %s", fname));
+ }
+
+ return res;
+ }
+}
+
+FILE *fileTable_createMacrosFile (fileTable ft, cstring fname)
+{
+# if defined (WIN32) && !defined (BCC32)
+ int fdesc = _open (cstring_toCharsSafe (fname),
+ O_RDWR | O_CREAT | O_TRUNC | O_EXCL,
+ _S_IREAD | _S_IWRITE);
+# else
+ int fdesc = open (cstring_toCharsSafe (fname),
+ O_RDWR | O_CREAT | O_TRUNC | O_EXCL,
+ S_IRUSR | S_IWUSR);
+# endif
+
+ if (fdesc == -1)
+ {
+ osd_setTempError ();
+ llfatalerror (message ("Temporary file for "
+ "pre-processor output already exists. Trying to "
+ "open: %s.",
+ fname));
+
+ /*@notreached@*/ return NULL;
+ }
+ else
+ {
+ FILE *res = fdopen (fdesc, "w+");
+
+ if (res != NULL)
+ {
+ fileTable_addOpen (ft, res, cstring_copy (fname));
+ DPRINTF (("Opening file: %s / %p", fname, res));
+ }
+ else
+ {
+ DPRINTF (("Error opening: %s", fname));
+ }
+
+ return res;
+ }
+}
+
+FILE *fileTable_openReadFile (fileTable ft, cstring fname)