diff options
-rw-r--r-- | Build/source/texk/web2c/lib/ChangeLog | 10 | ||||
-rw-r--r-- | Build/source/texk/web2c/lib/lib.h | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/lib/main.c | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/lib/openclose.c | 9 | ||||
-rw-r--r-- | Build/source/texk/web2c/lib/texmfmp.c | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/ptexdir/lib/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/ptexdir/lib/openclose.c | 31 |
7 files changed, 41 insertions, 29 deletions
diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog index 7f72c155f50..50d68cf357f 100644 --- a/Build/source/texk/web2c/lib/ChangeLog +++ b/Build/source/texk/web2c/lib/ChangeLog @@ -1,3 +1,13 @@ +2010-04-19 Peter Breitenlohner <peb@mppmu.mpg.de> + + * main.c, texmfmp.c: Remove extern declaration of mainbody, + is in lib.h. + * openclose.c (recorder_enabled, output_directory): Remove + extern declarations, are in lib.h. + * lib.h: Move extern declaration of fullnameoffile to here ... + * texmfmp.c: ... from here ... + * openclose.c: ... and from here. + 2010-04-18 Peter Breitenlohner <peb@mppmu.mpg.de> * texmfmp.c (maininit) [__SyncTeX__]: omit warning about no diff --git a/Build/source/texk/web2c/lib/lib.h b/Build/source/texk/web2c/lib/lib.h index a4ff3a7e8c4..26b0017978c 100644 --- a/Build/source/texk/web2c/lib/lib.h +++ b/Build/source/texk/web2c/lib/lib.h @@ -39,11 +39,13 @@ extern boolean open_input (FILE **, int, const_string fopen_mode); extern boolean open_output (FILE **, const_string fopen_mode); extern void close_file (FILE *); extern void recorder_change_filename (string); -extern boolean recorder_enabled; -extern string output_directory; extern void recorder_record_input (const_string); extern void recorder_record_output (const_string); +extern string fullnameoffile; +extern boolean recorder_enabled; +extern string output_directory; + /* printversion.c */ extern void printversionandexit (const_string, const_string, const_string, char*); diff --git a/Build/source/texk/web2c/lib/main.c b/Build/source/texk/web2c/lib/main.c index 23af7a4fd12..654491e6a07 100644 --- a/Build/source/texk/web2c/lib/main.c +++ b/Build/source/texk/web2c/lib/main.c @@ -8,8 +8,6 @@ char **argv; int argc; -extern void mainbody (void); - /* The entry point for all the programs except TeX and Metafont, which have more to do. We just have to set up the command line. web2c transforms Pascal's main block into a procedure `main_body'. */ diff --git a/Build/source/texk/web2c/lib/openclose.c b/Build/source/texk/web2c/lib/openclose.c index 4107ce70ca9..a753cceb8de 100644 --- a/Build/source/texk/web2c/lib/openclose.c +++ b/Build/source/texk/web2c/lib/openclose.c @@ -12,18 +12,15 @@ /* The globals we use to communicate. */ extern string nameoffile; extern unsigned namelength; -/* For "file:line:error style error messages. */ -extern string fullnameoffile; -/* For the filename recorder. */ -extern boolean recorder_enabled; -/* For the output-dir option. */ -extern string output_directory; /* Define some variables. */ +/* For "file:line:error" style error messages. */ string fullnameoffile; /* Defaults to NULL. */ static string recorder_name; /* Defaults to NULL. */ static FILE *recorder_file; /* Defaults to NULL. */ +/* For the filename recorder. */ boolean recorder_enabled; /* Defaults to false. */ +/* For the output-dir option. */ string output_directory; /* Defaults to NULL. */ /* For TeX and MetaPost. See below. Always defined so we don't have to diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c index d621c6db27a..ed624d134d7 100644 --- a/Build/source/texk/web2c/lib/texmfmp.c +++ b/Build/source/texk/web2c/lib/texmfmp.c @@ -516,9 +516,6 @@ MAYBE_STATIC const_string dump_name; /* The C version of the jobname, if given. */ MAYBE_STATIC const_string c_job_name; -/* Full source file name. */ -extern string fullnameoffile; - /* The filename for dynamic character translation, or NULL. */ string translate_filename; string default_translate_filename; @@ -533,9 +530,6 @@ static void parse_src_specials_option (const_string); #endif #endif -/* The main body of the WEB is transformed into this procedure. */ -extern TEXDLL void mainbody (void); - /* Parsing a first %&-line in the input file. */ static void parse_first_line (const_string); diff --git a/Build/source/texk/web2c/ptexdir/lib/ChangeLog b/Build/source/texk/web2c/ptexdir/lib/ChangeLog index ea2fb9a3297..60403be9a2a 100644 --- a/Build/source/texk/web2c/ptexdir/lib/ChangeLog +++ b/Build/source/texk/web2c/ptexdir/lib/ChangeLog @@ -1,3 +1,9 @@ +2010-04-19 Peter Breitenlohner <peb@mppmu.mpg.de> + + * openclose.c (fullnameoffile, recorder_enabled, + output_directory): Remove extern decls, are in ../../lib/lib.h. + Apply recent changes in ../../lib/openclose.c. + 2010-04-18 Peter Breitenlohner <peb@mppmu.mpg.de> * usage.c: Removed. diff --git a/Build/source/texk/web2c/ptexdir/lib/openclose.c b/Build/source/texk/web2c/ptexdir/lib/openclose.c index f865d53464b..03bcda59a39 100644 --- a/Build/source/texk/web2c/ptexdir/lib/openclose.c +++ b/Build/source/texk/web2c/ptexdir/lib/openclose.c @@ -14,18 +14,15 @@ /* The globals we use to communicate. */ extern string nameoffile; extern unsigned namelength; -/* For "file:line:error" style error messages. */ -extern string fullnameoffile; -/* For the filename recorder. */ -extern boolean recorder_enabled; -/* For the output-dir option. */ -extern string output_directory; /* Define some variables. */ +/* For "file:line:error" style error messages. */ string fullnameoffile; /* Defaults to NULL. */ static string recorder_name; /* Defaults to NULL. */ static FILE *recorder_file; /* Defaults to NULL. */ +/* For the filename recorder. */ boolean recorder_enabled; /* Defaults to false. */ +/* For the output-dir option. */ string output_directory; /* Defaults to NULL. */ /* For TeX and MetaPost. See below. Always defined so we don't have to @@ -39,12 +36,20 @@ int texinputtype; static void recorder_start(void) { - /* Alas, while we might want to use mkstemp it is not portable. - So we have to be content with using a default name... */ + /* Alas, while we'd like to use mkstemp it is not portable, + and doing the autoconfiscation (and providing fallbacks) is more + than we want to cope with. So we have to be content with using a + default name. Throw in the pid so at least parallel builds might + work (Debian bug 575731). */ string cwd; + pid_t pid = getpid(); + char pid_str[MAX_INT_LENGTH]; + sprintf (pid_str, "%ld", (long) pid); - recorder_name = (string)xmalloc(strlen(kpse_program_name)+5); + recorder_name = xmalloc(strlen(kpse_program_name) + + strlen (pid_str) + 5); strcpy(recorder_name, kpse_program_name); + strcat(recorder_name, pid_str); strcat(recorder_name, ".fls"); /* If an output directory was specified, use it instead of cwd. */ @@ -127,13 +132,13 @@ open_input (FILE **f_ptr, int filefmt, const_string fopen_mode) absolute. This is because .aux and other such files will get written to the output directory, and we have to be able to read them from there. We only look for the name as-is. */ - if (output_directory && kpse_absolute_p (nameoffile+1, false)) { + if (output_directory && !kpse_absolute_p (nameoffile+1, false)) { fname = concat3 (output_directory, DIR_SEP_STRING, nameoffile + 1); *f_ptr = fopen (fname, fopen_mode); if (*f_ptr) { free (nameoffile); namelength = strlen (fname); - nameoffile = (string) xmalloc (namelength + 2); + nameoffile = xmalloc (namelength + 2); strcpy (nameoffile + 1, fname); fullnameoffile = fname; } else { @@ -180,7 +185,7 @@ open_input (FILE **f_ptr, int filefmt, const_string fopen_mode) /* kpse_find_file always returns a new string. */ free (nameoffile); namelength = strlen (fname); - nameoffile = (string)xmalloc (namelength + 2); + nameoffile = xmalloc (namelength + 2); strcpy (nameoffile + 1, fname); free (fname); @@ -256,7 +261,7 @@ open_output (FILE **f_ptr, const_string fopen_mode) if (fname != nameoffile + 1) { free (nameoffile); namelength = strlen (fname); - nameoffile = (string)xmalloc (namelength + 2); + nameoffile = xmalloc (namelength + 2); strcpy (nameoffile + 1, fname); } recorder_record_output (fname); |