Facesaver BSD patch

Devon E Bowen bowen at cs.Buffalo.EDU
Sat Jul 29 01:23:32 AEST 1989


A couple small patches to get the facesaver stuff posted a few days ago
to work on a BSD system. Compile with "gcc -o face2ps -DBSD face2ps.c".

Devon

----------------
*** old.c	Fri Jul 28 11:16:37 1989
--- face2ps.c	Fri Jul 28 11:16:25 1989
***************
*** 22,29 ****
--- 22,33 ----
  #ifdef __TURBOC__
  #include <stdlib.h>
  #else
+ #ifdef BSD
+ char *malloc(), *realloc();
+ #else
  #include <malloc.h>
  #endif
+ #endif
  #include <stdio.h>
  #include <ctype.h>
  #include <string.h>
***************
*** 107,119 ****
--- 111,130 ----
  #endif
  	program++;
  
+ #ifndef BSD
  	if (setvbuf(stdout, 0, _IOFBF, 4096)) {
  		fprintf(stderr, "%s: ran out of memory on setvbuf to stdout\n",
  		    program);
  		exit(1);
  	}
+ #endif
  
+ #ifdef BSD
+ 	defines = malloc(1);
+ 	*defines = '\0';
+ #else
  	defines = strdup("");
+ #endif
  
  	while((option=getopt(argc, argv, "p:D:")) != EOF) switch(option){
  	case 'p':
***************
*** 179,189 ****
--- 190,202 ----
  		exit (1);
  	}
  
+ #ifndef BSD
  	if (setvbuf(fp, 0, _IOFBF, 4096)) {
  		fprintf(stderr, "%s: ran out of memory on setvbuf to fp\n",
  		    program);
  		exit(1);
  	}
+ #endif
  
  	/* Copy the prolog over */
  	while (inl = longgets(fp),*inl) {
***************
*** 206,216 ****
--- 219,231 ----
  		exit (1);
  	}
  
+ #ifndef BSD
  	if (setvbuf(fp, 0, _IOFBF, 4096)) {
  		fprintf(stderr, "%s: ran out of memory on setvbuf to fp\n",
  		    program);
  		exit(1);
  	}
+ #endif
  
  	/* create a dictionary big enough for everything */
  	printf("20 dict begin\n");



More information about the Alt.sources mailing list