From d0126365e4a0fb2f190068a374afe6b791b74c8c Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Fri, 7 Oct 2011 13:07:35 +0000 Subject: remove more TL vs W32TeX diffs git-svn-id: svn://tug.org/texlive/trunk@24234 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/ptexenc/ChangeLog | 4 ++ Build/source/texk/ptexenc/ptexenc.c | 1 + Build/source/texk/ptexenc/ptexenc/ptexenc.h | 1 + Build/source/texk/web2c/ChangeLog | 4 ++ Build/source/texk/web2c/lib/ChangeLog | 4 ++ Build/source/texk/web2c/lib/texmfmp.c | 76 ++++++++++++++++++++++------- Build/source/texk/web2c/texmfmp.h | 5 +- 7 files changed, 76 insertions(+), 19 deletions(-) diff --git a/Build/source/texk/ptexenc/ChangeLog b/Build/source/texk/ptexenc/ChangeLog index fec17c87fbb..f6ac1bf7989 100644 --- a/Build/source/texk/ptexenc/ChangeLog +++ b/Build/source/texk/ptexenc/ChangeLog @@ -1,3 +1,7 @@ +2011-10-07 Peter Breitenlohner + + * ptexenc.c, ptexenc/ptexenc.h: Declare and export Poptr. + 2011-09-05 Takuji Tanaka * ptexenc.c: Fix putc2() to output right unicode characters. diff --git a/Build/source/texk/ptexenc/ptexenc.c b/Build/source/texk/ptexenc/ptexenc.c index c32d75b434d..d12f3459b56 100644 --- a/Build/source/texk/ptexenc/ptexenc.c +++ b/Build/source/texk/ptexenc/ptexenc.c @@ -38,6 +38,7 @@ static boolean UPTEX_enabled; const char *ptexenc_version_string = "ptexenc " PTEXENC_VERSION; #if defined(WIN32) int sjisterminal; +FILE *Poptr; int infile_enc_auto; #else static int infile_enc_auto = 1; diff --git a/Build/source/texk/ptexenc/ptexenc/ptexenc.h b/Build/source/texk/ptexenc/ptexenc/ptexenc.h index 5c0ddfc9def..54dd63ab336 100644 --- a/Build/source/texk/ptexenc/ptexenc/ptexenc.h +++ b/Build/source/texk/ptexenc/ptexenc/ptexenc.h @@ -24,6 +24,7 @@ extern PTENCDLL const char *ptexenc_version_string; #if defined(WIN32) extern PTENCDLL int sjisterminal; +extern PTENCDLL FILE *Poptr; extern PTENCDLL int infile_enc_auto; #endif diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog index 66d87b7a18d..ea453856d05 100644 --- a/Build/source/texk/web2c/ChangeLog +++ b/Build/source/texk/web2c/ChangeLog @@ -1,3 +1,7 @@ +2011-10-07 Peter Breitenlohner + + * texmfmp.h (ENABLE_PIPES): New macro for pipe support. + 2011-10-06 Peter Breitenlohner * configure.ac: Add poppler feature tests for luaTeX. diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog index 261b8de730d..d9925dc6ff9 100644 --- a/Build/source/texk/web2c/lib/ChangeLog +++ b/Build/source/texk/web2c/lib/ChangeLog @@ -1,3 +1,7 @@ +2011-10-07 Peter Breitenlohner + + * texmfmp.c: More changes to reduce diffs with W32TeX. + 2011-10-04 Peter Breitenlohner * texmfmp.c: More changes to reduce diffs with W32TeX, diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c index 24e7fd8480b..b37210e9e70 100644 --- a/Build/source/texk/web2c/lib/texmfmp.c +++ b/Build/source/texk/web2c/lib/texmfmp.c @@ -137,6 +137,12 @@ char *generic_synctex_get_current_name (void) } #endif +#ifdef WIN32 +#if !IS_pTeX +FILE *Poptr; +#endif +#endif + #if defined(TeX) || (defined(MF) && defined(WIN32)) static int Isspace (char c) @@ -511,8 +517,9 @@ runsystem (const char *cmd) return allow; } +#endif /* TeX */ -#ifdef pdfTeX +#if ENABLE_PIPES /* Like runsystem(), the runpopen() function is called only when shellenabledp == 1. Unlike runsystem(), here we write errors to stderr, since we have nowhere better to use; and of course we return @@ -556,8 +563,7 @@ runpopen (char *cmd, const char *mode) free (cmdname); return f; } -#endif /* pdfTeX */ -#endif /* TeX */ +#endif /* ENABLE_PIPES */ /* The main program, etc. */ @@ -676,6 +682,10 @@ maininit (int ac, string *av) kpse_set_program_name (argv[0], user_progname); #endif + /* If the program name is "mf-nowin", then reset the name as "mf". */ + if (strncasecmp (kpse_invocation_name, "mf-nowin", 8) == 0) + kpse_reset_program_name ("mf"); + /* FIXME: gather engine names in a single spot. */ xputenv ("engine", TEXMFENGINENAME); @@ -923,6 +933,7 @@ topenin (void) #if defined (TeX) && defined (IPC) #ifdef WIN32 +#undef _WINSOCKAPI_ #include #else #include @@ -1022,12 +1033,8 @@ ipc_open_out (void) { #ifdef WIN32 struct WSAData wsaData; int nCode; -#if 0 - unsigned long sockcntl = 1024; -#else unsigned long mode = 1; #endif -#endif #ifdef IPC_DEBUG fputs ("tex: Opening socket for IPC output ...\n", stderr); #endif @@ -1056,11 +1063,7 @@ ipc_open_out (void) { if (sock != INVALID_SOCKET) { if (connect (sock, ipc_addr, ipc_addr_len) != 0 || #ifdef WIN32 -#if 0 - ioctlsocket (sock, O_NONBLOCK, &sockcntl) != 0 -#else ioctlsocket (sock, FIONBIO, &mode) < 0 -#endif #else fcntl (sock, F_SETFL, O_NONBLOCK) < 0 #endif @@ -1105,6 +1108,7 @@ ipc_snd (int n, int is_eof, char *data) } #ifdef IPC_DEBUG + fprintf(stderr, "%d\t%d\n", ourmsg.msg.namelength, ourmsg.msg.eof); fputs ("tex: Sending message to socket ...\n", stderr); #endif ourmsg.msg.namelength = n; @@ -1580,7 +1584,11 @@ parse_options (int argc, string *argv) ipc_open_out (); /* Try to start up the other end if it's not already. */ if (!ipc_is_open ()) { +#ifdef WIN32 + if (spawnlp (_P_NOWAIT, IPC_SERVER_CMD, IPC_SERVER_CMD, NULL) != -1) { +#else if (system (IPC_SERVER_CMD) == 0) { +#endif unsigned i; for (i = 0; i < 20 && !ipc_is_open (); i++) { #ifdef WIN32 @@ -1823,10 +1831,11 @@ parse_first_line (const_string filename) closed using pclose(). */ -#if defined(pdfTeX) +#if ENABLE_PIPES -static FILE *pipes [] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, - NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; +#define MAX_PIPES 16 + +static FILE *pipes [MAX_PIPES]; boolean open_in_or_pipe (FILE **f_ptr, int filefmt, const_string fopen_mode) @@ -1846,7 +1855,7 @@ open_in_or_pipe (FILE **f_ptr, int filefmt, const_string fopen_mode) recorder_record_input (fname + 1); *f_ptr = runpopen(fname+1,"rb"); free(fname); - for (i=0; i<=15; i++) { + for (i=0; i