summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-04-29 00:56:37 +0000
committerKarl Berry <karl@freefriends.org>2008-04-29 00:56:37 +0000
commitbfd35314a2b10114755d8551c4274aa5831f0012 (patch)
treeb65afd9ad5bd3aaef1846cdd1de5709bf09c462d /Build
parentf3cffc739154761a6332118667ba4895041d1256 (diff)
rewrite squeeze as truly standalone POSIX, fingers crossed
git-svn-id: svn://tug.org/texlive/trunk@7715 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/dvipsk/ChangeLog5
-rw-r--r--Build/source/texk/dvipsk/squeeze.c43
2 files changed, 26 insertions, 22 deletions
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 <karl@tug.org>
+
+ * squeeze.c: avoid all old-sytem conditionals, linking with
+ kpathsea, etc.
+
2008-04-28 Karl Berry <karl@tug.org>
* 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 <kpathsea/config.h>
-#include <kpathsea/c-fopen.h>
-#include <c-auto.h>
-#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "dvips.h" /* The copyright notice in that file is included too! */
-#endif /* !KPATHSEA */
+#include <fcntl.h>
-/* 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 ;