1 /* This is the specification of the generic part of the input package.
2 It can be instantiated by #defining or not #defining
3 INP_TYPE, INP_VAR, INP_READ_IN_ONE, and INP_NPUSHBACK.
4 INP_TYPE is the type of the variable INP_VAR, which contains
5 all values the user wants to save when an InsertFile is done,
6 and restored when an input stream is continued after a suspend.
7 For instance, line numbers and position within a line might
9 Not defining INP_TYPE has the effect that the instantiation is
10 done without saving and restoring INP_VAR.
11 Defining INP_READ_IN_ONE has the effect that files will be read
12 completely with one "read". Only use this if you have lots of
13 memory. Not defining it causes files to be read in blocks, with
15 INP_NPUSHBACK is the number of PushBacks that are guaranteed
16 to work. Its default value is 1.
21 /* INPUT PRIMITIVES */
23 #define LoadChar(dest) ((void)((dest = *_ipp++) || (dest = loadbuf())))
24 #define PushBack() (--_ipp)
25 #define ChPushBack(ch) (*--_ipp = (ch))
27 /* EOI may be defined as -1 in most programs but the character -1 may
28 be expanded to the int -1 which causes troubles with indexing.
34 _PROTOTYPE(int loadbuf, (void));
35 _PROTOTYPE(int AtEoIT, (void));
36 _PROTOTYPE(int AtEoIF, (void));
37 _PROTOTYPE(int InsertFile, (char *, char **, char **));
38 _PROTOTYPE(int InsertText, (char *, int));
40 /* int InsertFile(filename, table, result)
45 This function suspends input from the current input stream. The next
46 characters are obtained from the file indicated by "filename". This file
47 will be looked for in the directories, mentioned in the null-terminated
48 list indicated by "table". It returns 1 if it succeeds, 0 if it fails.
49 "result" will contain the full path if InsertFile returns 1.
51 int InsertText(text, length)
54 This funtion suspends input from the current input stream. The next
55 input characters are obtained from the string indicated by "text",
56 whose length is indicated by "length".
57 It returns 1 if it succeeds, 0 if it fails.