xref: /minix/minix/commands/cawf/proto.h (revision 83133719)
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 
32 #ifdef	UNIX
33 # ifdef	USG
34 #include <string.h>
35 # else	/* not USG */
36 #include <strings.h>
37 # endif	/* USG */
38 #else	/* not UNIX */
39 #include <string.h>
40 #endif	/* UNIX */
41 
42 /*
43  * The following conditional rat's nest intends to:
44  *
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
47  *		shouldn't be.
48  *
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.)
56  *
57  * for ???	Define a prototype for getenv() and #include <malloc.h>
58  *		if neither STDLIB nor UNIX are defined.  (What system is
59  *		this?)
60  */
61 
62 #ifdef	STDLIB
63 #include <stdlib.h>
64 # ifndef	UNIX
65 #include <malloc.h>
66 # endif		/* UNIX */
67 #else	/* not STDLIB */
68 char *getenv(char *name);
69 # ifdef	UNIX
70 #  ifdef	MALLOCH
71 #include <malloc.h>
72 #  else		/* not MALLOCH */
73 char *malloc(unsigned size);
74 #  endif	/* MALLOCH */
75 # else	/* not UNIX */
76 #include <malloc.h>
77 # endif	/* UNIX */
78 #endif	/* STDLIB */
79 
80 unsigned char *Asmcode(unsigned char **s, unsigned char *c);
81 int Asmname(unsigned char *s, unsigned char *c);
82 void Charput(int c);
83 int Delmacro(int mx);
84 int Defdev();
85 void Delstr(int sx);
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);
89 void Delnum(int nx);
90 unsigned char *Field(int n, unsigned char *p, int c);
91 void Endword();
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);
116