aboutsummaryrefslogtreecommitdiff
path: root/awk.h
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2019-11-10 21:19:18 +0200
committerArnold D. Robbins <arnold@skeeve.com>2019-11-10 21:19:18 +0200
commit108224b4845d7ac622cdc3dcbe47b463e4253a4b (patch)
tree7dd5a7746be9b5f7b62621d2037c7e7763926437 /awk.h
parentc879fbf013b5314c27fa236c987ea56a521420e6 (diff)
downloadone-true-awk-108224b4845d7ac622cdc3dcbe47b463e4253a4b.tar.gz
Convert variables to bool and enum.
Diffstat (limited to 'awk.h')
-rw-r--r--awk.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/awk.h b/awk.h
index fa76ffc..bede1b0 100644
--- a/awk.h
+++ b/awk.h
@@ -24,6 +24,7 @@ THIS SOFTWARE.
#include <assert.h>
#include <stdint.h>
+#include <stdbool.h>
typedef double Awkfloat;
@@ -48,8 +49,13 @@ typedef unsigned char uschar;
# define dprintf(x)
#endif
-extern int compile_time; /* 1 if compiling, 0 if running */
-extern int safe; /* 0 => unsafe, 1 => safe */
+extern enum compile_states {
+ RUNNING,
+ COMPILING,
+ ERROR_PRINTING
+} compile_time;
+
+extern bool safe; /* false => unsafe, true => safe */
#define RECSIZE (8 * 1024) /* sets limit on records, fields, etc., etc. */
extern int recsize; /* size of current record, orig RECSIZE */
@@ -70,8 +76,8 @@ extern Awkfloat *RLENGTH;
extern char *record; /* points to $0 */
extern int lineno; /* line number in awk program */
extern int errorflag; /* 1 if error has occurred */
-extern int donefld; /* 1 if record broken into fields */
-extern int donerec; /* 1 if record is valid (no fld has changed */
+extern bool donefld; /* true if record broken into fields */
+extern bool donerec; /* true if record is valid (no fld has changed */
extern char inputFS[]; /* FS at time of input, for field splitting */
extern int dbg;
@@ -237,7 +243,7 @@ typedef struct fa {
uschar *restr;
int **posns;
int state_count;
- int anchor;
+ bool anchor;
int use;
int initstat;
int curstat;