2 /********************************************
4 copyright 1991, Michael D. Brennan
6 This is a source file for mawk, an implementation of
7 the AWK programming language.
9 Mawk is distributed without warranty under the terms of
10 the GNU General Public License, version 2, 1991.
11 ********************************************/
14 * Revision 1.2 1995/06/18 19:42:16 mike
15 * Remove some redundant declarations and add some prototypes
17 * Revision 1.1.1.1 1993/07/03 18:58:12 mike
20 * Revision 5.2 1992/01/06 08:10:24 brennan
21 * set_binmode() proto for MSDOS
23 * Revision 5.1 91/12/05 07:59:16 brennan
34 void PROTO( set_field0, (char *, unsigned) ) ;
35 void PROTO( split_field0, (void) ) ;
36 int PROTO( space_split, (char *, unsigned) ) ;
37 int PROTO( re_split, (char *, PTR) ) ;
38 int PROTO( null_split, (char *)) ;
39 void PROTO( field_assign, (CELL*, CELL *) ) ;
40 char *PROTO( is_string_split, (PTR , unsigned *) ) ;
41 void PROTO( slow_cell_assign, (CELL*, CELL*)) ;
42 CELL *PROTO( slow_field_ptr, (int)) ;
43 int PROTO( field_addr_to_index, (CELL*)) ;
44 void PROTO( set_binmode, (int)) ;
48 extern CELL field[FBANK_SZ+NUM_PFIELDS] ;
49 /* $0, $1 ... $(MAX_SPLIT), NF, RS, RS, CONVFMT, OFMT */
51 /* more fields if needed go here */
52 extern CELL *fbank[NUM_FBANK] ; /* fbank[0] == field */
54 /* index to CELL * for a field */
55 #define field_ptr(i) ((i)<=MAX_SPLIT?field+(i):slow_field_ptr(i))
57 /* the pseudo fields, assignment has side effects */
58 #define NF (field+MAX_SPLIT+1) /* must be first */
59 #define RS (field+MAX_SPLIT+2)
60 #define FS (field+MAX_SPLIT+3)
61 #define CONVFMT (field+MAX_SPLIT+4)
62 #define OFMT (field+MAX_SPLIT+5) /* must be last */
64 #define LAST_PFIELD OFMT
66 /* some compilers choke on (NF-field) in a case statement
67 even though it's constant so ...
69 #define NF_field (MAX_SPLIT+1)
70 #define RS_field (MAX_SPLIT+2)
71 #define FS_field (MAX_SPLIT+3)
72 #define CONVFMT_field (MAX_SPLIT+4)
73 #define OFMT_field (MAX_SPLIT+5)
76 extern int nf ; /* shadows NF */
78 /* a shadow type for RS and FS */
88 PTR ptr ; /* STRING* or RE machine* */
91 extern SEPARATOR rs_shadow ;
92 extern CELL fs_shadow ;
95 /* types for splitting overflow */
102 extern SPLIT_OV *split_ov_list ;