1 | /*
|
---|
2 | * proto.h - function prototype definitions for cawf(1)
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (c) 1991 Purdue University Research Foundation,
|
---|
7 | * West Lafayette, Indiana 47907. All rights reserved.
|
---|
8 | *
|
---|
9 | * Written by Victor A. Abell <abe@mace.cc.purdue.edu>, Purdue
|
---|
10 | * University Computing Center. Not derived from licensed software;
|
---|
11 | * derived from awf(1) by Henry Spencer of the University of Toronto.
|
---|
12 | *
|
---|
13 | * Permission is granted to anyone to use this software for any
|
---|
14 | * purpose on any computer system, and to alter it and redistribute
|
---|
15 | * it freely, subject to the following restrictions:
|
---|
16 | *
|
---|
17 | * 1. The author is not responsible for any consequences of use of
|
---|
18 | * this software, even if they arise from flaws in it.
|
---|
19 | *
|
---|
20 | * 2. The origin of this software must not be misrepresented, either
|
---|
21 | * by explicit claim or by omission. Credits must appear in the
|
---|
22 | * documentation.
|
---|
23 | *
|
---|
24 | * 3. Altered versions must be plainly marked as such, and must not
|
---|
25 | * be misrepresented as being the original software. Credits must
|
---|
26 | * appear in the documentation.
|
---|
27 | *
|
---|
28 | * 4. This notice may not be removed or altered.
|
---|
29 | */
|
---|
30 |
|
---|
31 | #include "ansi.h"
|
---|
32 |
|
---|
33 | #ifdef UNIX
|
---|
34 | # ifdef USG
|
---|
35 | #include <string.h>
|
---|
36 | # else /* not USG */
|
---|
37 | #include <strings.h>
|
---|
38 | # endif /* USG */
|
---|
39 | #else /* not UNIX */
|
---|
40 | #include <string.h>
|
---|
41 | #endif /* UNIX */
|
---|
42 |
|
---|
43 | /*
|
---|
44 | * The following conditional rat's nest intends to:
|
---|
45 | *
|
---|
46 | * for MS-DOS #include <stdlib.h> and <malloc.h>. <stdlib.h> exists in
|
---|
47 | * MS-DOS so the STDLIB symbol should be defined and UNIX
|
---|
48 | * shouldn't be.
|
---|
49 | *
|
---|
50 | * for Unix #include <stdlib.h> if the STDLIB symbol is defined. If
|
---|
51 | * STDLIB isn't defined, define a prototype for getenv().
|
---|
52 | * If the UNIX symbol is defined (and it should be) and if
|
---|
53 | * the MALLOCH symbol is defined, #include <malloc.h>; else
|
---|
54 | * define a prototype for malloc() if UNIX is defined and
|
---|
55 | * MALLOCH isn't. (The Unix <stdlib.h> usually defines the
|
---|
56 | * malloc() prototype.)
|
---|
57 | *
|
---|
58 | * for ??? Define a prototype for getenv() and #include <malloc.h>
|
---|
59 | * if neither STDLIB nor UNIX are defined. (What system is
|
---|
60 | * this?)
|
---|
61 | */
|
---|
62 |
|
---|
63 | #ifdef STDLIB
|
---|
64 | #include <stdlib.h>
|
---|
65 | # ifndef UNIX
|
---|
66 | #include <malloc.h>
|
---|
67 | # endif /* UNIX */
|
---|
68 | #else /* not STDLIB */
|
---|
69 | _PROTOTYPE(char *getenv,(char *name));
|
---|
70 | # ifdef UNIX
|
---|
71 | # ifdef MALLOCH
|
---|
72 | #include <malloc.h>
|
---|
73 | # else /* not MALLOCH */
|
---|
74 | _PROTOTYPE(char *malloc,(unsigned size));
|
---|
75 | # endif /* MALLOCH */
|
---|
76 | # else /* not UNIX */
|
---|
77 | #include <malloc.h>
|
---|
78 | # endif /* UNIX */
|
---|
79 | #endif /* STDLIB */
|
---|
80 |
|
---|
81 | _PROTOTYPE(unsigned char *Asmcode,(unsigned char **s, unsigned char *c));
|
---|
82 | _PROTOTYPE(int Asmname,(unsigned char *s, unsigned char *c));
|
---|
83 | _PROTOTYPE(void Charput,(int c));
|
---|
84 | _PROTOTYPE(int Delmacro,(int mx));
|
---|
85 | _PROTOTYPE(int Defdev,());
|
---|
86 | _PROTOTYPE(void Delstr,(int sx));
|
---|
87 | _PROTOTYPE(void Error,(int t, int l, char *s1, char *s2));
|
---|
88 | _PROTOTYPE(void Error3,(int len, char *word, char *sarg, int narg, char *msg));
|
---|
89 | _PROTOTYPE(void Expand,(unsigned char *line));
|
---|
90 | _PROTOTYPE(void Delnum,(int nx));
|
---|
91 | _PROTOTYPE(unsigned char *Field,(int n, unsigned char *p, int c));
|
---|
92 | _PROTOTYPE(void Endword,());
|
---|
93 | _PROTOTYPE(int Findchar,(unsigned char *nm, int l, unsigned char *s, int e));
|
---|
94 | _PROTOTYPE(int Findhy,(unsigned char *s, int l, int e));
|
---|
95 | _PROTOTYPE(int Findmacro,(unsigned char *p, int e));
|
---|
96 | _PROTOTYPE(int Findnum,(unsigned char *n, int v, int e));
|
---|
97 | _PROTOTYPE(int Findparms,(unsigned char *n));
|
---|
98 | _PROTOTYPE(int Findscale,(int n, double v, int e));
|
---|
99 | _PROTOTYPE(unsigned char *Findstr,(unsigned char *nm, unsigned char *s, int e));
|
---|
100 | _PROTOTYPE(int getopt,(int argc, char **argv, char *opts));
|
---|
101 | _PROTOTYPE(int LenprtHF,(unsigned char *s, int p, int t));
|
---|
102 | _PROTOTYPE(int main,(int argc, char *argv[]));
|
---|
103 | _PROTOTYPE(void Macro,(unsigned char *inp));
|
---|
104 | _PROTOTYPE(void Nreq,(unsigned char *line, int brk));
|
---|
105 | _PROTOTYPE(void Free,(unsigned char **p));
|
---|
106 | _PROTOTYPE(unsigned char *Newstr,(unsigned char *s));
|
---|
107 | _PROTOTYPE(void Pass2,(unsigned char *line));
|
---|
108 | _PROTOTYPE(void Pass3,(int len, unsigned char *word, unsigned char *sarg, int narg));
|
---|
109 | _PROTOTYPE(void regerror,(char *s));
|
---|
110 | _PROTOTYPE(unsigned char *reg,(int paren, int *flagp));
|
---|
111 | _PROTOTYPE(unsigned char *regatom,(int *flagp));
|
---|
112 | _PROTOTYPE(unsigned char *regbranch,(int *flagp));
|
---|
113 | _PROTOTYPE(regexp *regcomp,(char *exp));
|
---|
114 | _PROTOTYPE(void regdump,(regexp *r));
|
---|
115 | _PROTOTYPE(int regexec,(regexp *prog, unsigned char *string));
|
---|
116 | _PROTOTYPE(void Stringput,(unsigned char *s));
|
---|
117 | _PROTOTYPE(int Str2word,(unsigned char *s, int len));
|
---|