diff options
author | Martin Schröder <martin@oneiros.de> | 2007-07-11 21:13:59 +0000 |
---|---|---|
committer | Martin Schröder <martin@oneiros.de> | 2007-07-11 21:13:59 +0000 |
commit | 7bf56e6bfcd7b204b3507dc9acaaaa3dce2cbcdb (patch) | |
tree | 5f8b4be4a21dc917441e4d2a1ec3e6fe25fd0192 /Build/source/texk/web2c/lib | |
parent | c0da09fd6e4a542610245624c185a66f5ec814b2 (diff) |
Imported pdftex 1.40.4
git-svn-id: svn://tug.org/texlive/trunk@4561 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/lib')
-rw-r--r-- | Build/source/texk/web2c/lib/openclose.c | 37 | ||||
-rw-r--r-- | Build/source/texk/web2c/lib/texmfmp.c | 6 |
2 files changed, 33 insertions, 10 deletions
diff --git a/Build/source/texk/web2c/lib/openclose.c b/Build/source/texk/web2c/lib/openclose.c index a4ac21495b8..fc23ab42e88 100644 --- a/Build/source/texk/web2c/lib/openclose.c +++ b/Build/source/texk/web2c/lib/openclose.c @@ -58,6 +58,31 @@ recorder_change_filename P1C(string, new_name) free(recorder_name); recorder_name = xstrdup(new_name); } + +/* helper for recorder_record_* */ +void +recorder_record_name P2C(string, prefix, string, nameoffile) +{ + if (recorder_enabled) { + if (!recorder_file) + recorder_start(); + fprintf(recorder_file, "%s %s\n", prefix, nameoffile); + } +} + +/* record an input file */ +void +recorder_record_input P1C(string, nameoffile) +{ + recorder_record_name ("INPUT", nameoffile); +} + +/* record an output file */ +void +recorder_record_output P1C(string, nameoffile) +{ + recorder_record_name ("OUTPUT", nameoffile); +} /* Open an input file F, using the kpathsea format FILEFMT and passing FOPEN_MODE to fopen. The filename is in `nameoffile+1'. We return @@ -155,11 +180,7 @@ open_input P3C(FILE **, f_ptr, int, filefmt, const_string, fopen_mode) } if (*f_ptr) { - if (recorder_enabled) { - if (!recorder_file) - recorder_start(); - fprintf(recorder_file, "INPUT %s\n", nameoffile + 1); - } + recorder_record_input (nameoffile + 1); /* If we just opened a TFM file, we have to read the first byte, to pretend we're Pascal. See tex.ch and mp.ch. @@ -220,11 +241,7 @@ open_output P2C(FILE **, f_ptr, const_string, fopen_mode) nameoffile = (string)xmalloc (namelength + 2); strcpy (nameoffile + 1, fname); } - if (recorder_enabled) { - if (!recorder_file) - recorder_start(); - fprintf(recorder_file, "OUTPUT %s\n", fname); - } + recorder_record_output (fname); } if (fname != nameoffile +1) free(fname); diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c index 12307761463..8b876bb42a5 100644 --- a/Build/source/texk/web2c/lib/texmfmp.c +++ b/Build/source/texk/web2c/lib/texmfmp.c @@ -18,6 +18,7 @@ #include <kpathsea/readable.h> #include <kpathsea/variable.h> #include <kpathsea/absolute.h> +#include <kpathsea/recorder.h> #include <time.h> /* For `struct tm'. */ #if defined (HAVE_SYS_TIME_H) @@ -186,6 +187,9 @@ maininit P2C(int, ac, string *, av) /* Must be initialized before options are parsed. */ interactionoption = 4; + kpse_record_input = recorder_record_input; + kpse_record_output = recorder_record_output; + #if defined(pdfTeX) ptexbanner = BANNER; #endif @@ -1357,6 +1361,7 @@ open_in_or_pipe P3C(FILE **, f_ptr, int, filefmt, const_string, fopen_mode) free (fullnameoffile); fullnameoffile = xstrdup (fname); #endif + recorder_record_input (fname + 1); *f_ptr = popen(fname+1,"r"); free(fname); for (i=0; i<=15; i++) { @@ -1401,6 +1406,7 @@ open_out_or_pipe P2C(FILE **, f_ptr, const_string, fopen_mode) } else { *f_ptr = popen(fname+1,"w"); } + recorder_record_output (fname + 1); free(fname); for (i=0; i<=15; i++) { |