-static var *intvar[NUM_INTERNAL_VARS];
-static chain beginseq, mainseq, endseq, *seq;
-static int nextrec, nextfile;
-static node *break_ptr, *continue_ptr;
-static rstream *iF;
-static xhash *vhash, *ahash, *fdhash, *fnhash;
-static const char *programname;
-static int lineno;
-static int is_f0_split;
-static int nfields;
-static var *Fields;
-static tsplitter fsplitter, rsplitter;
-static nvblock *cb;
-static char *pos;
-static char *buf;
-static int icase;
-static int exiting;
-
-static struct {
- uint32_t tclass;
- uint32_t info;
- char *string;
- double number;
- int lineno;
- int rollback;
-} ttt;
-/* It had even better name: 't'. Whoever knows what is it, please rename! */
-/* (actually it looks like unrelated stuff lumped together...) */
+struct globals {
+ /* former 'struct t' */
+ uint32_t t_info; /* often used */
+ uint32_t t_tclass;
+ char *t_string;
+ double t_double;
+ int t_lineno;
+ int t_rollback;
+
+ /* the rest */
+ smallint icase;
+ smallint exiting;
+ smallint nextrec;
+ smallint nextfile;
+ smallint is_f0_split;
+ chain beginseq, mainseq, endseq, *seq;
+ node *break_ptr, *continue_ptr;
+ rstream *iF;
+ xhash *vhash, *ahash, *fdhash, *fnhash;
+ const char *g_progname;
+ int g_lineno;
+ int nfields;
+ int maxfields; /* used in fsrealloc() only */
+ var *Fields;
+ nvblock *g_cb;
+ char *g_pos;
+ char *g_buf;
+
+ /* former statics from various functions */
+ char *split_f0__fstrings;
+
+ rstream next_input_file__rsm;
+ smallint next_input_file__files_happen;
+
+ smallint next_token__concat_inserted;
+ uint32_t next_token__save_tclass;
+ uint32_t next_token__save_info;
+ uint32_t next_token__ltclass;
+
+ var *evaluate__fnargs;
+ unsigned evaluate__seed;
+ regex_t evaluate__sreg;
+
+ var ptest__v;
+
+ tsplitter exec_builtin__tspl;
+
+ /* biggest members go last */
+ var *intvar[NUM_INTERNAL_VARS];
+ tsplitter fsplitter, rsplitter;
+};
+#define G (*ptr_to_globals)
+/* for debug */
+/* char Gsize[sizeof(G)]; ~0x240 */
+/* Trying to keep most of members accessible with short offsets: */
+/* char Gofs_seed[offsetof(struct globals, evaluate__seed)]; ~0xc0 */
+#define t_info (G.t_info )
+#define t_tclass (G.t_tclass )
+#define t_string (G.t_string )
+#define t_double (G.t_double )
+#define t_lineno (G.t_lineno )
+#define t_rollback (G.t_rollback )
+#define icase (G.icase )
+#define exiting (G.exiting )
+#define nextrec (G.nextrec )
+#define nextfile (G.nextfile )
+#define is_f0_split (G.is_f0_split )
+#define beginseq (G.beginseq )
+#define mainseq (G.mainseq )
+#define endseq (G.endseq )
+#define seq (G.seq )
+#define break_ptr (G.break_ptr )
+#define continue_ptr (G.continue_ptr)
+#define iF (G.iF )
+#define vhash (G.vhash )
+#define ahash (G.ahash )
+#define fdhash (G.fdhash )
+#define fnhash (G.fnhash )
+#define g_progname (G.g_progname )
+#define g_lineno (G.g_lineno )
+#define nfields (G.nfields )
+#define maxfields (G.maxfields )
+#define Fields (G.Fields )
+#define g_cb (G.g_cb )
+#define g_pos (G.g_pos )
+#define g_buf (G.g_buf )
+#define intvar (G.intvar )
+#define fsplitter (G.fsplitter )
+#define rsplitter (G.rsplitter )
+#define INIT_G() do { \
+ PTR_TO_GLOBALS = xzalloc(sizeof(G)); \
+ G.next_token__ltclass = TC_OPTERM; \
+ G.evaluate__seed = 1; \
+} while (0)
+