Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!rsalz From: rsalz@uunet.UU.NET (Rich Salz) Newsgroups: comp.sources.unix Subject: v12i063: A PostScript interpreter, Part14/18 Message-ID: <2881@uunet.UU.NET> Date: Sun, 8-Nov-87 16:23:28 EST Article-I.D.: uunet.2881 Posted: Sun Nov 8 16:23:28 1987 Date-Received: Mon, 9-Nov-87 02:37:19 EST Organization: UUNET Communications Services, Arlington, VA Lines: 4430 Approved: rs@uunet.UU.NET Submitted-by: Crispin Goswell Posting-number: Volume 12, Issue 63 Archive-name: postscript/part14 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'postscript/fonts/Olde/italic.r' <<'END_OF_FILE' XCharStrings X/3301 X Xput XMetrics X/3301 X[0 X24] Xput XCharStrings X/3302 X Xput XMetrics X/3302 X[-1 X26] Xput XCharStrings X/3303 X Xput XMetrics X/3303 X[0 X24] Xput XCharStrings X/3304 X Xput XMetrics X/3304 X[-1 X26] Xput XCharStrings X/3305 X Xput XMetrics X/3305 X[0 X24] Xput XCharStrings X/3306 X Xput XMetrics X/3306 X[0 X24] Xput XCharStrings X/3307 X Xput XMetrics X/3307 X[-1 X26] Xput XCharStrings X/3308 X Xput XMetrics X/3308 X[0 X25] Xput XCharStrings X/3309 X Xput XMetrics X/3309 X[0 X25] Xput XCharStrings X/3310 X Xput XMetrics X/3310 X[0 X25] Xput XCharStrings X/3311 X Xput XMetrics X/3311 X[-1 X26] Xput XCharStrings X/3312 X Xput XMetrics X/3312 X[1 X23] Xput XCharStrings X/3313 X Xput XMetrics X/3313 X[-3 X32] Xput XCharStrings X/3314 X Xput XMetrics X/3314 X[-2 X28] Xput XCharStrings X/3315 X Xput XMetrics X/3315 X[-2 X28] Xput XCharStrings X/3316 X Xput XMetrics X/3316 X[-1 X27] Xput XCharStrings X/3317 X Xput XMetrics X/3317 X[-2 X28] Xput XCharStrings X/3318 X Xput XMetrics X/3318 X[-2 X28] Xput XCharStrings X/3319 X Xput XMetrics X/3319 X[-1 X27] Xput XCharStrings X/3320 X Xput XMetrics X/3320 X[0 X25] Xput XCharStrings X/3321 X Xput XMetrics X/3321 X[1 X22] Xput XCharStrings X/3322 X Xput XMetrics X/3322 X[-2 X28] Xput XCharStrings X/3323 X Xput XMetrics X/3323 X[-3 X33] Xput XCharStrings X/3324 X Xput XMetrics X/3324 X[0 X24] Xput XCharStrings X/3325 X Xput XMetrics X/3325 X[-1 X26] Xput XCharStrings X/3326 X Xput XMetrics X/3326 X[0 X24] Xput XCharStrings X/3401 X Xput XMetrics X/3401 X[-3 X17] Xput XCharStrings X/3402 X Xput XMetrics X/3402 X[4 X17] Xput XCharStrings X/3403 X Xput XMetrics X/3403 X[-2 X13] Xput XCharStrings X/3404 X Xput XMetrics X/3404 X[4 X17] Xput XCharStrings X/3405 X Xput XMetrics X/3405 X[-2 X13] Xput XCharStrings X/3406 X Xput XMetrics X/3406 X[6 X13] Xput XCharStrings X/3407 X Xput XMetrics X/3407 X[-3 X17] Xput XCharStrings X/3408 X Xput XMetrics X/3408 X[4 X17] Xput XCharStrings X/3409 X Xput XMetrics X/3409 X[7 X10] Xput XCharStrings X/3410 X Xput XMetrics X/3410 X[7 X10] Xput XCharStrings X/3411 X Xput XMetrics X/3411 X[5 X14] Xput XCharStrings X/3412 X Xput XMetrics X/3412 X[7 X10] Xput XCharStrings X/3413 X Xput XMetrics X/3413 X[-1 X26] Xput XCharStrings X/3414 X Xput XMetrics X/3414 X[-1 X18] Xput XCharStrings X/3415 X Xput XMetrics X/3415 X[-3 X17] Xput XCharStrings X/3416 X Xput XMetrics X/3416 X[0 X17] Xput XCharStrings X/3417 X Xput XMetrics X/3417 X[-3 X17] Xput XCharStrings X/3418 X Xput XMetrics X/3418 X[-2 X14] Xput XCharStrings X/3419 X Xput XMetrics X/3419 X[6 X11] Xput XCharStrings X/3420 X Xput XMetrics X/3420 X[3 X12] Xput XCharStrings X/3421 X Xput XMetrics X/3421 X[-1 X18] Xput XCharStrings X/3422 X Xput XMetrics X/3422 X[-1 X17] Xput XCharStrings X/3423 X Xput XMetrics X/3423 X[-3 X25] Xput XCharStrings X/3424 X Xput XMetrics X/3424 X[-2 X15] Xput XCharStrings X/3425 X Xput XMetrics X/3425 X[-1 X17] Xput XCharStrings X/3426 X Xput XMetrics X/3426 X[-2 X14] Xput XCharStrings X/3427 X Xput XMetrics X/3427 X[0 X16] Xput XCharStrings X/3428 X Xput XMetrics X/3428 X[4 X17] Xput XCharStrings X/3429 X Xput XMetrics X/3429 X[1 X17] Xput END_OF_FILE if test 18559 -ne `wc -c <'postscript/fonts/Olde/italic.r'`; then echo shar: \"'postscript/fonts/Olde/italic.r'\" unpacked with wrong size! fi # end of 'postscript/fonts/Olde/italic.r' fi if test -f 'source/file.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'source/file.c'\" else echo shar: Extracting \"'source/file.c'\" \(17713 characters\) sed "s/^X//" >'source/file.c' <<'END_OF_FILE' X/* X * Copyright (C) Rutherford Appleton Laboratory 1987 X * X * This source may be copied, distributed, altered or used, but not sold for profit X * or incorporated into a product except under licence from the author. X * It is not in the public domain. X * This notice should remain in the source unaltered, and any changes to the source X * made by persons other than the author should be marked as such. X * X * Crispin Goswell @ Rutherford Appleton Laboratory caag@uk.ac.rl.vd X */ X#include X X#include "main.h" X X#define MAXFILENAME 1000 X X/* X * This file implements the input/output calls in PostScript. X * X * A PostScript file corresponds reasonably closely to a Unix file, so this is not X * too hard. X * X * The file operator itself can generate three major file types: X * X * Regular filing system files X * Standard I/O channels (called %stdin, %stdout and %stderr) X * Peculiar temporary files called %lineedit and %statementedit X * X * %lineedit and %statementedit are files generated by the file operator, rather X * than merely opened for reading or writing. X * X * %lineedit generates a temporary file containing the text that the user types X * in on the %stdin stream for one line only. X * The %stdin is required to be edited while this is going on, which means that it X * must be in cooked mode (-cbreak). %stdin is normally in cbreak mode. X * X * %statementedit is similar to %lineedit (in that it generates a temporary file), X * but the input process continues until PostScript sees a complete expression, with X * "(" matching ")" and "{" matching "}". "[" is not required to match "]", as these X * are not actually parsed differently from operators (except for their delimiting X * properties). X * X * There are essentially two ways of implementing these temporary files: X * X * o We could use real files, and copy user input into them, allowing the X * PostScript interpreter to just read from them. X * o We could provide some kind of cache using a buffer in main memory. X * X * The second alternative is likely to reduce certain overheads and, since the code X * for parsing from strings is needed anyway (token is defined to parse from strings), X * there is little extra effort in doing things this way. X * X * For this reason, files under this implementation are typed. We have: X * X * StreamFiles which are conventional stdio FILE *s. X * StringFiles which are pointers in strings. X * X * StringFiles are used internally by token to parse from strings, to avoid duplicating X * the entire parser. These file types are defined with an enumerated type. X * X * It is defined that closing the %stdin file have no effect other than resetting an X * end-of-file flag. It is not defined whether the output files are required to be X * similarly permanent. We assume they are, and introduce a feature of files which is X * that they may be PERMANENT. This is a flag. It is also not clear if Readable and X * Writeable access to files is an Access Restriction, as such. We assume so. X * X */ X Xextern int errno; X Xstatic Object StdIn, Terminal, StdOut, StdErr, LineEdit; XObject StatementEdit, Fstdin, Fterminal, Fstdout, Fstderr; X XFILE *popen (); X Xstatic int Token (), Eq (); X Xstatic int PFile (), PCloseFile (), PRead (), PReadHexString (), PReadLine (), PReadString (); Xstatic int PBytesAvailable (), PWrite (), PWriteHexString (), PWriteString (), PFlush (); Xstatic int PFlushFile (), PStatus (), PCurFile (), PPrint (), PEcho (); X Xint ExecFile (); X XInitFile () X { X TypeInstallOp (File, "token", Token, 1, 2, 0, 0, File); X TypeInstallOp (File, "exec", ExecFile, 1, 0, 0, 0, File); X TypeInstallOp (File, "eq", Eq, 2, 1, 0, 0, File, File); X X Fstdin = ReadOnly (FileFrom (stdin)); Fstdin.flags |= PERMANENT; X Fterminal = FileFrom (fopen ("/dev/tty", "r")); Fterminal.flags |= PERMANENT; X Fstdout = WriteOnly (FileFrom (stdout)); Fstdout.flags |= PERMANENT; X Fstderr = WriteOnly (FileFrom (stderr)); Fstderr.flags |= PERMANENT; X X StdIn = StringFrom ("%stdin"); X StdOut = StringFrom ("%stdout"); X StdErr = StringFrom ("%stderr"); X Terminal = StringFrom ("%terminal"); X StatementEdit = StringFrom ("%statementedit"); X LineEdit = StringFrom ("%lineedit"); X X InstallOp ("file", PFile, 2, 1, 0, 0, String, String); X InstallOp ("closefile", PCloseFile, 1, 0, 0, 0, File); X InstallOp ("read", PRead, 1, 1, 0, 0, File); X InstallOp ("readhexstring", PReadHexString, 2, 1, 0, 0, File, String); X InstallOp ("readline", PReadLine, 2, 1, 0, 0, File, String); X InstallOp ("readstring", PReadString, 2, 1, 0, 0, File, String); X InstallOp ("bytesavailable", PBytesAvailable,1, 1, 0, 0, File); X InstallOp ("write", PWrite, 2, 0, 0, 0, File, Integer); X InstallOp ("writehexstring", PWriteHexString,2, 0, 0, 0, File, String); X InstallOp ("writestring", PWriteString, 2, 0, 0, 0, File, String); X InstallOp ("flush", PFlush, 0, 0, 0, 0); X InstallOp ("flushfile", PFlushFile, 1, 0, 0, 0, File); X InstallOp ("status", PStatus, 1, 1, 0, 0, File); X InstallOp ("currentfile", PCurFile, 0, 1, 0, 0); X InstallOp ("print", PPrint, 1, 0, 0, 0, String); X InstallOp ("echo", PEcho, 1, 0, 0, 0, Boolean); X X Cbreak (TRUE); X } X Xstatic int Token (f) Object f; X { X Object res; X res = Parse (f); X if (TypeOf (res) == Condition) X return Error (PSyntaxError); X else if (TypeOf (res) == Boolean) X VOID Push (OpStack, False); X else if (TypeOf (res) != Null) X { X VOID Push (OpStack, res); X VOID Push (OpStack, True); X } X else X return Error (PUnResult); X return TRUE; X } X Xstatic struct file_struct *Body (item) Object item; X { X return item.u.File; X } X Xint getchbuf; X X#ifdef notdef Xstruct file_struct *BodyFile (item) Object item; X { X return item.u.File; X } X Xstatic int Getc (fp) FILE *fp; X { X int c; X X for (;;) X { X errno = 0; X if ((c = getc (fp)) != EOF) X return c; X/* if (errno == 0 || Interrupted ())*/ X return EOF; X } X } X#endif X X#define Getc(a) getc(a) X Xstatic int Getchar () X { X return Getc (stdin); X } X X#define Getchar getchar X Xstatic int Status (file) Object file; X { X return Body (file)->available; X } X X#define Status(f) (Body(f)->available) X Xstatic int Eq (a, b) Object a, b; X { X return Push (OpStack, MakeBoolean (Body (a) == Body (b))); X } X X/* X * FileFrom generates a file object from an existing file pointer X */ XObject FileFrom (fp) FILE *fp; X { X Object res; X struct file_struct *f; X X res = MakeObject (File); X f = res.u.File = (struct file_struct *) Malloc (sizeof (struct file_struct)); X f->file_type = StreamFile; X f->f.f_ptr = fp; X f->available = 1; X X return res; X } X X/* X * FileString is used to generate a file-like object which actually X * reads from a string. This is used by "file" and "token" when parsing X * strings. X */ XObject FileString (o) Object o; X { X Object res; X struct file_struct *f; X X res = MakeObject (File); X f = res.u.File = (struct file_struct *) Malloc (sizeof (struct file_struct)); X f->file_type = StringFile; X f->f.c_ptr = BodyString (o); X f->available = lengthString (o); X X return res; X } X Xint GeneralGetch (file) Object file; X { X int c; X X if (!Status (file)) X return EOF; X switch (Body (file)->file_type) X { X default: X PanicIf (TRUE, "unknown file type in Getch\n"); X return 0; /* shuts lint up */ X X case StreamFile: X c = Getc (Body (file)->f.f_ptr); X if (c == EOF) X { X Body (file)->available = 0; X Close (file); X } X return c; X X case StringFile: X if (Body (file)->available == 0) X return EOF; X --Body (file)->available; X c = *Body (file)->f.c_ptr++; X return c; X } X } X XUngetch (o, c) Object o; char c; X { X struct file_struct *f = Body (o); X X ++f->available; X switch (f->file_type) X { X case StringFile: f->f.c_ptr--; break; X case StreamFile: VOID ungetc (c, f->f.f_ptr); break; X X default: X Panic ("Don't know how to Ungetch to this file\n"); X } X } X Xint ExecFile (item) Object item; X { X Object res; X res = Parse (item); X if (TypeOf (res) == Boolean) X { X if (BodyBoolean (res)) X return Error (PSyntaxError); X } X else if (TypeOf (res) == Condition) X return Error (PSyntaxError); X else if (TypeOf (res) == Null) X return Error (PUnResult); X else if (TypeOf (res) == Name && xCheck (res)) X { X /*Object binding; X X binding = Load (res); X X if (TypeOf (binding) == Operator) X res = binding;*/ X VOID Push (ExecStack, item); X VOID Push (ExecStack, res); X } X else X { X VOID Push (ExecStack, item); X VOID Push (/*TypeOf (res) == Name ? ExecStack : */OpStack, res); X } X return TRUE; X } X XCleanup () X { X Echo (TRUE); X Cbreak (FALSE); X } X Xstatic cbreak = FALSE, echoing = TRUE; X X/*ARGSUSED*/ XCbreak (cond) int cond; X { X/* struct sgttyb s; X X if (cond == cbreak) X return; X ioctl (0, TIOCGETP, &s); X cbreak = cond; X if (cbreak) X s.sg_flags |= CBREAK; X else X s.sg_flags &= ~CBREAK; X ioctl (0, TIOCSETP, &s); X*/ } X Xstatic Echo (cond) int cond; X { X struct sgttyb s; X X if (cond == echoing) X return; X ioctl (0, TIOCGETP, &s); X echoing = cond; X if (echoing) X s.sg_flags |= ECHO; X else X s.sg_flags &= ~ECHO; X ioctl (0, TIOCSETP, &s); X } X Xstatic FILE *open_pipes [32];/* ICK! */ Xstatic int n_open_pipes = 0; X XFILE *Fopen (name, mode) char *name, *mode; X { X if (name[0] == '|') X { X FILE *fp = popen (name + 1, mode); X int i; X X for (i = 0; i < n_open_pipes && open_pipes [i] != NULL; i++) X ; X open_pipes [i] = fp; X if (i == n_open_pipes) X ++n_open_pipes; X return fp; X } X else X return fopen (name, mode); X } X Xvoid Fclose (fp) FILE *fp; X { X int i; X X for (i = 0; i < n_open_pipes; i++) X if (open_pipes [i] == fp) X { X pclose (fp); X open_pipes [i] = NULL; X } X fclose (fp); X } X Xstatic int PFile (string1, string2) Object string1, string2; X { X int mode; X X if (lengthString (string1) == 0 X || lengthString (string2) != 1 X || (mode = getString (string2, 0)) != 'r' && mode != 'w') X return Error (PInvFileAccess); X else if (getString (string1, 0) == '%') X return PseudoFile (string1, mode); X else if (lengthString (string1) > MAXFILENAME) X return Error (PUnFilename); X else X { X char name[MAXFILENAME+1], modes[2]; X FILE *fp; X X modes [0] = mode; modes [1] = '\0'; X VOID Bcopy (name, BodyString (string1), lengthString (string1)); X name [lengthString (string1)] = '\0'; X if (fp = Fopen (name, modes)) X return Push (OpStack, mode == 'r' ? ReadOnly (FileFrom (fp)) : WriteOnly (FileFrom (fp))); X return Error (PUnFilename); X } X } X Xstatic int PseudoFile (string1, mode) Object string1; int mode; X { X if (EqString (string1, StdIn)) return mode == 'r' ? Push (OpStack, Fstdin) : Error (PInvFileAccess); X else if (EqString (string1, Terminal)) return Push (OpStack, Fterminal); X else if (EqString (string1, StdOut)) return mode == 'w' ? Push (OpStack, Fstdout) : Error (PInvFileAccess); X else if (EqString (string1, StdErr)) return mode == 'w' ? Push (OpStack, Fstderr) : Error (PInvFileAccess); X else if (EqString (string1, StatementEdit)) return mode == 'r' ? EditStatement () : Error (PInvFileAccess); X else if (EqString (string1, LineEdit)) return mode == 'r' ? EditLine () : Error (PInvFileAccess); X else X return Error (PUnFilename); X } X Xstatic int EditLine () X { X unsigned char buf [BUFSIZE]; X int c, length = 0; X X Cbreak (FALSE); X do { X if (length >= BUFSIZE) X { X Cbreak (TRUE); X return Error (PLimitCheck); X } X if ((c = Getchar ()) == EOF) X break; X buf [length++] = c; X if (Interrupted ()) X { X Cbreak (TRUE); X return FALSE; X } X } while (buf [length - 1] != '\n'); X Cbreak (TRUE); X return Push (OpStack, X ReadOnly (FileString (MakeString (Bcopy (Malloc ((unsigned) length), buf, length), X length)))); X } X Xstatic int EditStatement () X { X char buf[BUFSIZE]; X int c, length = 0, slevel = 0, blevel = 0, escaped = FALSE; X X Cbreak (FALSE); X do { X if (length >= BUFSIZE) X { X Cbreak (TRUE); X return Error (PLimitCheck); X } X if ((c = Getchar ()) == EOF) X break; X buf [length++] = c; X if (Interrupted ()) X { X Cbreak (TRUE); X return FALSE; X } X if (slevel != 0) X if (escaped) X escaped = FALSE; X else if (c == '(') X ++slevel; X else if (c == ')') X --slevel; X else if (c == '\\') X escaped = TRUE; X else X ; X else X { X if (blevel == 0 && c == '}' || c == ')') X { X Cbreak (TRUE); X return Error (PSyntaxError); X } X else if (c == '{') X ++blevel; X else if (c == '}') X --blevel; X else if (c == '(') X ++slevel; X } X } while (!(slevel == 0 && blevel == 0 && buf [length - 1] == '\n')); X Cbreak (TRUE); X return Push (OpStack, X ReadOnly (FileString (MakeString (Bcopy (Malloc ((unsigned) length), buf, length), X length)))); X } X Xstatic int PCloseFile (file) Object file; X { X if (Status (file)) X Close (file); X return TRUE; X } X Xint Close (file) Object file; X { X if (file.flags & PERMANENT) X return TRUE; X switch (Body (file)->file_type) X { X default: X Panic ("Unknown file type in closefile\n"); X X case StringFile: X Body (file)->available = 0; X Body (file)->f.c_ptr = NULL; X return TRUE; X X case StreamFile: X Body (file)->available = 0; X if (Body (file)->f.f_ptr) X Fclose (Body (file)->f.f_ptr), X Body (file)->f.f_ptr = NULL; X return TRUE; X } X } X Xstatic int PRead (file) Object file; X { X int c = Getch (file); X X if (c != EOF) X return Push (OpStack, MakeInteger (c)), Push (OpStack, True); X else X return Push (OpStack, False); X } X Xstatic int PReadHexString (file, string) Object file, string; X { X int cc = 0, i, odd = FALSE, l = lengthString (string); X X for (i = 0; i < l; ) X { X int c = Getch (file); X X if (c == EOF) X break; X else if (c >= '0' && c <= '9') X c -= '0'; X else if (c >= 'a' && c <= 'f') X c -= 'a' - 10; X else if (c >= 'A' && c <= 'F') X c -= 'A' - 10; X else X continue; X if (odd) X putString (string, i++, (cc << 4) | c); X else X cc = c; X odd = !odd; X } X VOID Push (OpStack, getIString (string, 0, i)); X VOID Push (OpStack, MakeBoolean (Status (file))); X X return TRUE; X } X Xstatic int PReadLine (file, string) Object file, string; X { X int i, c = 0, l = lengthString (string); X X for (i = 0; (c = Getch (file)) != EOF && i < l && c != '\n'; i++) X putString (string, i, c); X if (c != '\n' && c != EOF) X return Error (PRangeCheck); X VOID Push (OpStack, getIString (string, 0, i)); X VOID Push (OpStack, MakeBoolean (c != EOF)); X X return TRUE; X } X Xstatic int PReadString (file, string) Object file, string; X { X int i, c, l = lengthString (string); X X for (i = 0; i < l && (c = Getch (file)) != EOF; i++) X putString (string, i, c); X VOID Push (OpStack, getIString (string, 0, i)); X VOID Push (OpStack, MakeBoolean (c != EOF)); X X return TRUE; X } X X/*ARGSUSED*/ Xstatic int PBytesAvailable (file) Object file; X { X return Push (OpStack, MakeInteger (-1)); X } X Xstatic int PWrite (file, integer) Object file, integer; X { X if (!Status (file)) X return Error (PIOError); X switch (Body (file)->file_type) X { X default: X Panic ("unknown file type in write\n"); X X case StringFile: X return Error (PInvFileAccess); X X case StreamFile: X if (Body (file)->f.f_ptr) X { X VOID fputc (BodyInteger (integer), Body (file)->f.f_ptr); X return TRUE; X } X return Error (PIOError); X } X } X Xstatic int PWriteHexString (file, string) Object file, string; X { X FILE *fp; X unsigned char *p = BodyString (string); X int l = lengthString (string); X X if (!Status (file)) X return Error (PIOError); X switch (Body (file)->file_type) X { X default: X Panic ("unknown file type in writestring\n"); X X case StringFile: X return Error (PInvFileAccess); X X case StreamFile: X fp = Body (file)->f.f_ptr; X while (l--) X { X int c = *p++; X static char hex[] = "0123456789abcdef"; X X fprintf (fp, "%c%c", hex[c >> 4], hex[c & 0xF]); X } X return TRUE; X } X } X Xstatic int PWriteString (file, string) Object file, string; X { X if (!Status (file) || !wCheck (file)) X return Error (PIOError); X switch (Body (file)->file_type) X { X default: X Panic ("unknown file type in writestring\n"); X X case StringFile: X return Error (PInvFileAccess); X X case StreamFile: X fprintf (Body (file)->f.f_ptr, X "%.*s", X lengthString (string), X BodyString (string)); X return TRUE; X } X } X Xstatic int PFlush () /* --- */ X { X VOID fflush (stdout); X HardUpdate (); /* yes, well ... you didn't see this... */ X return TRUE; X } X Xstatic int PFlushFile (file) Object file; X { X if (!Status (file)) X return Error (PIOError); X else if (wCheck (file)) X switch (Body (file)->file_type) X { X default: X Panic ("unknown file type in flushfile\n"); X return FALSE; /* shuts lint up */ X X case StringFile: break; X X case StreamFile: X if (Body (file)->f.f_ptr) X VOID fflush (Body (file)->f.f_ptr); X break; X } X else if (rCheck (file)) X while (Getch (file) != EOF) X ; X return TRUE; X } X Xstatic int PStatus (file) Object file; X { X return Push (OpStack, MakeBoolean (Status (file))); X } X Xstatic int PCurFile () /* --- file */ X { X int c = CountTo (File, ExecStack); X Object f; X X PanicIf (c < 0, "currentfile finds no run context"); X f = ExecStack->stack_body[Height (ExecStack) - c - 1]; X return Push (OpStack, Cvlit (f)); X } X Xstatic int PPrint (string) Object string; X { X int i, l = lengthString (string); X unsigned char *s = BodyString (string); X X for (i = 0; i < l; i++) X putchar (*s++); X /* PRINTF BUG: printf ("%.*s", lengthString (string), BodyString (string));*/ X return TRUE; X } X Xstatic int PEcho (res) Object res; X { X Echo (BodyBoolean (res)); X return TRUE; X } END_OF_FILE if test 17713 -ne `wc -c <'source/file.c'`; then echo shar: \"'source/file.c'\" unpacked with wrong size! fi # end of 'source/file.c' fi echo shar: End of archive 14 \(of 18\). cp /dev/null ark14isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 18 archives. rm -f ark[1-9]isdone ark[1-9][0-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0