/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#ifndef AWK_H
#define AWK_H
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libintl.h>
#include <limits.h>
typedef double Awkfloat;
typedef unsigned char uchar;
#define DEBUG
#ifdef DEBUG
/* uses have to be doubly parenthesized */
#else
#define dprintf(x)
#endif
extern char errbuf[200];
extern void error(int, char *);
/*CSTYLED*/
/*CSTYLED*/
/*CSTYLED*/
/*CSTYLED*/
#define CONT )
extern int compile_time; /* 1 if compiling, 0 if running */
/* ensure that there is extra 1 byte in the buffer */
#define expand_buf(p, n, r) \
if (*(n) == 0 || (r) >= (*(n) - 1)) r_expand_buf(p, n, r)
extern size_t record_size;
extern int errorflag;
extern int donefld; /* 1 if record broken into fields */
extern int donerec; /* 1 if record is valid (no fld has changed */
/* Cell: all information about a variable or constant */
typedef struct Cell {
unsigned tval;
/* type info: STR|NUM|ARR|FCN|FLD|CON|DONTFREE */
} Cell;
typedef struct { /* symbol table array */
} Array;
/* Cell.tval values: */
#define getfval(p) \
#define getsval(p) \
/* function types */
/* Node: parse tree is made of nodes, with Cell's at bottom */
typedef struct Node {
int ntype;
int nobj;
/* variable: actual size set by calling malloc */
} Node;
/* ctypes */
/* Cell subtypes: csub */
/* bool subtypes */
/* jump subtypes */
/* node types */
#define notlegal(n) \
typedef struct rrow {
int ltype;
int lval;
int *lfollow;
} rrow;
typedef struct fa {
int anchor;
int use;
int initstat;
int curstat;
int accept;
int reset;
} fa;
/* b.c */
/* lib.c */
extern void bracecheck(void);
extern void syminit(void);
extern void yyerror(char *);
extern void fldbld(void);
extern void recbld(void);
extern void newfld(int);
extern double errcheck(double, char *);
extern void fpecatch(int);
extern int donefld;
extern int donerec;
extern size_t record_size;
/* main.c */
extern int dbg;
extern int compile_time;
extern char radixpoint;
/* tran.c */
extern void syminit(void);
extern void freesymtab(Cell *);
/* run.c */
extern int paircnt;
#ifndef input
extern int input(void);
#endif
extern int yyparse(void);
/* proc */
#endif /* AWK_H */