2 * proto.h - function prototype definitions for cawf(1)
6 * Copyright (c) 1991 Purdue University Research Foundation,
7 * West Lafayette, Indiana 47907. All rights reserved.
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.
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:
17 * 1. The author is not responsible for any consequences of use of
18 * this software, even if they arise from flaws in it.
20 * 2. The origin of this software must not be misrepresented, either
21 * by explicit claim or by omission. Credits must appear in the
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.
28 * 4. This notice may not be removed or altered.
43 * The following conditional rat's nest intends to:
45 * for MS-DOS #include <stdlib.h> and <malloc.h>. <stdlib.h> exists in
46 * MS-DOS so the STDLIB symbol should be defined and UNIX
49 * for Unix #include <stdlib.h> if the STDLIB symbol is defined. If
50 * STDLIB isn't defined, define a prototype for getenv().
51 * If the UNIX symbol is defined (and it should be) and if
52 * the MALLOCH symbol is defined, #include <malloc.h>; else
53 * define a prototype for malloc() if UNIX is defined and
54 * MALLOCH isn't. (The Unix <stdlib.h> usually defines the
55 * malloc() prototype.)
57 * for ??? Define a prototype for getenv() and #include <malloc.h>
58 * if neither STDLIB nor UNIX are defined. (What system is
67 #else /* not STDLIB */
68 char *getenv(char *name
);
72 # else /* not MALLOCH */
73 char *malloc(unsigned size
);
80 unsigned char *Asmcode(unsigned char **s
, unsigned char *c
);
81 int Asmname(unsigned char *s
, unsigned char *c
);
86 void Error(int t
, int l
, char *s1
, char *s2
);
87 void Error3(int len
, char *word
, char *sarg
, int narg
, char *msg
);
88 void Expand(unsigned char *line
);
90 unsigned char *Field(int n
, unsigned char *p
, int c
);
92 int Findchar(unsigned char *nm
, int l
, unsigned char *s
, int e
);
93 int Findhy(unsigned char *s
, int l
, int e
);
94 int Findmacro(unsigned char *p
, int e
);
95 int Findnum(unsigned char *n
, int v
, int e
);
96 int Findparms(unsigned char *n
);
97 int Findscale(int n
, double v
, int e
);
98 unsigned char *Findstr(unsigned char *nm
, unsigned char *s
, int e
);
99 int LenprtHF(unsigned char *s
, int p
, int t
);
100 int main(int argc
, char *argv
[]);
101 void Macro(unsigned char *inp
);
102 void Nreq(unsigned char *line
, int brk
);
103 void Free(unsigned char **p
);
104 unsigned char *Newstr(unsigned char *s
);
105 void Pass2(unsigned char *line
);
106 void Pass3(int len
, unsigned char *word
, unsigned char *sarg
, int narg
);
107 void regerror(char *s
);
108 unsigned char *reg(int paren
, int *flagp
);
109 unsigned char *regatom(int *flagp
);
110 unsigned char *regbranch(int *flagp
);
111 regexp
*regcomp(char *exp
);
112 void regdump(regexp
*r
);
113 int regexec(regexp
*prog
, unsigned char *string
);
114 void Stringput(unsigned char *s
);
115 int Str2word(unsigned char *s
, int len
);