|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T p
Length: 1866 (0x74a) Types: TextFile Names: »plext.c«
└─⟦52210d11f⟧ Bits:30007239 EUUGD2: TeX 3 1992-12 └─⟦af5ba6c8e⟧ »unix3.0/DVIWARE.tar.Z« └─⟦ca79c7339⟧ └─⟦this⟧ »DVIware/laser-setters/dvi-to-ps/TeXPS/pltotf/plext.c«
/* * External procedures for pltotf.c etc. * * Tim Morgan, 3/22/88 */ #include <stdio.h> #include "site.h" #ifdef SYSV #include <string.h> #else #include <strings.h> #endif #define TRUE 1 #define FALSE 0 integer argc; static char **gargv; argv(n, buf) int n; char buf[]; { (void) strcpy(buf+1, gargv[n]); (void) strcat(buf+1, " "); } main(ac, av) char *av[]; { argc = ac; gargv = av; main_body(); exit(0); /* I added this exit() call so it would work on the 386i */ } /* Same routine as index() aka strchr() */ #ifndef SYSV char *char_index(cp, c) char *cp, c; { while (*cp != c && *cp) ++cp; if (*cp) return(cp); return(0); } #else /* not SYSV */ #define char_index strchr #endif /* Open a file; don't return if error */ FILE *openf(name, mode) char *name, *mode; { FILE *result; char *cp; cp = char_index(name, ' '); if (cp) *cp = '\0'; result = fopen(name, mode); if (result) return(result); perror(name); exit(1); /*NOTREACHED*/ } /* Print real number r in format n:m */ printreal(r, n, m) double r; int n,m; { char fmt[50]; (void) sprintf(fmt, "%%%d.%df", n, m); (void) printf(fmt, r); } /* Return true on end of line or eof of file, else false */ eoln(f) FILE *f; { register int c; if (feof(f)) return(1); c = getc(f); if (c != EOF) (void) ungetc(c, f); return (c == '\n' || c == EOF); } integer zround(f) double f; { if (f >= 0.0) return(f + 0.5); return(f - 0.5); } /* Read an integer in from file f; read past the subsequent end of line */ integer inputint(f) FILE *f; { char buffer[20]; if (fgets(buffer, sizeof(buffer), f)) return(atoi(buffer)); return(0); } zinput_3ints(a,b,c) integer *a, *b, *c; { while (scanf("%ld %ld %ld\n", a, b, c) != 3) (void) fprintf(stderr, "Please enter three integers\n"); }