9base

revived minimalist port of Plan 9 userland to Unix
git clone git://git.suckless.org/9base
Log | Files | Refs | README | LICENSE

proto.h (6187B)


      1 /****************************************************************
      2 Copyright (C) Lucent Technologies 1997
      3 All Rights Reserved
      4 
      5 Permission to use, copy, modify, and distribute this software and
      6 its documentation for any purpose and without fee is hereby
      7 granted, provided that the above copyright notice appear in all
      8 copies and that both that the copyright notice and this
      9 permission notice and warranty disclaimer appear in supporting
     10 documentation, and that the name Lucent Technologies or any of
     11 its entities not be used in advertising or publicity pertaining
     12 to distribution of the software without specific, written prior
     13 permission.
     14 
     15 LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
     16 INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
     17 IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
     18 SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     19 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
     20 IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
     21 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
     22 THIS SOFTWARE.
     23 ****************************************************************/
     24 
     25 #define getline p9getline
     26 
     27 extern	int	yywrap(void);
     28 extern	void	setfname(Cell *);
     29 extern	int	constnode(Node *);
     30 extern	char	*strnode(Node *);
     31 extern	Node	*notnull(Node *);
     32 extern	int	yyparse(void);
     33 
     34 extern	int	yylex(void);
     35 extern	void	startreg(void);
     36 extern	int	input(void);
     37 extern	void	unput(int);
     38 extern	void	unputstr(char *);
     39 extern	int	yylook(void);
     40 extern	int	yyback(int *, int);
     41 extern	int	yyinput(void);
     42 
     43 extern	void	*compre(char *);
     44 extern	int	hexstr(char **);
     45 extern	void	quoted(char **, char **, char *);
     46 extern	int	match(void *, char *, char *);
     47 extern	int	pmatch(void *, char *, char *);
     48 extern	int	nematch(void *, char *, char *);
     49 extern	int	countposn(char *, int);
     50 extern	void	overflow(void);
     51 
     52 extern	int	pgetc(void);
     53 extern	char	*cursource(void);
     54 
     55 extern	Node	*nodealloc(int);
     56 extern	Node	*exptostat(Node *);
     57 extern	Node	*node1(int, Node *);
     58 extern	Node	*node2(int, Node *, Node *);
     59 extern	Node	*node3(int, Node *, Node *, Node *);
     60 extern	Node	*node4(int, Node *, Node *, Node *, Node *);
     61 extern	Node	*stat3(int, Node *, Node *, Node *);
     62 extern	Node	*op2(int, Node *, Node *);
     63 extern	Node	*op1(int, Node *);
     64 extern	Node	*stat1(int, Node *);
     65 extern	Node	*op3(int, Node *, Node *, Node *);
     66 extern	Node	*op4(int, Node *, Node *, Node *, Node *);
     67 extern	Node	*stat2(int, Node *, Node *);
     68 extern	Node	*stat4(int, Node *, Node *, Node *, Node *);
     69 extern	Node	*celltonode(Cell *, int);
     70 extern	Node	*rectonode(void);
     71 extern	Node	*makearr(Node *);
     72 extern	Node	*pa2stat(Node *, Node *, Node *);
     73 extern	Node	*linkum(Node *, Node *);
     74 extern	void	defn(Cell *, Node *, Node *);
     75 extern	int	isarg(char *);
     76 extern	char	*tokname(int);
     77 extern	Cell	*(*proctab[])(Node **, int);
     78 extern	int	ptoi(void *);
     79 extern	Node	*itonp(int);
     80 
     81 extern	void	syminit(void);
     82 extern	void	arginit(int, char **);
     83 extern	void	envinit(char **);
     84 extern	Array	*makesymtab(int);
     85 extern	void	freesymtab(Cell *);
     86 extern	void	freeelem(Cell *, char *);
     87 extern	Cell	*setsymtab(char *, char *, double, unsigned int, Array *);
     88 extern	int	hash(char *, int);
     89 extern	void	rehash(Array *);
     90 extern	Cell	*lookup(char *, Array *);
     91 extern	double	setfval(Cell *, double);
     92 extern	void	funnyvar(Cell *, char *);
     93 extern	char	*setsval(Cell *, char *);
     94 extern	double	getfval(Cell *);
     95 extern	char	*getsval(Cell *);
     96 extern	char	*tostring(char *);
     97 extern	char	*qstring(char *, int);
     98 
     99 extern	void	recinit(unsigned int);
    100 extern	void	initgetrec(void);
    101 extern	void	makefields(int, int);
    102 extern	void	growfldtab(int n);
    103 extern	int	getrec(char **, int *, int);
    104 extern	void	nextfile(void);
    105 extern	int	readrec(char **buf, int *bufsize, FILE *inf);
    106 extern	char	*getargv(int);
    107 extern	void	setclvar(char *);
    108 extern	void	fldbld(void);
    109 extern	void	cleanfld(int, int);
    110 extern	void	newfld(int);
    111 extern	int	refldbld(char *, char *);
    112 extern	void	recbld(void);
    113 extern	Cell	*fieldadr(int);
    114 extern	void	yyerror(char *);
    115 extern	void	fpecatch(int);
    116 extern	void	bracecheck(void);
    117 extern	void	bcheck2(int, int, int);
    118 extern	void	SYNTAX(char *, ...);
    119 extern	void	FATAL(char *, ...);
    120 extern	void	WARNING(char *, ...);
    121 extern	void	error(void);
    122 extern	void	eprint(void);
    123 extern	void	bclass(int);
    124 extern	double	errcheck(double, char *);
    125 extern	int	isclvar(char *);
    126 extern	int	is_number(char *);
    127 
    128 extern	int	adjbuf(char **pb, int *sz, int min, int q, char **pbp, char *what);
    129 extern	void	run(Node *);
    130 extern	Cell	*execute(Node *);
    131 extern	Cell	*program(Node **, int);
    132 extern	Cell	*call(Node **, int);
    133 extern	Cell	*copycell(Cell *);
    134 extern	Cell	*arg(Node **, int);
    135 extern	Cell	*jump(Node **, int);
    136 extern	Cell	*getline(Node **, int);
    137 extern	Cell	*getnf(Node **, int);
    138 extern	Cell	*array(Node **, int);
    139 extern	Cell	*awkdelete(Node **, int);
    140 extern	Cell	*intest(Node **, int);
    141 extern	Cell	*matchop(Node **, int);
    142 extern	Cell	*boolop(Node **, int);
    143 extern	Cell	*relop(Node **, int);
    144 extern	void	tfree(Cell *);
    145 extern	Cell	*gettemp(void);
    146 extern	Cell	*field(Node **, int);
    147 extern	Cell	*indirect(Node **, int);
    148 extern	Cell	*substr(Node **, int);
    149 extern	Cell	*sindex(Node **, int);
    150 extern	int	format(char **, int *, char *, Node *);
    151 extern	Cell	*awksprintf(Node **, int);
    152 extern	Cell	*awkprintf(Node **, int);
    153 extern	Cell	*arith(Node **, int);
    154 extern	double	ipow(double, int);
    155 extern	Cell	*incrdecr(Node **, int);
    156 extern	Cell	*assign(Node **, int);
    157 extern	Cell	*cat(Node **, int);
    158 extern	Cell	*pastat(Node **, int);
    159 extern	Cell	*dopa2(Node **, int);
    160 extern	Cell	*split(Node **, int);
    161 extern	Cell	*condexpr(Node **, int);
    162 extern	Cell	*ifstat(Node **, int);
    163 extern	Cell	*whilestat(Node **, int);
    164 extern	Cell	*dostat(Node **, int);
    165 extern	Cell	*forstat(Node **, int);
    166 extern	Cell	*instat(Node **, int);
    167 extern	Cell	*bltin(Node **, int);
    168 extern	Cell	*printstat(Node **, int);
    169 extern	Cell	*nullproc(Node **, int);
    170 extern	FILE	*redirect(int, Node *);
    171 extern	FILE	*openfile(int, char *);
    172 extern	char	*filename(FILE *);
    173 extern	Cell	*closefile(Node **, int);
    174 extern	void	closeall(void);
    175 extern	Cell	*sub(Node **, int);
    176 extern	Cell	*gsub(Node **, int);
    177 
    178 extern	FILE	*popen(const char *, const char *);
    179 extern	int	pclose(FILE *);
    180