From bfd35314a2b10114755d8551c4274aa5831f0012 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 29 Apr 2008 00:56:37 +0000 Subject: rewrite squeeze as truly standalone POSIX, fingers crossed git-svn-id: svn://tug.org/texlive/trunk@7715 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/dvipsk/ChangeLog | 5 +++++ Build/source/texk/dvipsk/squeeze.c | 43 +++++++++++++++++++------------------- 2 files changed, 26 insertions(+), 22 deletions(-) (limited to 'Build') diff --git a/Build/source/texk/dvipsk/ChangeLog b/Build/source/texk/dvipsk/ChangeLog index 9d26e99c852..73273889cd6 100644 --- a/Build/source/texk/dvipsk/ChangeLog +++ b/Build/source/texk/dvipsk/ChangeLog @@ -1,3 +1,8 @@ +2008-04-29 Karl Berry + + * squeeze.c: avoid all old-sytem conditionals, linking with + kpathsea, etc. + 2008-04-28 Karl Berry * dvips.h: id. diff --git a/Build/source/texk/dvipsk/squeeze.c b/Build/source/texk/dvipsk/squeeze.c index 72a2609c7f7..74e7abcf336 100644 --- a/Build/source/texk/dvipsk/squeeze.c +++ b/Build/source/texk/dvipsk/squeeze.c @@ -6,30 +6,24 @@ * minimum. We parse and then output it. */ -#ifdef KPATHSEA -#include -#include -#include -#else #include #include #include -#include "dvips.h" /* The copyright notice in that file is included too! */ -#endif /* !KPATHSEA */ +#include -/* debug.h redefines fopen to my_real_fopen, but it's still a FILE * */ -#ifdef fopen -#undef fopen -extern FILE *fopen (); -#endif +#ifndef O_BINARY +# ifdef _O_BINARY +# define O_BINARY _O_BINARY +# else +# define O_BINARY 0 +# endif +#endif /* !O_BINARY */ #define LINELENGTH (72) #define BUFLENGTH (1000) -#ifdef putchar -#undef putchar -#endif -#define putchar(a) (void)putc(a, out) ; -FILE *in, *out ; + +static char buf[BUFLENGTH] ; +static FILE *in, *out ; static int linepos = 0 ; static int lastspecial = 1 ; /* @@ -37,7 +31,8 @@ static int lastspecial = 1 ; * we simply put it out, since any special character terminates the * preceding token. */ -void specialout P1C(char, c) +void +specialout (char c) { if (linepos + 1 > LINELENGTH) { putchar('\n') ; @@ -47,7 +42,8 @@ void specialout P1C(char, c) linepos++ ; lastspecial = 1 ; } -void strout P1C(char *, s) +void +strout (char *s) { if (linepos + strlen(s) > LINELENGTH) { putchar('\n') ; @@ -58,7 +54,8 @@ void strout P1C(char *, s) putchar(*s++) ; lastspecial = 1 ; } -void cmdout P1C(char *, s) +void +cmdout (char *s) { int l ; @@ -78,8 +75,10 @@ void cmdout P1C(char *, s) linepos += l ; lastspecial = 0 ; } -char buf[BUFLENGTH] ; -int main P2C(int, argc, char **, argv) + + +int +main (int argc, char *argv[]) { int c ; char *b ; -- cgit v1.2.3