mawk-1.3.4-20200120/0000755000175100001440000000000013611425173012064 5ustar tomusersmawk-1.3.4-20200120/memory.c0000644000175100001440000000362311500456220013534 0ustar tomusers/******************************************** memory.c copyright 2009,2010 Thomas E. Dickey copyright 1991-1992,1993 Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: memory.c,v 1.8 2010/12/10 17:00:00 tom Exp $ * @Log: memory.c,v @ * Revision 1.2 1993/07/17 13:23:08 mike * indent and general code cleanup * * Revision 1.1.1.1 1993/07/03 18:58:17 mike * move source to cvs * * Revision 5.2 1993/01/01 21:30:48 mike * split new_STRING() into new_STRING and new_STRING0 * * Revision 5.1 1991/12/05 07:56:21 brennan * 1.1 pre-release * */ /* memory.c */ #include "mawk.h" #include "memory.h" STRING null_str = {0, 1, ""}; static STRING * xnew_STRING(size_t len) { STRING *sval = (STRING *) zmalloc(len + STRING_OH); sval->len = len; sval->ref_cnt = 1; return sval; } /* allocate space for a STRING */ STRING * new_STRING0(size_t len) { if (len == 0) { null_str.ref_cnt++; return &null_str; } else { STRING *sval = xnew_STRING(len); sval->str[len] = 0; return sval; } } /* * Create a new string which may contain embedded nulls. */ STRING * new_STRING1(const char *s, size_t len) { if (len == 0) { null_str.ref_cnt++; return &null_str; } else { STRING *sval = xnew_STRING(len); memcpy(sval->str, s, len); sval->str[len] = 0; return sval; } } /* convert char* to STRING* */ STRING * new_STRING(const char *s) { if (s[0] == 0) { null_str.ref_cnt++; return &null_str; } else { STRING *sval = xnew_STRING(strlen(s)); strcpy(sval->str, s); return sval; } } #ifdef DEBUG void DB_free_STRING(STRING * sval) { if (--sval->ref_cnt == 0 && sval != &null_str) { zfree(sval, sval->len + STRING_OH); } } #endif mawk-1.3.4-20200120/sizes.h0000644000175100001440000000345713171251112013372 0ustar tomusers/******************************************** sizes.h copyright 2009-2014,2017 Thomas E. Dickey copyright 1991-1995,2014. Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: sizes.h,v 1.11 2017/10/17 00:43:54 tom Exp $ */ /* sizes.h */ #ifndef SIZES_H #define SIZES_H #include "config.h" #ifndef MAX__INT #include #define MAX__INT INT_MAX #define MAX__LONG LONG_MAX #define MAX__UINT UINT_MAX #endif /* MAX__INT */ #if MAX__INT <= 0x7fff #define SHORT_INTS #define INT_FMT "%ld" typedef long Int; #define Max_Int MAX__LONG #else #define INT_FMT "%d" typedef int Int; #define Max_Int MAX__INT #endif #if MAX__UINT <= 0xffff #define SHORT_UINTS #define UINT_FMT "%lu" typedef unsigned long UInt; #define Max_UInt MAX__ULONG #else #define UINT_FMT "%u" typedef unsigned UInt; #define Max_UInt MAX__UINT #endif #define EVAL_STACK_SIZE 1024 /* initial size , can grow */ /* * FBANK_SZ, the number of fields at startup, must be a power of 2. * */ #define FBANK_SZ 1024 #define FB_SHIFT 10 /* lg(FBANK_SZ) */ /* * hardwired limit on sprintf size, can be overridden with -Ws=xxx * TBD to remove hard wired limit */ #define SPRINTF_LIMIT 8192 #define BUFFSZ 4096 /* starting buffer size for input files, grows if necessary */ #ifdef MSDOS /* trade some space for IO speed */ #undef BUFFSZ #define BUFFSZ 8192 /* maximum input buffers that will fit in 64K */ #define MAX_BUFFS ((int)(0x10000L/BUFFSZ) - 1) #endif #define HASH_PRIME 53 #define A_HASH_PRIME 199 #define MAX_COMPILE_ERRORS 5 /* quit if more than 4 errors */ #endif /* SIZES_H */ mawk-1.3.4-20200120/jmp.h0000644000175100001440000000240111500456220013010 0ustar tomusers/******************************************** jmp.h copyright 2009,2010 Thomas E. Dickey copyright 1991, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: jmp.h,v 1.5 2010/12/10 17:00:00 tom Exp $ * @Log: jmp.h,v @ * Revision 1.2 1995/04/21 14:20:19 mike * move_level variable to fix bug in arglist patching of moved code. * * Revision 1.1.1.1 1993/07/03 18:58:15 mike * move source to cvs * * Revision 5.2 1993/01/09 19:03:44 mike * code_pop checks if the resolve_list needs relocation * * Revision 5.1 1991/12/05 07:59:24 brennan * 1.1 pre-release * */ #ifndef MAWK_JMP_H #define MAWK_JMP_H #include "types.h" #include "symtype.h" void BC_new(void); void BC_insert(int, INST *); void BC_clear(INST *, INST *); void code_push(INST *, unsigned, int, FBLOCK *); unsigned code_pop(INST *); void code_jmp(int, INST *); void patch_jmp(INST *); extern int code_move_level; /* used to as one part of unique identification of context when moving code. Global for communication with parser. */ #endif /* MAWK_JMP_H */ mawk-1.3.4-20200120/regexp_system.c0000644000175100001440000001674312404431453015136 0ustar tomusers/* regexp_system.c copyright 2009-2010,2014 Thomas E. Dickey copyright 2005, Aleksey Cheusov This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. */ /* * $MawkId: regexp_system.c,v 1.36 2014/09/11 23:41:31 tom Exp $ */ #include #include #include #include #include #include #include "regexp.h" typedef struct { regex_t re; char *regexp; } mawk_re_t; static mawk_re_t *last_used_regexp = NULL; static int err_code = 0; #define AT_LAST() ((size_t) (source - base) >= limit) #define MORE_CH() ((size_t) (source - base) < limit) #define NEXT_CH() (char) (MORE_CH() ? *source : 0) #define LIMITED() (char) (MORE_CH() ? *source++ : 0) #define IgnoreNull() errmsg(-1, "ignoring embedded null in pattern") #define IgnoreEscaped() errmsg(-1, "ignoring escaped '%c' in pattern", ch) /* * Keep track, for octal and hex escapes: * octal: 2,3,4 * hex: 3,4 */ #define MORE_DIGITS (escape < 4) static char * prepare_regexp(char *regexp, const char *source, size_t limit) { const char *base = source; const char *range = 0; int escape = 0; int cclass = 0; int radix = 0; int state = 0; char *tail = regexp; char ch; int value = 0; int added; TRACE(("in : \"%s\"\n", base)); while ((ch = LIMITED()) != 0) { if (escape) { added = 0; ++escape; switch (radix) { case 16: switch (ch) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': value = (value << 4) | (ch - '0'); state = MORE_DIGITS; added = 1; break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': value = (value << 4) | (10 + (ch - 'a')); state = MORE_DIGITS; added = 1; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': value = (value << 4) | (10 + (ch - 'A')); state = MORE_DIGITS; added = 1; break; default: state = 0; /* number ended */ break; } if (state) { continue; } else { escape = 0; radix = 0; if (value) { *tail++ = (char) value; } else { IgnoreNull(); } if (added) /* ate the current character? */ continue; } break; case 8: switch (ch) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': value = (value << 3) | (ch - '0'); state = MORE_DIGITS; added = 1; break; default: state = 0; /* number ended */ break; } if (state) { continue; } else { escape = 0; radix = 0; if (value) { *tail++ = (char) value; } else { IgnoreNull(); } if (added) /* ate the current character? */ continue; } break; } switch (ch) { case '\\': /* FALLTHRU */ case '[': /* FALLTHRU */ case '(': /* FALLTHRU */ case ')': /* FALLTHRU */ case '$': /* FALLTHRU */ case '?': /* FALLTHRU */ case '*': /* FALLTHRU */ case '.': /* FALLTHRU */ case '+': /* FALLTHRU */ case '{': /* FALLTHRU */ case '|': /* FALLTHRU */ *tail++ = '\\'; *tail++ = ch; break; case ']': if (range) { IgnoreEscaped(); } else { *tail++ = ch; } break; case 'n': *tail++ = '\n'; break; case 't': *tail++ = '\t'; break; case 'f': *tail++ = '\f'; break; case 'b': *tail++ = '\b'; break; case 'r': *tail++ = '\r'; break; case 'a': *tail++ = '\07'; break; case 'v': *tail++ = '\013'; break; case 'x': radix = 16; value = 0; state = 1; continue; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': radix = 8; value = (ch - '0'); state = 1; continue; case '^': if (tail - range == 1) *tail++ = '\\'; *tail++ = ch; break; default: *tail++ = ch; break; } escape = 0; } else { switch (ch) { case '\\': if (AT_LAST()) { errmsg(-1, "dangling backslash"); *tail++ = '\\'; *tail++ = '\\'; } else { escape = 1; } break; case '[': if (range == 0) { range = tail; } else { if (NEXT_CH() == ':') { cclass = ':'; } } *tail++ = ch; break; case ']': if (range != 0) { if (cclass != 0) { if (source[-2] == cclass) { cclass = 0; } } else if (tail == range + 1 || (tail == range + 2 && range[1] == '^') || (tail > range + 2)) { range = 0; } } *tail++ = ch; break; case '{': if (range == 0 && ((tail == regexp) || (tail[-1] == '*') || (tail[-1] == '?'))) { *tail++ = '\\'; *tail++ = ch; break; } /* FALLTHRU */ case '}': if (range == 0) *tail++ = '\\'; *tail++ = ch; break; default: *tail++ = ch; break; } } } *tail = '\0'; TRACE(("out: \"%s\"\n", regexp)); return tail; } void * REcompile(char *regexp, size_t len) { mawk_re_t *re = (mawk_re_t *) malloc(sizeof(mawk_re_t)); if (re != 0) { size_t need = (len * 2) + 8; /* might double, with escaping */ char *new_regexp = (char *) malloc(need); if (new_regexp != NULL) { char *buffer = new_regexp; assert(need > len); *buffer++ = '('; buffer = prepare_regexp(buffer, regexp, len); *buffer++ = ')'; *buffer = '\0'; assert(strlen(new_regexp) < need); last_used_regexp = re; memset(re, 0, sizeof(mawk_re_t)); re->regexp = strdup(new_regexp); err_code = regcomp(&re->re, new_regexp, REG_EXTENDED); free(new_regexp); if (err_code) { re = NULL; } } else { free(re); re = NULL; } } return re; } void REdestroy(PTR ptr) { (void) ptr; } /* * Test the regular expression in 'q' against the string 'str'. * The 'len' parameter is ignored since POSIX regular expressions assume 'str' * is a null-terminated string. */ int REtest(char *str, size_t str_len GCC_UNUSED, PTR q) { mawk_re_t *re = (mawk_re_t *) q; TRACE(("REtest: \"%s\" ~ /%s/", str, re->regexp)); last_used_regexp = re; if (regexec(&re->re, str, (size_t) 0, NULL, 0)) { TRACE(("=1\n")); return 0; } else { TRACE(("=0\n")); return 1; } } #define MAX_MATCHES 100 char * REmatch(char *str, size_t str_len GCC_UNUSED, PTR q, size_t *lenp, int no_bol) { mawk_re_t *re = (mawk_re_t *) q; regmatch_t match[MAX_MATCHES]; int flags = (no_bol ? REG_NOTBOL : 0); TRACE(("REmatch: %s \"%s\" ~ /%s/", no_bol ? "any" : "1st", str, re->regexp)); last_used_regexp = re; if (!regexec(&re->re, str, (size_t) MAX_MATCHES, match, flags)) { *lenp = (size_t) (match[0].rm_eo - match[0].rm_so); TRACE(("=%i/%lu\n", match[0].rm_so, (unsigned long) *lenp)); return str + match[0].rm_so; } else { TRACE(("=0\n")); return NULL; } } void REmprint(void *m, FILE *f) { (void) m; (void) f; /* no debugging code available */ abort(); } static char error_buffer[2048]; const char * REerror(void) { if (last_used_regexp) { (void) regerror(err_code, &last_used_regexp->re, error_buffer, sizeof(error_buffer)); } else { char *msg = strerror(errno); const char fmt[] = "malloc failed: %.*s"; sprintf(error_buffer, fmt, (int) (sizeof(error_buffer) - sizeof(fmt) - strlen(msg)), msg); } return error_buffer; } mawk-1.3.4-20200120/split.c0000644000175100001440000001617613611306543013375 0ustar tomusers/******************************************** split.c copyright 2008-2014,2020 Thomas E. Dickey copyright 1991-1996,2014 Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: split.c,v 1.30 2020/01/20 11:22:11 tom Exp $ * @Log: split.c,v @ * Revision 1.3 1996/02/01 04:39:42 mike * dynamic array scheme */ /* split.c */ #include "mawk.h" #include "split.h" #include "symtype.h" #include "bi_vars.h" #include "bi_funct.h" #include "memory.h" #include "scan.h" #include "regexp.h" #include "repl.h" #include "field.h" #ifdef NO_LEAKS #define SP_SIZE 4 /* exercises split_block_list code */ #else #define SP_SIZE 2048 #endif typedef struct split_block { STRING *strings[SP_SIZE]; struct split_block *link; } Split_Block_Node; static Split_Block_Node split_block_base; static Split_Block_Node *split_block_list = &split_block_base; /* usually the list is of size 1 the list never gets smaller than size 1 this function returns a bigger list to size 1 */ static void spb_list_shrink(void) { Split_Block_Node *p = split_block_list->link; split_block_list->link = 0; while (p) { Split_Block_Node *hold = p; p = p->link; zfree(hold, sizeof(Split_Block_Node)); } } /* this function is passed a pointer to the tail of the list, adds a new node and returns the new tail This makes the list one node bigger */ static Split_Block_Node * grow_sp_list(Split_Block_Node * tail) { tail->link = (Split_Block_Node *) zmalloc(sizeof(Split_Block_Node)); tail = tail->link; tail->link = 0; return tail; } /* * Split string s of length slen on SPACE without changing s. * Load the pieces into STRINGS * return the number of pieces */ size_t space_split(const char *s, size_t slen) { size_t cnt = 0; const char *end = s + slen; Split_Block_Node *node_p = split_block_list; unsigned idx = 0; while (1) { /* eat space */ while (scan_code[*(const unsigned char *) s] == SC_SPACE) s++; if (s == end) return cnt; /* find one field */ { const char *q = s++; /* q is front of field */ while (s < end && scan_code[*(const unsigned char *) s] != SC_SPACE) s++; /* create and store the string field */ node_p->strings[idx] = new_STRING1(q, (size_t) (s - q)); cnt++; if (++idx == SP_SIZE) { idx = 0; node_p = grow_sp_list(node_p); } } } /* not reached */ } size_t re_split(char *s, size_t slen, PTR re) { size_t cnt = 0; const char *end = s + slen; Split_Block_Node *node_p = split_block_list; unsigned idx = 0; int no_bol = 0; if (slen == 0) return 0; while (s < end) { size_t mlen; char *m = re_pos_match(s, (size_t) (end - s), re, &mlen, no_bol); if (m) { /* stuff in front of match is a field, might have length zero */ node_p->strings[idx] = new_STRING1(s, (size_t) (m - s)); cnt++; if (++idx == SP_SIZE) { idx = 0; node_p = grow_sp_list(node_p); } s = m + mlen; no_bol = 1; } else { /* no match so last field is what's left */ node_p->strings[idx] = new_STRING1(s, (size_t) (end - s)); /* done so don't need to increment idx */ return ++cnt; } } /* last match at end of s, so last field is "" */ node_p->strings[idx] = new_STRING0(0); return ++cnt; } /* match a string with a regular expression, but * only matches of positive length count * input a string str and its length * return is match point else 0 if no match * length of match is returned in *lenp */ char * re_pos_match(char *str, size_t str_len, PTR re, size_t *lenp, int no_bol) { const char *end = str + str_len; while (str < end) { char *match = REmatch(str, (size_t) (end - str), cast_to_re(re), lenp, no_bol); if (match) { if (*lenp) { /* match of positive length so done */ return match; } else { /* match but zero length, move str forward and try again */ /* note this match must have occurred at front of str */ str = match + 1; no_bol = 1; } } else { /* no match */ *lenp = 0; return 0; } } *lenp = 0; return 0; } /* like space split but splits s into single character strings */ size_t null_split(const char *s, size_t slen) { const char *end = s + slen; Split_Block_Node *node_p = split_block_list; unsigned idx = 0; while (s < end) { node_p->strings[idx] = new_STRING1(s++, 1); if (++idx == SP_SIZE) { idx = 0; node_p = grow_sp_list(node_p); } } return slen; } /* The caller knows there are cnt STRING* in the split_block_list * buffers. This function uses them to make CELLs in cp[] * The target CELLs are virgin, they don't need to be * destroyed * */ void transfer_to_array(CELL cp[], size_t cnt) { Split_Block_Node *node_p = split_block_list; unsigned idx = 0; while (cnt > 0) { cp->type = C_MBSTRN; cp->ptr = (PTR) node_p->strings[idx]; cnt--; cp++; if (++idx == SP_SIZE) { idx = 0; node_p = node_p->link; } } if (node_p != split_block_list) spb_list_shrink(); } /* like above but transfers the saved pieces to $1, $2 ... $cnt * The target CELLs may be string type so need to be destroyed * The caller has made sure the target CELLs exist * */ void transfer_to_fields(size_t cnt) { CELL *fp = &field[1]; /* start with $1 */ CELL *fp_end = &field[FBANK_SZ]; Split_Block_Node *node_p = split_block_list; unsigned idx = 0; unsigned fb_idx = 0; while (cnt > 0) { cell_destroy(fp); fp->type = C_MBSTRN; fp->ptr = (PTR) node_p->strings[idx]; cnt--; if (++idx == SP_SIZE) { idx = 0; node_p = node_p->link; } if (++fp == fp_end) { fb_idx++; fp = &fbankv[fb_idx][0]; fp_end = fp + FBANK_SZ; } } if (node_p != split_block_list) spb_list_shrink(); } /* * split(s, X, r) * split s into array X on r * * mawk state is EXECUTION sp points at top of eval_stack[] * * entry: sp[0] holds r * sp[-1] pts at X * sp[-2] holds s * exit : sp is 2 less, sp[0] is C_DOUBLE CELL with value equal to the number of split pieces */ CELL * bi_split(CELL *sp) { size_t cnt = 0; /* the number of pieces */ if (sp->type < C_RE) cast_for_split(sp); /* can be C_RE, C_SPACE or C_SNULL */ sp -= 2; if (sp->type < C_STRING) cast1_to_s(sp); if (string(sp)->len == 0) { /* nothing to split */ cnt = 0; } else { switch ((sp + 2)->type) { case C_RE: if (isEmpty_RE((sp + 2)->ptr)) { cnt = null_split(string(sp)->str, string(sp)->len); } else { cnt = re_split(string(sp)->str, string(sp)->len, (sp + 2)->ptr); } break; case C_SPACE: cnt = space_split(string(sp)->str, string(sp)->len); break; case C_SNULL: /* split on empty string */ cnt = null_split(string(sp)->str, string(sp)->len); break; default: bozo("bad splitting cell in bi_split"); } } free_STRING(string(sp)); sp->type = C_DOUBLE; sp->dval = (double) cnt; array_load((ARRAY) (sp + 1)->ptr, cnt); return sp; } mawk-1.3.4-20200120/init.c0000644000175100001440000003040213171255223013170 0ustar tomusers/******************************************** init.c copyright 2008-2016,2017, Thomas E. Dickey copyright 1991-1994,1995, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: init.c,v 1.45 2017/10/17 01:19:15 tom Exp $ */ /* init.c */ #include #include #include #include #include #include #include #include #include #include typedef enum { W_UNKNOWN = 0, #if USE_BINMODE W_BINMODE, #endif W_VERSION, W_DUMP, W_HELP, W_INTERACTIVE, W_EXEC, W_RANDOM, W_SPRINTF, W_POSIX_SPACE, W_USAGE } W_OPTIONS; static void process_cmdline(int, char **); static void set_ARGV(int, char **, int); static void bad_option(char *); static void no_program(void); #ifdef MSDOS #if HAVE_REARGV void reargv(int *, char ***); #endif #endif const char *progname; short interactive_flag = 0; #ifndef SET_PROGNAME #define SET_PROGNAME() \ {char *p = strrchr(argv[0],'/') ;\ progname = p ? p+1 : argv[0] ; } #endif void initialize(int argc, char **argv) { SET_PROGNAME(); bi_vars_init(); /* load the builtin variables */ bi_funct_init(); /* load the builtin functions */ kw_init(); /* load the keywords */ field_init(); #if USE_BINMODE { char *p = getenv("MAWKBINMODE"); if (p) set_binmode(atoi(p)); } #endif process_cmdline(argc, argv); code_init(); fpe_init(); set_stdio(); #if USE_BINMODE stdout_init(); #endif } int dump_code_flag; /* if on dump internal code */ short posix_space_flag; #ifdef DEBUG int dump_RE = 1; /* if on dump compiled REs */ #endif static void bad_option(char *s) { errmsg(0, "not an option: %s", s); if (strcmp(s, "--lint") && strcmp(s, "--lint-old") && strcmp(s, "--posix") && strcmp(s, "--re-interval") && strcmp(s, "--traditional")) { mawk_exit(2); } } static void no_program(void) { mawk_exit(0); } static void usage(void) { static const char *msg[] = { "Usage: mawk [Options] [Program] [file ...]", "", "Program:", " The -f option value is the name of a file containing program text.", " If no -f option is given, a \"--\" ends option processing; the following", " parameters are the program text.", "", "Options:", " -f program-file Program text is read from file instead of from the", " command-line. Multiple -f options are accepted.", " -F value sets the field separator, FS, to value.", " -v var=value assigns value to program variable var.", " -- unambiguous end of options.", "", " Implementation-specific options are prefixed with \"-W\". They can be", " abbreviated:", "", " -W version show version information and exit.", #if USE_BINMODE " -W binmode", #endif " -W dump show assembler-like listing of program and exit.", " -W help show this message and exit.", " -W interactive set unbuffered output, line-buffered input.", " -W exec file use file as program as well as last option.", " -W random=number set initial random seed.", " -W sprintf=number adjust size of sprintf buffer.", " -W posix_space do not consider \"\\n\" a space.", " -W usage show this message and exit.", }; size_t n; for (n = 0; n < sizeof(msg) / sizeof(msg[0]); ++n) { fprintf(stderr, "%s\n", msg[n]); } mawk_exit(0); } /* * Compare ignoring case, but warn about mismatches. */ static int ok_abbrev(const char *fullName, const char *partName, int partLen) { int result = 1; int n; for (n = 0; n < partLen; ++n) { UChar ch = (UChar) partName[n]; if (isalpha(ch)) ch = (UChar) toupper(ch); if (ch != (UChar) fullName[n]) { result = 0; break; } } return result; } static char * skipValue(char *value) { while (*value != '\0' && *value != ',') { ++value; } return value; } static int haveValue(char *value) { int result = 0; if (*value++ == '=') { if (*value != '\0' && strchr("=,", *value) == 0) result = 1; } return result; } static int allow_long_options(char *arg) { static int result = -1; if (result < 0) { char *env = getenv("MAWK_LONG_OPTIONS"); result = 0; if (env != 0) { switch (*env) { default: case 'e': /* error */ bad_option(arg); break; case 'w': /* warn */ errmsg(0, "ignored option: %s", arg); break; case 'i': /* ignore */ break; case 'a': /* allow */ result = 1; break; } } else { bad_option(arg); } } return result; } static W_OPTIONS parse_w_opt(char *source, char **next) { #define DATA(name) { W_##name, #name } #define DATA2(name) { W_##name, name } static const struct { W_OPTIONS code; const char *name; } w_options[] = { DATA(VERSION), #if USE_BINMODE DATA(BINMODE), #endif DATA(DUMP), DATA(HELP), DATA(INTERACTIVE), DATA(EXEC), DATA(RANDOM), DATA(SPRINTF), DATA(POSIX_SPACE), DATA(USAGE) }; #undef DATA W_OPTIONS result = W_UNKNOWN; int n; int match = -1; const char *first; /* forgive and ignore empty options */ while (*source == ',') { ++source; } first = source; if (*source != '\0') { while (*source != '\0' && *source != ',' && *source != '=') { ++source; } for (n = 0; n < (int) (sizeof(w_options) / sizeof(w_options[0])); ++n) { if (ok_abbrev(w_options[n].name, first, (int) (source - first))) { if (match >= 0) { errmsg(0, "? ambiguous -W value: %s vs %s\n", w_options[match].name, w_options[n].name); } else { match = n; } } } } *next = source; if (match >= 0) result = w_options[match].code; return result; } static void process_cmdline(int argc, char **argv) { int i, j, nextarg; char *optArg; char *optNext; PFILE dummy; /* starts linked list of filenames */ PFILE *tail = &dummy; size_t length; if (argc <= 1) usage(); for (i = 1; i < argc && argv[i][0] == '-'; i = nextarg) { if (argv[i][1] == 0) /* - alone */ { if (!pfile_name) no_program(); break; /* the for loop */ } /* safe to look at argv[i][2] */ /* * Check for "long" options and decide how to handle them. */ if (strlen(argv[i]) > 2 && !strncmp(argv[i], "--", (size_t) 2)) { if (!allow_long_options(argv[i])) { nextarg = i + 1; continue; } } if (argv[i][2] == 0) { if (i == argc - 1 && argv[i][1] != '-') { if (strchr("WFvf", argv[i][1])) { errmsg(0, "option %s lacks argument", argv[i]); mawk_exit(2); } bad_option(argv[i]); } optArg = argv[i + 1]; nextarg = i + 2; } else { /* argument glued to option */ optArg = &argv[i][2]; nextarg = i + 1; } switch (argv[i][1]) { case 'W': for (j = 0; j < (int) strlen(optArg); j = (int) (optNext - optArg)) { switch (parse_w_opt(optArg + j, &optNext)) { case W_VERSION: print_version(); break; #if USE_BINMODE case W_BINMODE: if (haveValue(optNext)) { set_binmode(atoi(optNext + 1)); optNext = skipValue(optNext); } else { errmsg(0, "missing value for -W binmode"); mawk_exit(2); } break; #endif case W_DUMP: dump_code_flag = 1; break; case W_EXEC: if (pfile_name) { errmsg(0, "-W exec is incompatible with -f"); mawk_exit(2); } else if (nextarg == argc) { no_program(); } if (haveValue(optNext)) { pfile_name = optNext + 1; i = nextarg; } else { pfile_name = argv[nextarg]; i = nextarg + 1; } goto no_more_opts; case W_INTERACTIVE: interactive_flag = 1; setbuf(stdout, (char *) 0); break; case W_POSIX_SPACE: posix_space_flag = 1; break; case W_RANDOM: if (haveValue(optNext)) { int x = atoi(optNext + 1); CELL c[2]; memset(c, 0, sizeof(c)); c[1].type = C_DOUBLE; c[1].dval = (double) x; /* c[1] is input, c[0] is output */ bi_srand(c + 1); optNext = skipValue(optNext); } else { errmsg(0, "missing value for -W random"); mawk_exit(2); } break; case W_SPRINTF: if (haveValue(optNext)) { int x = atoi(optNext + 1); if (x > (int) sizeof(string_buff)) { if (sprintf_buff != string_buff && sprintf_buff != 0) { zfree(sprintf_buff, (size_t) (sprintf_limit - sprintf_buff)); } sprintf_buff = (char *) zmalloc((size_t) x); sprintf_limit = sprintf_buff + x; } optNext = skipValue(optNext); } else { errmsg(0, "missing value for -W sprintf"); mawk_exit(2); } break; case W_HELP: /* FALLTHRU */ case W_USAGE: usage(); /* NOTREACHED */ break; case W_UNKNOWN: errmsg(0, "vacuous option: -W %s", optArg + j); break; } while (*optNext == '=') { errmsg(0, "unexpected option value %s", optArg + j); optNext = skipValue(optNext); } } break; case 'v': if (!is_cmdline_assign(optArg)) { errmsg(0, "improper assignment: -v %s", optArg); mawk_exit(2); } break; case 'F': rm_escape(optArg, &length); /* recognize escape sequences */ cell_destroy(FS); FS->type = C_STRING; FS->ptr = (PTR) new_STRING1(optArg, length); cast_for_split(cellcpy(&fs_shadow, FS)); break; case '-': if (argv[i][2] != 0) { bad_option(argv[i]); } i++; goto no_more_opts; case 'f': /* first file goes in pfile_name ; any more go on a list */ if (!pfile_name) pfile_name = optArg; else { tail = tail->link = ZMALLOC(PFILE); tail->fname = optArg; } break; default: bad_option(argv[i]); } } no_more_opts: tail->link = (PFILE *) 0; pfile_list = dummy.link; if (pfile_name) { set_ARGV(argc, argv, i); scan_init((char *) 0); } else { /* program on command line */ if (i == argc) no_program(); set_ARGV(argc, argv, i + 1); #if defined(MSDOS) && ! HAVE_REARGV /* reversed quotes */ { char *p; for (p = argv[i]; *p; p++) if (*p == '\'') *p = '\"'; } #endif scan_init(argv[i]); /* #endif */ } } /* argv[i] = ARGV[i] */ static void set_ARGV(int argc, char **argv, int i) { SYMTAB *st_p; CELL argi; register CELL *cp; st_p = insert("ARGV"); st_p->type = ST_ARRAY; Argv = st_p->stval.array = new_ARRAY(); no_leaks_array(Argv); argi.type = C_DOUBLE; argi.dval = 0.0; cp = array_find(st_p->stval.array, &argi, CREATE); cp->type = C_STRING; cp->ptr = (PTR) new_STRING(progname); /* ARGV[0] is set, do the rest The type of ARGV[1] ... should be C_MBSTRN because the user might enter numbers from the command line */ for (argi.dval = 1.0; i < argc; i++, argi.dval += 1.0) { cp = array_find(st_p->stval.array, &argi, CREATE); cp->type = C_MBSTRN; cp->ptr = (PTR) new_STRING(argv[i]); } ARGC->type = C_DOUBLE; ARGC->dval = argi.dval; } /*----- ENVIRON ----------*/ #ifdef DECL_ENVIRON #ifndef MSDOS_MSC /* MSC declares it near */ #ifndef environ extern char **environ; #endif #endif #endif void load_environ(ARRAY ENV) { CELL c; register char **p = environ; /* walks environ */ char *s; /* looks for the '=' */ CELL *cp; /* pts at ENV[&c] */ c.type = C_STRING; while (*p) { if ((s = strchr(*p, '='))) { /* shouldn't fail */ size_t len = (size_t) (s - *p); c.ptr = (PTR) new_STRING0(len); memcpy(string(&c)->str, *p, len); s++; cp = array_find(ENV, &c, CREATE); cp->type = C_MBSTRN; cp->ptr = (PTR) new_STRING(s); free_STRING(string(&c)); } p++; } } #ifdef NO_LEAKS typedef struct _all_arrays { struct _all_arrays *next; ARRAY a; } ALL_ARRAYS; static ALL_ARRAYS *all_arrays; void array_leaks(void) { while (all_arrays != 0) { ALL_ARRAYS *next = all_arrays->next; array_clear(all_arrays->a); ZFREE(all_arrays->a); free(all_arrays); all_arrays = next; } } /* use this to identify array leaks */ void no_leaks_array(ARRAY a) { ALL_ARRAYS *p = calloc(1, sizeof(ALL_ARRAYS)); p->next = all_arrays; p->a = a; all_arrays = p; } #endif mawk-1.3.4-20200120/error.c0000644000175100001440000001633012773316433013372 0ustar tomusers/******************************************** error.c copyright 2008-2014,2016 Thomas E. Dickey copyright 1991-1994,1995 Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: error.c,v 1.23 2016/09/29 23:00:43 tom Exp $ */ #include #include #include /* for run time error messages only */ unsigned rt_nr, rt_fnr; /* *INDENT-OFF* */ static const struct token_str { short token; const char *str; } token_str[] = { { EOF, "end of file" }, { NL, "end of line" }, { SEMI_COLON, ";" }, { LBRACE, "{" }, { RBRACE, "}" }, { SC_FAKE_SEMI_COLON, "}" }, { LPAREN, "(" }, { RPAREN, ")" }, { LBOX, "[" }, { RBOX, "]" }, { QMARK, "?" }, { COLON, ":" }, { OR, "||" }, { AND, "&&" }, { ASSIGN, "=" }, { ADD_ASG, "+=" }, { SUB_ASG, "-=" }, { MUL_ASG, "*=" }, { DIV_ASG, "/=" }, { MOD_ASG, "%=" }, { POW_ASG, "^=" }, { EQ, "==" }, { NEQ, "!=" }, { LT, "<" }, { LTE, "<=" }, { GT, ">" }, { GTE, ">=" }, { MATCH, string_buff }, { PLUS, "+" }, { MINUS, "-" }, { MUL, "*" }, { DIV, "/" }, { MOD, "%" }, { POW, "^" }, { NOT, "!" }, { COMMA, "," }, { INC_or_DEC, string_buff }, { DOUBLE, string_buff }, { STRING_, string_buff }, { ID, string_buff }, { FUNCT_ID, string_buff }, { BUILTIN, string_buff }, { IO_OUT, string_buff }, { IO_IN, "<" }, { PIPE, "|" }, { DOLLAR, "$" }, { FIELD, "$" }, { 0, (char *) 0 } }; /* *INDENT-ON* */ /* if paren_cnt >0 and we see one of these, we are missing a ')' */ static const int missing_rparen[] = { EOF, NL, SEMI_COLON, SC_FAKE_SEMI_COLON, RBRACE, 0 }; /* ditto for '}' */ static const int missing_rbrace[] = { EOF, BEGIN, END, 0 }; static void missing(int c, const char *n, unsigned ln) { const char *s0, *s1; if (pfile_name) { s0 = pfile_name; s1 = ": "; } else s0 = s1 = ""; errmsg(0, "%s%sline %u: missing %c near %s", s0, s1, ln, c, n); } /* we won't use s as input (yacc and bison force this). We will use s for storage to keep lint or the compiler off our back. */ void yyerror(const char *s GCC_UNUSED) { const char *ss = 0; const struct token_str *p; const int *ip; for (p = token_str; p->token; p++) if (current_token == p->token) { ss = p->str; break; } if (!ss) /* search the keywords */ ss = find_kw_str(current_token); if (ss) { if (paren_cnt) for (ip = missing_rparen; *ip; ip++) if (*ip == current_token) { missing(')', ss, token_lineno); paren_cnt = 0; goto done; } if (brace_cnt) for (ip = missing_rbrace; *ip; ip++) if (*ip == current_token) { missing('}', ss, token_lineno); brace_cnt = 0; goto done; } compile_error("syntax error at or near %s", ss); } else /* special cases */ switch (current_token) { case UNEXPECTED: unexpected_char(); goto done; case BAD_DECIMAL: compile_error( "syntax error in decimal constant %s", string_buff); break; case RE: compile_error( "syntax error at or near /%s/", string_buff); break; default: compile_error("syntax error"); break; } return; done: if (++compile_error_count == MAX_COMPILE_ERRORS) mawk_exit(2); } /* generic error message with a hook into the system error messages if errnum > 0 */ void errmsg(int errnum, const char *format,...) { va_list args; fprintf(stderr, "%s: ", progname); #if OPT_TRACE > 0 va_start(args, format); Trace("\n?? errmsg \n"); TraceVA(format, args); Trace("\n"); va_end(args); #endif va_start(args, format); vfprintf(stderr, format, args); va_end(args); if (errnum > 0) fprintf(stderr, " (%s)", strerror(errnum)); fprintf(stderr, "\n"); } void compile_error(const char *format,...) { va_list args; const char *s0, *s1; /* with multiple program files put program name in error message */ if (pfile_name) { s0 = pfile_name; s1 = ": "; } else { s0 = s1 = ""; } #ifdef DEBUG fflush(stdout); #endif fprintf(stderr, "%s: %s%sline %u: ", progname, s0, s1, token_lineno); va_start(args, format); vfprintf(stderr, format, args); va_end(args); fprintf(stderr, "\n"); if (++compile_error_count == MAX_COMPILE_ERRORS) mawk_exit(2); } void bozo(const char *s) { errmsg(0, "bozo: %s", s); mawk_exit(3); } void overflow(const char *s, unsigned size) { errmsg(0, "program limit exceeded: %s size=%u", s, size); mawk_exit(2); } /* print as much as we know about where a rt error occurred */ static void rt_where(void) { if (FILENAME->type != C_STRING) cast1_to_s(FILENAME); fprintf(stderr, "\tFILENAME=\"%s\" FNR=%u NR=%u\n", string(FILENAME)->str, rt_fnr, rt_nr); } void rt_error(const char *format,...) { va_list args; fprintf(stderr, "%s: run time error: ", progname); va_start(args, format); vfprintf(stderr, format, args); va_end(args); putc('\n', stderr); rt_where(); mawk_exit(2); } /* run time */ void rt_overflow(const char *s, unsigned size) { errmsg(0, "program limit exceeded: %s size=%u", s, size); rt_where(); mawk_exit(2); } void unexpected_char(void) { int c = yylval.ival; fprintf(stderr, "%s: %u: ", progname, token_lineno); if (c > ' ' && c < 127) fprintf(stderr, "unexpected character '%c'\n", c); else fprintf(stderr, "unexpected character 0x%02x\n", c); } const char * type_to_str(int type) { const char *retval = 0; switch (type) { case ST_NONE: retval = "untyped variable"; break; case ST_VAR: retval = "variable"; break; case ST_KEYWORD: retval = "keyword"; break; case ST_BUILTIN: retval = "builtin"; break; case ST_ARRAY: retval = "array"; break; case ST_FIELD: retval = "field"; break; case ST_NR: retval = "NR"; break; case ST_ENV: retval = "ENVIRON"; break; case ST_FUNCT: retval = "function"; break; case ST_LENGTH: retval = "length"; break; case ST_LOCAL_VAR: retval = "local variable"; break; case ST_LOCAL_NONE: retval = "local untyped variable"; break; case ST_LOCAL_ARRAY: retval = "local array"; break; default: bozo("type_to_str"); } return retval; } /* emit an error message about a type clash */ void type_error(SYMTAB * p) { compile_error("illegal reference to %s %s", type_to_str(p->type), p->name); } mawk-1.3.4-20200120/rexp3.c0000644000175100001440000001762313611342064013277 0ustar tomusers/******************************************** rexp3.c copyright 2008-2017,2020, Thomas E. Dickey copyright 2010, Jonathan Nieder copyright 1991-1992,1993, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: rexp3.c,v 1.41 2020/01/20 15:16:04 tom Exp $ */ /* match a string against a machine */ #include "rexp.h" #define push(mx,sx,px,ssx,ux) do { \ if (++stackp == RE_run_stack_limit) \ stackp = RE_new_run_stack() ;\ stackp->m = (mx); \ stackp->s = (sx); \ stackp->sp = (int) ((px) - RE_pos_stack_base); \ stackp->tp = (px)->prev_offset; \ stackp->ss = (ssx); \ stackp->u = (ux); \ } while(0) #define CASE_UANY(x) case (x)+U_OFF: /* FALLTHRU */ case (x)+U_ON #define TR_STR(s) TRACE((" str:%i len:%lu\n", ((s) ? (int) ((s) - str) : -99), (unsigned long) *lenp)) #define RE_TURN() \ if (cb_ss) { \ *lenp = (size_t) (cb_e - cb_ss); \ } \ TR_STR(s); \ return cb_ss /* returns start of first longest match and the length by reference. If no match returns NULL and length zero */ char * REmatch(char *str, /* string to test */ size_t str_len, /* ...its length */ PTR machine, /* compiled regular expression */ size_t *lenp, /* where to return matched-length */ int no_bol) /* disallow match at beginning of line */ { register STATE *m = (STATE *) machine; char *s = str; char *ss; register RT_STATE *stackp; int u_flag, t; char *str_end = s + str_len; RT_POS_ENTRY *sp; char *ts; /* state of current best match stored here */ char *cb_ss; /* the start */ char *cb_e = 0; /* the end , pts at first char not matched */ *lenp = 0; TRACE(("REmatch: %s \"%s\" ~ /pattern/", no_bol ? "any" : "1st", str)); /* check for the easy case */ if (m->s_type == M_STR && (m + 1)->s_type == M_ACCEPT) { if ((ts = str_str(s, str_len, m->s_data.str, (size_t) m->s_len))) { *lenp = m->s_len; } TR_STR(ts); return ts; } u_flag = U_ON; cb_ss = ss = (char *) 0; stackp = RE_run_stack_empty; sp = RE_pos_stack_empty; RE_CASE(); refill: if (stackp == RE_run_stack_empty) { RE_TURN(); } ss = stackp->ss; s = (stackp--)->s; if (cb_ss) { /* does new state start too late ? */ if (ss) { if (cb_ss < ss || (cb_ss == ss && cb_e == str_end)) { RE_FILL(); } } else if (cb_ss < s || (cb_ss == s && cb_e == str_end)) { RE_FILL(); } } m = (stackp + 1)->m; sp = RE_pos_stack_base + (stackp + 1)->sp; sp->prev_offset = (stackp + 1)->tp; u_flag = (stackp + 1)->u; reswitch: switch (m->s_type + u_flag) { case M_STR + U_OFF + END_OFF: if (strncmp(s, m->s_data.str, (size_t) m->s_len)) { RE_FILL(); } if (!ss) { if (cb_ss && s > cb_ss) { RE_FILL(); } else { ss = s; } } s += m->s_len; m++; RE_CASE(); case M_STR + U_OFF + END_ON: if (strcmp(s, m->s_data.str)) { RE_FILL(); } if (!ss) { if (cb_ss && s > cb_ss) { RE_FILL(); } else { ss = s; } } s += m->s_len; m++; RE_CASE(); case M_STR + U_ON + END_OFF: if (s >= str_end) { RE_FILL(); } if (!(s = str_str(s, (size_t) (str_end - s), m->s_data.str, (size_t) m->s_len))) { RE_FILL(); } if (s >= str_end) { RE_FILL(); } push(m, s + 1, sp, ss, U_ON); if (!ss) { if (cb_ss && s > cb_ss) { RE_FILL(); } else { ss = s; } } s += m->s_len; m++; u_flag = U_OFF; RE_CASE(); case M_STR + U_ON + END_ON: t = (int) ((SLen) (str_end - s) - m->s_len); if (t < 0 || memcmp(ts = s + t, m->s_data.str, (size_t) m->s_len)) { RE_FILL(); } if (!ss) { if (cb_ss && ts > cb_ss) { RE_FILL(); } else { ss = ts; } } s = str_end; m++; u_flag = U_OFF; RE_CASE(); case M_CLASS + U_OFF + END_OFF: if (s >= str_end) { RE_FILL(); } if (!ison(*m->s_data.bvp, s[0])) { RE_FILL(); } if (!ss) { if (cb_ss && s > cb_ss) { RE_FILL(); } else { ss = s; } } s++; m++; RE_CASE(); case M_CLASS + U_OFF + END_ON: if (s >= str_end) { RE_FILL(); } if (s[1] || !ison(*m->s_data.bvp, s[0])) { RE_FILL(); } if (!ss) { if (cb_ss && s > cb_ss) { RE_FILL(); } else { ss = s; } } s++; m++; RE_CASE(); case M_CLASS + U_ON + END_OFF: if (s >= str_end) { RE_FILL(); } while (!ison(*m->s_data.bvp, s[0])) { if (s >= str_end) { RE_FILL(); } else { s++; } } if (s >= str_end) { RE_FILL(); } s++; push(m, s, sp, ss, U_ON); if (!ss) { if (cb_ss && s - 1 > cb_ss) { RE_FILL(); } else { ss = s - 1; } } m++; u_flag = U_OFF; RE_CASE(); case M_CLASS + U_ON + END_ON: if ((s >= str_end) || !ison(*m->s_data.bvp, str_end[-1])) { RE_FILL(); } if (!ss) { if (cb_ss && str_end - 1 > cb_ss) { RE_FILL(); } else { ss = str_end - 1; } } s = str_end; m++; u_flag = U_OFF; RE_CASE(); case M_ANY + U_OFF + END_OFF: if (s >= str_end) { RE_FILL(); } if (!ss) { if (cb_ss && s > cb_ss) { RE_FILL(); } else { ss = s; } } s++; m++; RE_CASE(); case M_ANY + U_OFF + END_ON: if ((s >= str_end) || ((s + 1) < str_end)) { RE_FILL(); } if (!ss) { if (cb_ss && s > cb_ss) { RE_FILL(); } else { ss = s; } } s++; m++; RE_CASE(); case M_ANY + U_ON + END_OFF: if (s >= str_end) { RE_FILL(); } s++; push(m, s, sp, ss, U_ON); if (!ss) { if (cb_ss && s - 1 > cb_ss) { RE_FILL(); } else { ss = s - 1; } } m++; u_flag = U_OFF; RE_CASE(); case M_ANY + U_ON + END_ON: if (s >= str_end) { RE_FILL(); } if (!ss) { if (cb_ss && str_end - 1 > cb_ss) { RE_FILL(); } else { ss = str_end - 1; } } s = str_end; m++; u_flag = U_OFF; RE_CASE(); case M_START + U_OFF + END_OFF: case M_START + U_ON + END_OFF: if (s != str || no_bol) { RE_FILL(); } ss = s; m++; u_flag = U_OFF; RE_CASE(); case M_START + U_OFF + END_ON: case M_START + U_ON + END_ON: if (s != str || no_bol || (s < str_end)) { RE_FILL(); } ss = s; m++; u_flag = U_OFF; RE_CASE(); case M_END + U_OFF: if (s < str_end) { RE_FILL(); } if (!ss) { if (cb_ss && s > cb_ss) { RE_FILL(); } else { ss = s; } } m++; RE_CASE(); case M_END + U_ON: s = str_end; if (!ss) { if (cb_ss && s > cb_ss) { RE_FILL(); } else { ss = s; } } m++; u_flag = U_OFF; RE_CASE(); CASE_UANY(M_U): if (!ss) { if (cb_ss && s > cb_ss) { RE_FILL(); } else { ss = s; } } u_flag = U_ON; m++; RE_CASE(); CASE_UANY(M_1J): m += m->s_data.jump; RE_CASE(); CASE_UANY(M_SAVE_POS): /* save position for a later M_2JC */ /* see also REtest */ sp = RE_pos_push(sp, stackp, s); m++; RE_CASE(); CASE_UANY(M_2JA): /* take the non jump branch */ push(m + m->s_data.jump, s, sp, ss, u_flag); m++; RE_CASE(); case (M_2JC) + U_OFF: /* take the jump branch if position changed */ case (M_2JC) + U_ON: /* see REtest */ if (RE_pos_pop(&sp, stackp) == s) { m++; RE_CASE(); } /* FALLTHRU */ case (M_2JB) + U_OFF: /* take the jump branch */ /* FALLTHRU */ case (M_2JB) + U_ON: push(m + 1, s, sp, ss, u_flag); m += m->s_data.jump; RE_CASE(); case M_ACCEPT + U_OFF: if (!ss) ss = s; if (!cb_ss || ss < cb_ss || (ss == cb_ss && s > cb_e)) { /* we have a new current best */ cb_ss = ss; cb_e = s; } else if (ss == cb_ss && s == cb_e) { RE_TURN(); } RE_FILL(); case M_ACCEPT + U_ON: if (!ss) { ss = s; } else { s = str_end; } if (!cb_ss || ss < cb_ss || (ss == cb_ss && s > cb_e)) { /* we have a new current best */ cb_ss = ss; cb_e = s; } else if (ss == cb_ss && s == cb_e) { RE_TURN(); } RE_FILL(); default: RE_panic("unexpected case in REmatch"); } } #undef push mawk-1.3.4-20200120/files.h0000644000175100001440000000265712767557604013371 0ustar tomusers/******************************************** files.h copyright 2009-2012,2016, Thomas E. Dickey copyright 1991-1994,1996, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: files.h,v 1.13 2016/09/18 18:40:04 tom Exp $ */ #ifndef MAWK_FILES_H #define MAWK_FILES_H #include "nstd.h" #include "types.h" /* IO redirection types */ #define F_IN (-5) #define PIPE_IN (-4) #define PIPE_OUT (-3) #define F_APPEND (-2) #define F_TRUNC (-1) #define IS_OUTPUT(type) ((type)>=PIPE_OUT) extern const char *shell; /* for pipes and system() */ extern PTR file_find(STRING *, int); extern int file_close(STRING *); extern int file_flush(STRING *); extern int flush_all_output(void); extern PTR get_pipe(char *, int, int *); extern int wait_for(int); extern int wait_status(int); extern void close_out_pipes(void); #ifdef HAVE_FAKE_PIPES extern void close_fake_pipes(void); extern int close_fake_outpipe(char *, int); extern char *tmp_file_name(int, char *); #endif #ifdef MSDOS extern int DOSexec(char *); extern void enlarge_output_buffer(FILE *); #endif #if USE_BINMODE extern int binmode(void); extern void set_binmode(int); extern void stdout_init(void); #endif #endif /* MAWK_FILES_H */ mawk-1.3.4-20200120/Makefile.in0000644000175100001440000001700213604741505014133 0ustar tomusers# $MawkId: Makefile.in,v 1.52 2020/01/06 23:31:17 tom Exp $ # Makefile-template for MAWK ############################################################################### # copyright 2009-2016,2020 Thomas E. Dickey # copyright 2010, Guido Berhoerster # copyright 2009, Jonathan Nieder # copyright 2005, Aleksey Cheusov # copyright 1996, Michael D. Brennan # # This is a source file for mawk, an implementation of # the AWK programming language. # # Mawk is distributed without warranty under the terms of # the GNU General Public License, version 2, 1991. ############################################################################### SHELL=/bin/sh #################################### srcdir = @srcdir@ VPATH = @srcdir@ x = @EXEEXT@ o = .@OBJEXT@ prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ manext = 1 bindir = @bindir@ mandir = @mandir@/man$(manext) CC = @CC@ CPP = @CPP@ BUILD_CC = @BUILD_CC@ CPPFLAGS = -I. -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@ EXTRA_CFLAGS = @EXTRA_CFLAGS@ CFLAGS = @CFLAGS@ $(EXTRA_CFLAGS) LDFLAGS = @CFLAGS@ @LDFLAGS@ LIBS = @LIBS@ BUILD_CFLAGS = @BUILD_CFLAGS@ BUILD_CPPFLAGS = -I. -I$(srcdir) -DHAVE_CONFIG_H @BUILD_CPPFLAGS@ BUILD_LDFLAGS = @BUILD_LDFLAGS@ BUILD_LIBS = @BUILD_LIBS@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ MAKE_RECUR = @cf_cv_makeflags@ prefix=$(prefix) DESTDIR=$(DESTDIR) YACC = @YACC@ CTAGS = @CTAGS@ ETAGS = @ETAGS@ LINT = @LINT@ LINTOPTS = INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ transform = @program_transform_name@ # where to put mawk BINDIR = $(DESTDIR)$(bindir) # where to put the man pages MANDIR = $(DESTDIR)$(mandir) ####################################### actual_PROG = `echo mawk| sed '$(transform)'` binary_PROG = $(actual_PROG)$x PROG = mawk$x OBJS = parse$o scan$o memory$o main$o hash$o execute$o code$o \ da$o error$o init$o bi_vars$o cast$o print$o bi_funct$o \ kw$o jmp$o array$o field$o split$o re_cmpl$o regexp$o zmalloc$o \ fin$o files$o scancode$o matherr$o fcall$o version$o @EXTRAOBJS@ .SUFFIXES: .c .i .s $o .c.i : @RULE_CC@ @ECHO_CC@$(CPP) -C $(CPPFLAGS) $< >$@ .c.s : @echo compiling $< @$(CC) -S $(CFLAGS) $(CPPFLAGS) $< -o $@ # >$@ .c$o : @RULE_CC@ @ECHO_CC@$(CC) -c $(CPPFLAGS) $(CFLAGS) $< all : $(PROG) check : mawk_test fpe_test $(PROG) : $(OBJS) @ECHO_LD@$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) CHECK = MAWK=`pwd`/$(PROG); export MAWK; cd $(srcdir)/test; echo "** $@" mawk_test : $(PROG) # test that we have a sane mawk @sh -c '$(CHECK); ./mawktest' fpe_test : $(PROG) # test FPEs are handled OK @sh -c '$(CHECK); ./fpe_test' parse.c : parse.y @echo expect 4 shift/reduce conflicts $(YACC) -d parse.y sed -e '/^#line/s%"y.tab.c"%"parse.c"%' y.tab.c >parse.c rm -f y.tab.c -if cmp -s y.tab.h parse.h ;\ then rm y.tab.h ;\ else mv y.tab.h parse.h ; fi NOIDENT = sed -e 's/[$$]MawkId\([^$$]*\)[$$]/@MawkId\1@/' array.c : array.w -@rm -f $@ notangle -R'"array.c"' array.w | $(NOIDENT) | cpif array.c array.h : array.w -@rm -f $@ notangle -R'"array.h"' array.w | $(NOIDENT) | cpif array.h scancode.c : $(srcdir)/makescan.c scancode.h nstd.h config.h @ECHO_LD@$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -o makescan$x $(srcdir)/makescan.c rm -f scancode.c ./makescan$x > scancode.c rm makescan$x MAWK_BIN = $(BINDIR)/$(binary_PROG) MAWK_MAN = $(MANDIR)/$(actual_PROG).$(manext) install : $(BINDIR) $(MANDIR) $(PROG) $(INSTALL_PROGRAM) $(PROG) $(MAWK_BIN) $(INSTALL_DATA) $(srcdir)/man/mawk.1 $(MAWK_MAN) uninstall : rm -f $(MAWK_BIN) rm -f $(MAWK_MAN) clean : -cd man && $(MAKE) $(MAKE_RECUR) $@ -rm -f y.tab.c y.tab.h makescan$x -rm -f *$o test/$(PROG) *core* test/*core* $(PROG) distclean : clean -cd man && $(MAKE) $(MAKE_RECUR) $@ -rm -f scancode.c -rm -f man2html.tmp -rm -f defines.out maxint.out fpe_check$x tags makedeps.awk -rm -f config.h Makefile config.status config.log config.cache maintainer-clean : distclean -rm -f parse.c parse.h -rm -f array.c array.h -rm -f configure config.guess config.sub install-sh -rm -fr autom4te.cache lint : $(LINT) $(LINTOPTS) $(CPPFLAGS) $(OBJS:$o=.c) tags : $(CTAGS) *.[ch] */*.[ch] @MAKE_UPPER_TAGS@TAGS : @MAKE_UPPER_TAGS@ $(ETAGS) *.[ch] */*.[ch] $(BINDIR) \ $(MANDIR) : mkdir -p "$@" # output from makedeps.sh array.o : array.h bi_vars.h config.h field.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h bi_funct.o : array.h bi_funct.h bi_vars.h config.h field.h files.h fin.h init.h mawk.h memory.h nstd.h regexp.h repl.h sizes.h symtype.h types.h zmalloc.h bi_vars.o : array.h bi_vars.h config.h field.h init.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h cast.o : array.h config.h field.h mawk.h memory.h nstd.h parse.h repl.h scan.h scancode.h sizes.h symtype.h types.h zmalloc.h code.o : array.h code.h config.h field.h init.h jmp.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h da.o : array.h bi_funct.h code.h config.h field.h mawk.h memory.h nstd.h repl.h sizes.h symtype.h types.h zmalloc.h error.o : array.h bi_vars.h config.h mawk.h nstd.h parse.h scan.h scancode.h sizes.h symtype.h types.h execute.o : array.h bi_funct.h bi_vars.h code.h config.h field.h fin.h mawk.h memory.h nstd.h regexp.h repl.h sizes.h symtype.h types.h zmalloc.h fcall.o : array.h code.h config.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h field.o : array.h bi_vars.h config.h field.h init.h mawk.h memory.h nstd.h parse.h regexp.h repl.h scan.h scancode.h sizes.h symtype.h types.h zmalloc.h files.o : array.h config.h files.h fin.h init.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h fin.o : array.h bi_vars.h config.h field.h fin.h mawk.h memory.h nstd.h parse.h scan.h scancode.h sizes.h symtype.h types.h zmalloc.h hash.o : array.h config.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h init.o : array.h bi_vars.h code.h config.h field.h init.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h jmp.o : array.h code.h config.h init.h jmp.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h kw.o : array.h config.h init.h mawk.h nstd.h parse.h sizes.h symtype.h types.h main.o : array.h code.h config.h files.h init.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h makescan.o : config.h nstd.h scancode.h matherr.o : array.h config.h init.h mawk.h nstd.h sizes.h symtype.h types.h memory.o : config.h mawk.h memory.h nstd.h sizes.h types.h zmalloc.h parse.o : array.h bi_funct.h bi_vars.h code.h config.h field.h files.h jmp.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h print.o : array.h bi_funct.h bi_vars.h config.h field.h files.h mawk.h memory.h nstd.h parse.h scan.h scancode.h sizes.h symtype.h types.h zmalloc.h re_cmpl.o : array.h config.h mawk.h memory.h nstd.h parse.h regexp.h repl.h scan.h scancode.h sizes.h symtype.h types.h zmalloc.h scan.o : array.h code.h config.h field.h files.h fin.h init.h mawk.h memory.h nstd.h parse.h repl.h scan.h scancode.h sizes.h symtype.h types.h zmalloc.h split.o : array.h bi_funct.h bi_vars.h config.h field.h mawk.h memory.h nstd.h parse.h regexp.h repl.h scan.h scancode.h sizes.h symtype.h types.h zmalloc.h version.o : array.h config.h init.h mawk.h nstd.h patchlev.h sizes.h symtype.h types.h zmalloc.o : config.h mawk.h nstd.h sizes.h types.h zmalloc.h regexp.o : rexpdb.c rexp4.c rexp2.c regexp_system.c sizes.h mawk.h rexp0.c rexp1.c config.h rexp.h regexp.h nstd.h rexp3.c rexp.c field.h mawk-1.3.4-20200120/types.h0000644000175100001440000000472712772342161013415 0ustar tomusers/******************************************** types.h copyright 2009-2014,2016 Thomas E. Dickey copyright 1991-1993,2014 Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: types.h,v 1.13 2016/09/27 00:59:29 tom Exp $ */ /* types.h */ #ifndef MAWK_TYPES_H #define MAWK_TYPES_H #include "nstd.h" #include "sizes.h" /* CELL types */ typedef enum { C_NOINIT ,C_DOUBLE ,C_STRING ,C_STRNUM ,C_MBSTRN /*could be STRNUM, has not been checked */ ,C_RE ,C_SPACE /* split on space */ ,C_SNULL /* split on the empty string */ ,C_REPL /* a replacement string '\&' changed to & */ ,C_REPLV /* a vector replacement -- broken on & */ ,NUM_CELL_TYPES } MAWK_CELL_TYPES; /* these defines are used to check types for two CELLs which are adjacent in memory */ #define TWO_NOINITS (2*(1<IHºÜ2¹Æ4-Ø1ŠùB’¨£X¬šh¼`·ßÄ‚¼`åÆ>l©ÿ;šÁ¤á‚ ¬1 Y /%1%Ü©@œ÷áë(sàûŒÊÓÿ; Cµ8o DF‘¯ÓÖ²{„`Ò!A—Ÿ/€œÅúÝ£ŽfÇ_ÆìHŰØIþ¼P®dóQ€ž¤ÌÜ¢îÆüÜ· qà o ,í[Áq».˜ •U°mQeêÑ'²ˆ~Á»´~îÛw¸iû¯:–E dÛ ‘Ê*†›|ùâ Q©¸áóHA55—nMM¤ñy!ÈKN‰º`¤âð<ûôó‰â3ƒ-\vÎ×?B[{•–»Ú8áMw©3°Pá¡ÒàÓpÉèדDSט¨Ëz˜¢Óåºë…òˆö@E¡¿1„ÓåÒ©×ó³Po\ HågwØTܸ«·ÇyìQ¼w–qŸÉní—º¯ÙÏû_³y³tþ o¯Ò5Ÿõ­µ£¤ï¯g’@дM5¦z}~bxs’aKJ¾É(VWC9 Xn­…ôøæîÞö=¿téßí…¾©Ø¥˜7Ù€ïóô­ÿ Ê›j6?šdØbÿ·j 4hž™£ãaøs’‹á½oÃs­ÐñˆÅ“•ÃzΕÀï|kýx øL_ì%Ðæû½b2¦¸¾™€>€Ã9l\–– ‹sÆ1Xzl Y Î<„0X˜6PAÈéÇщBçëÀïôÙŒ¸Š‘`›vïv^o|‰{uê…§‡rÔIÅò’5š9n,È*–4æ{ ‚y×ø8òŒ6yŸ6ì?L‡…Z?ù%ƒòÌijq 0V½Í»%U(f©šq̰è×zÛòLá€Á%‡²^gÇ&ÔC²0!+ALc™ÀƒÀßðÙÞT ü-ªå€i@$ëx¢&®TtßZÆ •‚DG–,6‹Jô¿]B†YÛ•Á-pÿ)ˆ ·(ÈXÑÀ™Àzm‹¿žŽhÅÓíÀ.­Ë‹EyVo^i¡ Ø¾ÔÆ ÃPʶ¤©DÖ`?@¿ËõûÆNû•QA¬Î$™ðùqW‚ò(²´=¼ ˜€6}pì,ügAM¯ë=$, ,:²Šá„ðÔè­ Õªk‹á_ôI.+¨@Þ$Vo’¬,9œàR`-ðøt=q+óÑZWM¢Ÿ9Z— ‚”Óï Ú›L@‡K"é’åsµž§o¬à¨KMÒ9½É¢²RÐQ]â¿]5A…öo €]~–àŠ”‹“—PcAÒb?¹˜ÅÞ– ýxÖߟÁ E3á—Àq‡šÂ1 ñaÅ»õN‰üj€ úöÕt ¸à Î+–ÊyqI£—l`Ç—‡<*‚Dû¶#Y¦ÕgèËC}’*WnN3)‰¦]vW'…˜É¾ƒÇROM7˜kF€£¾ìn·„Às£Ì˜k“³•×/6âÎ69„wÚħ9ª6X¡o^©»1gZ º`õxžŒA/¨Ûm Xpš˜|ˆN(N  Më›ô ø`[ÖpItúW™l6@Ž@\‡Ò8AA[‘1¶3«AðžC¨ Ð%¨rIèL9ôÍ M<Øò.ÞóÜàös‘À¸Tn©å©K§bFµIW1¨¢6¾jƒA‚½PöÑ(eEsA÷Å‚í±OAõœìÈbnÀäàl{âÁòŠ @ó÷ž €{ãÚttù±6Ò Ã(©8(üõ ½3Lï€ÝØŸÇJJjjM/É;,‰I¯ªšmò»ò…P%bÒ>?8Þ’ üüŽ0÷èǵ}ž@Á€#úw P¥ ¬c—ê™6nÐdoiÒ_&ø/LŒ"‰KFÈ«%C&5e®ÇTCPµÐFp©(ÚÙ\NĈhIrùÁÆÓqÀaJÜs6­^ÈC¹æñ°j`yW-¿ŠAc—KµžÑú›ïëNtCµ ÎT1ÈÜSYœrI:£#PeÈ´bfAâmœQ—Ž–;Ø9†m–F žÔm8€6Dä}±É•;F&àÀÆ1Ädµšc’­ZJ‰>¨ŠB¿ \ƒÅ‡sƒT@¿ —Ó ³}Ñ.a“m—EŠú@ÊcY²qHû€•À‚³I XV³‰‚{Òˆ: `K–èd·0àxñΨ >UПtÉ Xq$ãqLç¿¡ZçºG‹Ý|Ì¢JÕhS’èZÄéÔvôds\³g ÒZ€~EËdÐm@6¥ˆ Am ú÷Œ@·–W­ðì`OŽ•š¦‹T,ÞÆv9rYxü¢½tfq×Ùlñ±‘˜ À8¬æ2+·éºÍýôÏ©µhÇ2¡êbÀQ Æ(Äk¡¿} »#‹pµGYð$àÂ5Ãåü $LÞXUŽ[½2Dô‰*Ú³ÏÓª4@«¾•}Nš«ŽePŽ·,³q…—ÿ ˜¼&êxa‡W¾>¶Ÿ–ðͶ@{Õ uÑÅI e– èÉ!rd›­qR˜ M;ž15Ÿpݦ”»_Å•‚Ò+kLš#ëvDG®n#^Uí°/|¾!JÊð24üú_Rˆ}Ûš$yqŠG*Š™Ø=þ3†¾Õ•…Û'ÇšÃDo*,XAËØEþ¿Fóri; Pc0ô…"µA ò²°“¿y9\Ï:ˆÃñÙgÒE’Ž AöO7úìÕ)ÛÚ<½=Í­oèŠñÚ(®R¼'ñ3à»zÎm~,•@½IocIèµ0„r% áÅnjÛÉ;ÒË•ÿ_}ÉWy}˜²[좚þø7PgK5ÏV»p׎4vA÷—D!ÂVMÚ’Ú[O&l™`Ï’6Yl“ [ìÕ$ÑWVI[\(Ô4~ês^l$!Ÿ'd´®BESTåàáßž"rà®8Ns›í“¼rN•ç™4¤|¼S!~Ø€kUò±<óLÕêør·Ãšgú'&ø÷W“šæ}ÑÉkãü@^qû–Œ” Z"ÈÅεð,:é6Ù‚5{åò®é ^Íëólò“dÏ&‰:’5ªŽÚ"5‹9yÁÜm)Ï8¯¯Ä1ÿd>ÏË‹QÅ›7ÇP1 ¾à ¼zN—°Ÿ\ÆeÓÍ•L(u ;°9…›7ù €¡@8w¾>@ /¡1èÕè­úq…Õsj5=l | –Œ£Ø*NNA›gh±5lNÈ´„'ö½3L8-©V3YaÑÀåCñ=iOßn©$„—§ó‚íLïÕø”¿œÏ @±7[ÏÓë*ùæ±,FÞ' ÓÃ$„"iäë^H’ÀÒ0T¦Ë ÿß-Ôà W•/×F‘–â˜8É#-±?ÉBØ€u œ°â)’‹¤Åmž¼ª 7a‹j¬,ǵmþ `H‰0€;ãH%Ù!ztÉä"i¢ƒä¨dóÍ1/½-N^Â[…—€†©ûjQ AzË{xž‹°Å×ðÚÌ c·Æ¡ÞbÌ^í#5ŸŠž¬ôÕ4/Ê6Ü@‹ÛÄcª‰ùþÿÿÙBÝ,™¿³IEND®B`‚mawk-1.3.4-20200120/icons/mawk48.svg0000644000175100001440000001045212020166305015025 0ustar tomusers Mawk image/svg+xml Mawk August 31, 2012 Thomas E. Dickey M AWK mawk-1.3.4-20200120/icons/mawk144.png0000644000175100001440000002433312020406244015071 0ustar tomusers‰PNG  IHDRçFâ¸bKGDÿÿÿ ½§“ pHYs × ×B(›xtIMEÜ  4·óŒ_ IDATxÚíyp÷•ß?¿ž€8 ‚ Þ§HŠ’HÝ’eÊ”dYönym+ήeIU{Äëòî&©¤ìJ¥*©lòÇVìx½v²›ØŽ½ÎnŸµ’eI–i‘”,K²DŠâMà…ƒ7î0Wwþèîé߯§{¦çA¯ŠÅéAÏL÷¯¿¿÷¾ïýÞ{?Á‚Ü0b¬ ƒÇ€[1ˆZoOß ^k 庸IÀ‘O˜Áà[bˆó7 €ŒuÔd-ËÉ0I”£â,£ pqÓNÂôò °Ñ~/ œ›Î(ÔkÙS§ˆð·â —æ=€Œ•¬&ÃgEÒÛ{1¥–ƒ¢—Ä‚æAÐÅSnµß;>/ÃhšÃðl´„³¸Äz¾&ö’ž·2V²Œ „òœöc1Ào8»Ðù°}üüì«ç´†ásíP£eAô²äÕÙºFmÖGEç6x†’ðWàí8è*¬ïºéÁ³Š >d¿ÏÀp~1¦<чUÔÎKÝta° ü`N%àÅøîÓ¶[³h¥Ñņ›<Ô‘æY "—“ðò˜ÿùïÅa$»ÒÜ6_5Ð6ûÅ©)ÓŽÛr.Ǧ¤3C|ÒXGÍMÈ{4ŸZmÂü£aHéù”:˜V4ø–ù ƒöËм{¦õ쨴0ÃGo:õÓ͇¬µ_Ë(qï´2ÎËç'€öË¡TîŸ'Ò¦9“äc¹3˜ó^û,ã`§}üƈû쥴Â#ë¥ÔÏ+¦ÇW'ƒÅKM+¦LŸ¾L™±”vÂüíš‚WÆ‚>£»Ì\GÀñ†Ö@«¨‘Ã3yN}Q6eÍLóè¼÷„ø†9QFÒðb !UeLCó @i!~Df~™°'²™¾3€p9 oO(#þ„ÑMl™®;€õö„ùé¨I†K¢˜eö™wn¼ø ž³·ÕAGš·gÆœA]„pÖ†nhí³ƒ!·ß‰Ã`²´ïª×`Y­B —Ì;Y<¨Áqû‡ï  …R:¼2¢h¡{Œ.ßðºÂC4ƒI˜÷Œ•þU;=Ib>/¦ÂkY-T/­"ç‘cÓ0”æ× ®…Œ4`ð°}ü«±â½.ùÞSøÏ^q‰ø¼è§¸Šåv®"ÔÝê ½Íè¦ë†EPœÇd⼿ŒÇ½ºÚÂYð¤ÈðîlÞŠv}¦ Çì—Râ3 虑æŽë{CiŸ54wÚÇ¿+Ë'·×+3í}1ÄÔüP˜£öËõµ x»Ç•ÁÞpC®“¥y+j i¦³”* 6Ö)OsÿlßÎõÐ9Îi§ctG‚}ìbŽL)3î†Zâ0:©Ãàûøõ‰ò¾o} Î"¡`Œ~Nߦ"éµW‘?·GÖB‚5ÆJVß0 ó€Ì}NM— 5xxH€qsh S{œµ_®ŠÿØpÚ•x–á‘Bûì$ŒÎý²öÑË|pëcÊxž¸÷uý¤9êŽw!¯O*ƒ¿ÞètÕæ¬œb˜9::.³æ¤-*­' R¬›½èóÜЀi0cAËŠH>¸˜„“júë®9 ÷Ù/ÄK_²ùäÕžžÍRž9 :†Cún/2îµIe7«Y:gÍ×r:íb³Â¢\Y[£˜ñS×Ï\בåý²3RÜG‡’pFŽ ¥xpî Gûœœ‚ñ2uEHƒå2®½y4SÎÇ3¡¨´íF'us;«¨Ep‡}¼¿Ú§3,­} Æg»œyîH8ng)Ò›0½2 Œ„c™3’äNÛuNC_ ¶;Tm=x=oïú¨†ì:ûâhñ£¿žPîæãIBsÇr!ÐxÀ>~7^žëžÕ@Qe\Ï{¬dÞl=f1œ°þ¥ ÎŽ•\£Ðj€ú°µ†Ÿš†G›¬tNƒFÞd 8ÜêºJ7kÁL=IK4_ˆŒ5¶‘0âjÆèÑ@“5æš4þöëËø›€véÜ ÿ§€÷ª ü¥t< 4‚¿{)ö’6ºµ€Gk¨0€¬AÄÐ„ŽØ7 w×›ÇÓ:;s®·n¼XYĤï'~@î¾’!úÓ:û“p@7¯]·¾Ïú?{l˜ÿ0@<„ü&|ò2NÄý¯®(¿ñ®!†Ì“æ×%çÀ,¨4€vx\ø-Àáz~a¨©€ ûOðo½Þÿ«q "Ž|ÍuÊÃÀÞîé k†ÊǼ=‹Ðßz IãçFx²Ø–4—E«"€€]6ÙˆNL›Sc³Ø€Í­ lƒ¹ÃÇæ:€ÚÁ³;€²4¸!<§Æf³Ç{-0`)œœŸ•¦}€ƒ(œ¨mÎ(ßûŽùZJ;˜ës•ðºšáZ˜¢;¶]^)p §€}· 9~X /Ì@·a¦¬$òøâ© †Dš¢ëäÏÃPþ¤õˆ3qB:Óípö ¬ R©Az¹‹ÿüsØì€&=JûS|xÊð,oº< ¼o½.$¯a6sÀJà§à=-9|óú«åÆïðJ¸òäéê¤l=-0¼ÿþöMØtnÿÔùÞ('­¥çΗž›tÒggCYý}¶ÛŽóÄ ñÏÁF vÖõÀÆ+°Ê ¦F¸| ºŽ5øL¸n{(ÆØêZBÿaœßñ8åó–Ö)!dÅY`·€þµžªÆòUŒÞ•@šãæbœuÚ‡wÁá°ôÇðÝõ±¤^ZÌKÍ!ÒtˆÒtKI&l1h³Òâh"Kž¦íkÿ6üÎ l²?Ò}bÎþ@»ßÈ ý´Ìçè¾·…¼×J°Ž%>:‘–LX´ÀÕlŽ™yÀ›àRŒ¸Ïi\meAyG‰÷Ô¾Uùb»ýòð´wÚÆ68âú±À&6LÕ–6BNC¯ÿJ,G­ÊÚ§0‘æ@Qx¦ ã“‹Ñ¿Ôé¸û 5h”êé—]tWPûئÍÓì ‚pæyžq5Òh&xl­zކ; yøñlxa…<­-§[–Rœ}®¦5kjaÐÂÀ-±,oÈPêߘ”ˆ¶æh„ ðŸü¿ÌF»1æ˜|J•‡Íp@VÚŠPuÀÓ <ãzï«P8Im64ܞDŽe9Œáãpº“·Æ²w=âuþ?M)h[ ma6—ø÷­ö‹ÓþþófI³-K‹PZ¯ €þ”T˜1àÛ³h@ÓEó lr‚ÜÝuc«k͆K|t0EkÂépÖÈŠ¢+7ІCŒç)ï›$@ïp/ÄäPåÁ¾àzïïÌˬ>€Üú‡EHs¨O2 Ò,BÝé «-ÇgÞ^u d®¼×Äu³m±ŸLJªƒ±pñÆ*èI—þ>[&Õm¾~ž…ýwæÑ@YùuDŠx\å–´ÃdÈc•}Zºú&Áïu‘T+@yî™ñGD h°ë)nƒ™LeM˜ÀÌ¢åÿRD’Z¥t)WD’ ¸ì¾ä…… Í®:«\i™±z-4­} ÌXË›±M®ã”g´Gº‹ce›{ÏS08d†²ÒP$€’•ЃÏð¿ó•Ð%à"øÖgû‘ílzxÒ'â y_øæ˜·+‡–ŒŠ3œ.ùEj—Ý]ýn:í^?Iò§­^tM¤æ"4]Y¹µÏ/(2¯\ɦé=I w÷ g˧¸Ïà¸Ò<²éT·Æ É@ˆ\†E.3¶9 7æÐ ž'm-Ð7•[‚a€Z‹P¼rZ|ÜõÞ—‹ý’rä&Эÿ÷E¤ ‡øe#Ök :ÞŠŽ.¯…váM¤¡õLBÙÀ¥‰®@=…Üú™Û,ñ¸,€ uÛp»ðO71º³)ø OT®u柣N¨÷_Í&€Ü&ÉÖ@'|Üù;}®  R8P ý&•°ºsE|<1hIé¦F~ks‘ºhi¼S~çÝ´"XfâNh˜0î ">QÇØ­5³®š€?t½WpÙ¢Ú:(9S=Î_ii-_ Ïx_`cXñÚÆäúH7€®YyÖŠFÐ îb³T»-Ç\ÿçM8ÁÃþ™Â8.i &ÉÖ©HKÚÓzE\ù?DÝ-r OfVú¤ãàfLä×@õaeLç̧BáhóuåxTgÈP¼KÀµdYú¸+Î5|«Ô/+@K¬è6_Åi „cÒFÓÞA²Å!åáƒÕszì·;B¹š‚¦´u'Tolk:ž@+Âì²Çðb²°f¸ä"Ð+,i@KOâryDÚíºÿO‚§´V @~Zø„ÿɦEŒø ~SX¹ÚQ Y´6œ ´AË\W´*O·{?õàA=’†3'd,»]øµaç~ZЍß.Ý„Ý N“+ëžþ¦4V @n ”²Ìš[:×]$]õ™U­aåá_‘,y–Ýõ&Ò-36œ†«iéžõ@Ù†#8yÅIYãeµ¦nnSÐ3]<€¶DœD²Ö"ˆô•TÅ´ÏÿÃ#Ïy¶”ñ!™˜±¬ »âc×Û#ŠZÉ&Š‹³Œ¢s`[W>«!¦ ºó5˜•¨²ö1<øPV†2fÝXB¶MA\¨Ú欩.‚I_-M-‡œǯ”ëÎU@Ç}â>û iáÔXy©e h—6iÆ­…îöÐ0ŽÇå2c9 ëQó«ùjçûuš‡3DÎÎ[NŸ‘4P`úÖ°³lÐ\„ +q9ã ®ûÛín©:€Ú è@È*ýmµ=0¯=TÊ‹›á!®¹üâ“™©¹ —4˜”Â5ô:ÞSþƒŸ+o¿NÒ´e˸ ZèG8÷³¸º5q‹0“Ædùr%¾X+Sûxh[Ž ­$xéå6¡M{Ϫöò´®æìÕÁ„In—iž®|‹ãÀAŸº¸º1  O>Olж ŠkÔ' g>¤L€fÔ­j¯gQù×J+ÿ© €ü4PïÆ -ÀÂÎ:Ú€è¬U®t('¹Ÿ:ç:ÞùÑ‹â’sÝMEj SxXªÃ)á$zXå?SÇ`ÔŽŸEEÕ)íÖÈM˜ÿ2ê)] €ÜkZïç9×ߌI{ÈùÌ`¥obÆ×[èXòæA’êK(Q饯*å¡nVÃH9¿—@jŽnˉT°­§¦µœ|¨>«áúˆgÌ«rò1—s0|¿’è,G—ÕpQDÚ4[ÚULŽ7€ ó¡®{è’ ¸îÚ45c̤7YûxQÕ£žXAE49êu{–íÕÑ@n×ýk>ÔbV”@çÕ@µ‚°J}ÒÀÅ´7–Ò82tæš0k> Óy\yeí«'áɃÖZ ò3_¾Vƒ@g)Ü”ÁíI‹@÷Ïx'`¹Úþ^û½û¬~Ó}÷úÇ\é.´Îê©xKÂìõ¾¢ßõnÙƒ!@ Ë”€Á…,€"å=Lc]Nã ·öù&E&°U@…4ÐŒ—ÚÏ@ík S3œöá?kÔ XÎç9z—†H6ŠÜ„þq—º”<>A-o³2ö5að7cæ¦(—u@§³&RwÔ^®'–T¸Î2à÷]gœ«C¯&€|yО3 ËÏ^®F óoc¤›DziÈ3?ºU=ÕåÎël à›Zz¼vĹâSê Ð…qƒhÜP ÷œÔ—A†æºasŒ’EW<ËÏ»Ì2ÀS×@²6Ñž<è@’¥ Ÿòߘæâ±ü‰ˆ‹\A0Öå 4D¯ºJ«3fä(eiˆ\MÃb-׌äÑ@ëcðNÒ‡ÿ˜&Ø ãh¡îòÌØ+ï;|Îçùm¾^ò"ÐF©èdše§}––G” »*zTnêô¬ññĆ\¥/åünRÐéŠ Â/é/Éšá\¯s,€6ÖÀáTGês=…³²Æ*UúÒ,ù»%ÜüþZñéë b ´-‡¼\âþ íGÞ¿¯ð#à.|½|bAW\šH›ù;ïšÚ¡6X·:dnì6“i±l ›š´7ããÂ;O!«ÉW•¡Ö]ä z…äOÑxŠ 6ÿ,@A⦼JB/ÎxÏ’µêVF}~¥ŽÞmï>;nW^vçßNähãÞøD X³9’« Ðú= '7Z÷q.íoÂ,Ÿì¬­Í[£®*”ÊKð¡ @¾fìDÆ$ÒîY+­ÀA·2½ŒßYã},t$bo ´Š¥@ýŽˆwàtÈÃdØ; ©˜Ž«Y¹µÏûUûtE¨¶TŸ?jCMÄ>BqYüžèš€”ø„“uHÒô, ù”:»ªRmwþ¼ |4ž0·o ‘j…=±Ust 4¢+«ÏÃyšð"¤N0mý›21í4ŒŸšM•c¾À\pÍñØ& -!Uí„4X[«¢8ÕsºKËÕh\M NL#.èʃ?ǾÿÉ6gh¤°'fßÇþdv#”üj Ç£öhiMׇ—ñx߈wñß.Ä\ßKWÓ+@}˜Ýé—bF<;nÌŸ•˜›q¬Á\cZt5ïÛ#m'°&"5Œs¡@:—%Z4o¯í‚‡Û› !i8Á¶‘»ÚnÑÎ.¬Þ? ¹žØ$´ÊZÎÖ"‡R<0ûÚO2ÕVEskâ€rXMÛÝai¡|Nß 9Iu³ ÿ‚ÓcȺñ~Ì%‡³À d½–I81axÇJú%3¶¡N1&'JÙ½!äÝ]ⲑ>­jV‡])³Î(e«U’Ðæ¡tÛZ®!ìD”OòÀ\Ü>{-%èˆÚm³µ6öÝ.ýuPÅä’ §y¦¥žŽ”ò}ƒ_{½?ê¡.º<§û#¾õ×Ú/Î$ Ã'…¥ß2ck¥@è±TNá©?€äR¥Úâ— Î%¤ò(ƒ¦Ù¼ˆÔÑÄÃŒ‰jh1…;v•,Àºä}Ð fØàcN ÈÉ8oxi./WÞM|?#äÞñÐ0Ë€²üçtVúÈ^[-M„Þ4µt/gíŠÛz­ø¨´NΞ¬÷ZÎÎ?ø|d½uNUT5ícq‡ÅqˆÞZ¯ÌĥfêEô›ø~0Êoº:™uÒ…0A`¯ÝÕAªÎ£šsØÊ—+ª™¼Bžæ•âGddÏsK¬øû?—X³`™ÑÁªfì™ÙPÜr‡MOœ+>|èp¶Np¡Mct‰ÆHTxgÂÖXº5¦\ÕûåÜTÄc–Ï@ÔkuzB2aÍKC$åN«ÖCÈÊå; >žX›¤I“IJ£óÂQuÉto*@qŽM)ƒq/ær’_zñ§ÚjÈ}&ŸXlŇÚ1ÍÐ2Ì0y7æ¢ë*ÖÄ»øë+|ór'ßÚòƨ C ßǹ§¼Ýú& ïß’–.â´”pß²!rV«êS‰!5{h¯Š8œâ7 ÆP›oPŒv¥IKصÁn@ùí¤r¸ÍØÂ¢'…+^Jä¬z÷·£åð €·'”ï»ÏØÁð¼Ïét'Æ"äæ?®Õc›LîVˆW3¨k:ÍgÒÄ0¸$+²z+ß*^ùoMº ³“YØ1_îÌI?OìX*«Ù&ûr×Ù‚HçV½X[‰fìpBé·TÏ%¶ç1c!àæ€Èp§½ñÈpÚéÜÞ쳓ÞK3t *¢}°‚™9^Ü„¤ÜXM’kRÒR—±‚2N©OŸk£’µ[dg=¨õX$†˜’½±m%h¡ŒïL( üÀ³õRž˜PÕt ˜Fâ>ûøÝ¸ã½,Æ›½™¢hà$µB’öâj²+/{`Q˜ªÕ™>7£L€ûæ2‹nÝâµ&vÎPšSrÒò^/ÔÉŽÅÖúÒ’íßKËþíGV°ø?>§ß.[Œjh" ´b'dò| .ÿÉ@¿MÐ(N—Þ)+ˆKAíÄ®B}Jr]¬ ß\}¥´£´CIïÚ}/Oì‚N›ÆHŒ^€úŠâ³“í4XYÂÒÆ´ïÅPîþ>ÏGž®$€£.¶ è¦ !§ Ö¡¸:ø«}Tè™ ŽQzò AhíwóË£:™Pn0äÇlYâá‰ÍD÷'™i=MÄTRÁ=0ÅŒ™up٘жºÒá׊-_nt“À ÒÏPä6¨Z¥ùÑM«Œ{Ç•Ö £”‰”A»Kª*€.A‹Û[li’ñ´«ôÙ‡ÿزԇHŠT©üÇÅÈf¬”mÑÇÓªÀ`ð_½V @‚MGõŸŸq’×]3ÞÈÝUAy&† C‹Ûk—€pÌÕe(í¾Ÿ'öÊ µ.óU€èÅj[ÅÙh¯XycBYÞXó÷Kxÿúøg®›²šFݽpŸdÔná̓(¼}fÙhRÐ:êÐr îvÎÎøo±Ô‰³Þ\‘iÚ+ kQ8kn¶×—6£i“Jd‰N wÏùœþq<’ïÊФߌvÝñ½vßçá4œòiI Å kUˆ—|N}ÐCƒ ;‹á?Vûþfï6îݲEîj0ÿ_öÕBU'Ò²´zèbÒœ±}z?o û6ØŠ•êÂçÚ|Ž"̨wL+-2m{drtúëÍžà·å³å¨8ÝÉmX=Ÿ“¸Bè’lŠ9-ýׇ}×¼ªN¤ý<0ÅŒMû»ï²CÙ57ʵ©È°àyÀ«Í€4H/óÙhd(YxﯫyBW8¯)¨€ÄQ&)r?S?ysÂY©ÿw œÕÊÈÒèýyµT¨¿?î¿må•ÃCÏÅ9ž߈”X¦ YÔSÁp¨Œv·ëk,>§4c}¹›Œ³5B9’ÒáU«~·;D⮨ïD{ÒÅå(8ÿéf«½Ýc3âéI‘¢f›·,+HV%3fäÓBMâ/¾²ÁZàÜ)¨NWâfÄýÛÝCÓβÍÓu¾-mÉݘ·22@Ãà± Úç¡EÒg³Xáý4ªhÆV„JPHƒµÖç푼ß3„÷^"¥N‰½• ’½bï?ZÄÙf-7¢$&¤xxÓà“ྜ6÷IûÆüµÏ-uÒíG•hµ5P^í¨)@k"N¶ü}µyMToï1ĉ¸áLÙ8êL¬f‚±«Æ×{Œ<‹ÜZ}Ä+fì$Œàûø­<ž×)³ç˜8£,cø]ô™VP €q-T"]—˰ׇ8€ÿq–{.{[_’Ö!ƒÊËãf½Ûyw µ0ò¿Ï‡]'º[~l ûÇ]á¹»ÑÌôÐiÝdõ^Ò…M²öìv²%OM±¯”9Þ§|FE¨–ÑkWóñ€Á³1ÅÇlLµ´J˜åR[mGSü ÏÐÜ—†ðbn‡á.i†¼Ñ¬‰´¡~¬‰áµ!û2Ò†€Žü g¥‡±° áYÌ­ WçDà¯Zª¸÷èF+¬­\IDATçaÛwy+î¿Õ‹×+ÌÍEî´.æÌ}üä?ÿ³¶û{ÀO*©Ú5Fë™MuŨ= MN‘Ëècˆ£ÀÃUÐs¨ÝÒ!tÌUªüEøjMe”·âæÓÇcùʤ'€–’»Ïüß cvÔȧȟ–‰Ô³=|÷·í¦Vȧ}ZðµN™¶¿Âìœþ—E \ø]ë_©‹¬W0“ß•@B—µqK ~>4ÕÒ2_ªcÛce«¢ «ü&rt@‡GàÓMœûÊdñÚ¸(°:ä´:Ù3fÚOOîÓ x^§ÅùʸŸ•råW†LÎR_B¾ñFµ hÞ«Áª!} 8— è½‹¦!‹7 §á]ç´= ·«Í~uÇ'‡5 §üysùÆ j–Am^€wOŹ(oMÿ™’=_Žùgê}¨QÑ>}b°ðšT•%ç÷ë4öÙá‚[bðR@3fGŸ-”š _±þ-©‚öÑ-oذ^öëhaAÈni“1²£Ø]ÓôVÁÕZ Ãâ ú¥ —ÒæR‡üÛºíu†]ª^¾8å8 ZH ÕhdÎ'œ·tEa£ìyJÎÉ5+®$_HÐ×åÈ놳÷u)Â+nà Ú`õâé°‹Ö†E»kðby–öuï«€žðûCz)õ„ù¢Ý‚æ…‘ÜB† Òñ¿|çó‹¥=; މAÿö0ˆ©±Œ•„ø< tà_öìgÛœö¶ƒ|o®ªl£‹Ï"¸ÌEà—G ˜o ¾Ô)1Zƒ¿©P)vy÷±‚GÐÍU¸_½è˜çÖÀÓKMûbÀ{!· ²ªL³^б)𬯑À:ߌ·¹!2Š 9úŒÆÈ\K؇0³ ê5Ó)GÎ$̪VI>a,aQi$º‹m˜ÝWI¿÷g㩹üe«+K9ŽÕôªIƒeœewÐ93ö“Âp‚´÷5”Ö&X–ÝcJs†:j½cvyd-Y|$‹ˆ ³DÄK¶Æ¤D'AŠZ~9×½k×笇–¯•JNP½¨NýÕ—ÞA7kï£ÀCej¡„?»¦˜¢íF—²¯l tŠ»±$t3Òop?ؤ˜†·mÑ4DwÖ€¶Ö›<ÇK–×HM@íèóœ²ÆègÒn¯‡æ2µPOŽO)?ò{ƵM /€ŒnbhN™ëëyLï¨7ûØX?’ Á«7J샎b¥[4ip«OPq—:£ùíáz]eC`ò²0°«±ü¯üù¸,^Ì%µôYË£³ÁªŸIÃo|\È«Úçµb6H¹î3÷,3hNoéMfåƒ,Ûë•tÜ ÆÜ4ÏVÜ'ë¸l­+'è‰4üBMÕyÈèvÖË<dt°Ýé°±;OÐðEµOå5n4IóVÆAK~¿ÕÑÚøH‹ò”Þs7º,èÁ œjÀcÐBïÅAꤟ´J¹|4P„b%'Oæ6°¥!lH"Z¯XM"o(CLÿˆ°\Y ÖÚO-QV2içç7À-½ˆ…^[[úî?M„çG•%ýnºù€'€ŒnÖc˜­nuàåQÿ0ðÎep¯qŸo†áÜѽ~‚0¹M½µñ¯´$3„Æ÷æ$÷ɽ—A„³£ÒMþÎAP¹š†½ª){ÜXÉjåk­<çlÞÉ‘)sc6/içÔi¿Xn{Þë>ðý¼Cˆ¯c.¾Úó&ìa=ßç¹an&‹vŒ«- wÇÊÿÊ7&”Nµ!tžP½.îF˜=’“ø iVfç1ÈaæX ÿßòˆ³ÜX÷qš1c{0ø0˜ŽÎ¡éµnù¤#ê ö8XE-Âü10ÅÆ}‚†«k`£\¦?cA枬aVéRj*ý«4ࣲÒç9昰»l·}¢@Ðð1Õmoά -ˆª…ö’Fs6œÛ^_ZÏi0c}ÝÎJCÝlZ®YĹÕjMÀ«cþ«¹wÈ!Hâå…G5‡Atž£§C>ÒX|a½ªJc45›f¡ÙnûPRmD$KLƒ]êíµ -È\–Ïcõ7XQ[|¯Å©ÁÕa–8Åš±Ž4§«ê yÜö‡›L4Z aIŦ¤šZè—1œºúGZ‚7©êŠº¼í4ÏË¡ )¶`˜™‰—“yÜö(ìPóœ_¸b" ’uëwcõ‚l ˜3¤sç‹jî·†pª,Žç‰!?Þ(å¿ô‰ùá¶ß4Zè,3^´h0K¯òÉ•ï¦0r;»jHK¯úhŸíõÊ6Ž:aßmƒd.K?ûœ«à®9?qÎá»k€ÂYðÜ" 7)ŸxCœóíî¹ sY ÆOmB½ºÖ¿ßâ#*q¾Æöø™¹ì:«; 2¤Á'š¥û—X²à¶ßÐ :Ǥ­ÑoÉM_銺êú2<ï· ²†ætKÝàZµ}¢É•?X Îó@:xÃ\׫×LmãKœ މ þé»ib-ýo¬sö* î”Q¨óÂBÄyžh!3üŸdŽ»<êCœE~¾«‰!ú1[u O¶ÂG[\˯‹¡Êôç[9¢ Çpžûï6›f—;â\ yÎÔTa^@ÊÈ»[MÓxŸóÎzÊ‚Ì#‰ñ†ÉÛ£ðÇí9Äyo¡¯Ð¬Á(:ß±“©²FË`|_”ÑÉtAæ°êeÃqŠš4åé?çGœ]ž#FKÐØˆFˆ0'¥f˜ 2OÅA7_À*µÞ<*óné  ¹IAdVYüf\0…àËA³/µ…á[1À v'ÝŤîþÂËœ’.ˆ¹ÊIEND®B`‚mawk-1.3.4-20200120/kw.c0000644000175100001440000000333212773316633012662 0ustar tomusers/******************************************** kw.c copyright 2008-2012,2016, Thomas E. Dickey copyright 1991-1993, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: kw.c,v 1.7 2016/09/29 23:02:51 tom Exp $ */ /* kw.c */ #include "mawk.h" #include "symtype.h" #include "parse.h" #include "init.h" /* *INDENT-OFF* */ static const struct kw { const char *text; short kw; } keywords[] = { { "print", PRINT }, { "printf", PRINTF }, { "do", DO }, { "while", WHILE }, { "for", FOR }, { "break", BREAK }, { "continue", CONTINUE }, { "if", IF }, { "else", ELSE }, { "in", IN }, { "delete", DELETE }, { "split", SPLIT }, { "match", MATCH_FUNC }, { "BEGIN", BEGIN }, { "END", END }, { "exit", EXIT }, { "next", NEXT }, { "nextfile", NEXTFILE }, { "return", RETURN }, { "getline", GETLINE }, { "sub", SUB }, { "gsub", GSUB }, { "function", FUNCTION }, { (char *) 0, 0 } }; /* *INDENT-ON* */ /* put keywords in the symbol table */ void kw_init(void) { register const struct kw *p = keywords; register SYMTAB *q; while (p->text) { q = insert(p->text); q->type = ST_KEYWORD; q->stval.kw = p++->kw; } } /* find a keyword to emit an error message */ const char * find_kw_str(int kw_token) { const struct kw *p; for (p = keywords; p->text; p++) if (p->kw == kw_token) return p->text; /* search failed */ return (char *) 0; } mawk-1.3.4-20200120/scan.c0000644000175100001440000005207213171253562013164 0ustar tomusers/******************************************** scan.c copyright 2008-2016,2017, Thomas E. Dickey copyright 2010, Jonathan Nieder copyright 1991-1996,2014, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: scan.c,v 1.44 2017/10/17 01:05:54 tom Exp $ */ #include "mawk.h" #include "scan.h" #include "memory.h" #include "field.h" #include "init.h" #include "fin.h" #include "repl.h" #include "code.h" #ifdef HAVE_FCNTL_H #include #endif #include "files.h" double double_zero = 0.0; double double_one = 1.0; /* static functions */ static void scan_fillbuff(void); static void scan_open(void); static int slow_next(void); static void eat_comment(void); static double collect_decimal(int, int *); static int collect_string(void); static int collect_RE(void); /*----------------------------- program file management *----------------------------*/ char *pfile_name; PFILE *pfile_list; static STRING *program_string; static UChar *buffer; static UChar *buffp; /* unsigned so it works with 8 bit chars */ static int program_fd; static int eof_flag; /* use unsigned chars for index into scan_code[] */ #define NextUChar(c) (UChar)(c = (char) next()) /* overused tmp buffer */ char string_buff[SPRINTF_LIMIT]; static void string_too_long(void) { compile_error("string too long \"%.10s ...", string_buff); mawk_exit(2); } #define CheckStringSize(ptr) \ if ((size_t)((ptr) - string_buff) >= sizeof(string_buff)) \ string_too_long() void scan_init(const char *cmdline_program) { if (cmdline_program) { program_fd = -1; /* command line program */ program_string = new_STRING0(strlen(cmdline_program) + 1); strcpy(program_string->str, cmdline_program); /* simulate file termination */ program_string->str[program_string->len - 1] = '\n'; buffp = (UChar *) program_string->str; eof_flag = 1; } else { /* program from file[s] */ scan_open(); buffp = buffer = (UChar *) zmalloc((size_t) (BUFFSZ + 1)); scan_fillbuff(); } #ifdef OS2 /* OS/2 "extproc" is similar to #! */ if (strnicmp(buffp, "extproc ", 8) == 0) eat_comment(); #endif eat_nl(); /* scan to first token */ if (next() == 0) { /* no program */ mawk_exit(0); } un_next(); } static void scan_open(void) /* open pfile_name */ { if (pfile_name[0] == '-' && pfile_name[1] == 0) { program_fd = 0; } else if ((program_fd = open(pfile_name, O_RDONLY, 0)) == -1) { errmsg(errno, "cannot open %s", pfile_name); mawk_exit(2); } } void scan_cleanup(void) { if (program_fd >= 0) zfree(buffer, (size_t) (BUFFSZ + 1)); if (program_string) free_STRING(program_string); if (program_fd > 0) close(program_fd); /* redefine SPACE as [ \t\n] */ scan_code['\n'] = (char) ((posix_space_flag && rs_shadow.type != SEP_MLR) ? SC_UNEXPECTED : SC_SPACE); scan_code['\f'] = SC_UNEXPECTED; /*value doesn't matter */ scan_code['\013'] = SC_UNEXPECTED; /* \v not space */ scan_code['\r'] = SC_UNEXPECTED; } /*-------------------------------- global variables shared by yyparse() and yylex() and used for error messages too *-------------------------------*/ int current_token = -1; unsigned token_lineno; unsigned compile_error_count; int NR_flag; /* are we tracking NR */ int paren_cnt; int brace_cnt; int print_flag; /* changes meaning of '>' */ int getline_flag; /* changes meaning of '<' */ /*---------------------------------------- file reading functions next() and un_next(c) are macros in scan.h *---------------------*/ static unsigned lineno = 1; static void scan_fillbuff(void) { size_t r; r = fillbuff(program_fd, (char *) buffer, (size_t) BUFFSZ); if (r < BUFFSZ) { eof_flag = 1; /* make sure eof is terminated */ buffer[r] = '\n'; buffer[r + 1] = 0; } } /* read one character -- slowly */ static int slow_next(void) { while (*buffp == 0) { if (!eof_flag) { buffp = buffer; scan_fillbuff(); } else if (pfile_list /* open another program file */ ) { PFILE *q; if (program_fd > 0) close(program_fd); eof_flag = 0; pfile_name = pfile_list->fname; q = pfile_list; pfile_list = pfile_list->link; ZFREE(q); scan_open(); token_lineno = lineno = 1; } else { break; /* real eof */ } } return *buffp++; /* note can un_next() , eof which is zero */ } static void eat_comment(void) { register int c; while (scan_code[NextUChar(c)] && (c != '\n')) { ; /* empty */ } un_next(); } /* this is how we handle extra semi-colons that are now allowed to separate pattern-action blocks A proof that they are useless clutter to the language: we throw them away */ static void eat_semi_colon(void) /* eat one semi-colon on the current line */ { register int c; while (scan_code[NextUChar(c)] == SC_SPACE) { ; /* empty */ } if (c != ';') un_next(); } void eat_nl(void) /* eat all space including newlines */ { while (1) { switch (scan_code[(UChar) next()]) { case SC_COMMENT: eat_comment(); break; case SC_NL: lineno++; /* FALLTHRU */ case SC_SPACE: break; case SC_ESCAPE: /* bug fix - surprised anyone did this, a csh user with backslash dyslexia.(Not a joke) */ { int c; while (scan_code[NextUChar(c)] == SC_SPACE) { ; /* empty */ } if (c == '\n') token_lineno = ++lineno; else if (c == 0) { un_next(); return; } else { /* error */ un_next(); /* can't un_next() twice so deal with it */ yylval.ival = '\\'; unexpected_char(); if (++compile_error_count == MAX_COMPILE_ERRORS) mawk_exit(2); return; } } break; default: un_next(); return; } } } int yylex(void) { register int c; token_lineno = lineno; #ifdef NO_LEAKS memset(&yylval, 0, sizeof(yylval)); #endif reswitch: switch (scan_code[NextUChar(c)]) { case 0: ct_ret(EOF); case SC_SPACE: goto reswitch; case SC_COMMENT: eat_comment(); goto reswitch; case SC_NL: lineno++; eat_nl(); ct_ret(NL); case SC_ESCAPE: while (scan_code[NextUChar(c)] == SC_SPACE) { ; /* empty */ }; if (c == '\n') { token_lineno = ++lineno; goto reswitch; } if (c == 0) ct_ret(EOF); un_next(); yylval.ival = '\\'; ct_ret(UNEXPECTED); case SC_SEMI_COLON: eat_nl(); ct_ret(SEMI_COLON); case SC_LBRACE: eat_nl(); brace_cnt++; ct_ret(LBRACE); case SC_PLUS: switch (next()) { case '+': yylval.ival = '+'; string_buff[0] = string_buff[1] = '+'; string_buff[2] = 0; ct_ret(INC_or_DEC); case '=': ct_ret(ADD_ASG); default: un_next(); ct_ret(PLUS); } case SC_MINUS: switch (next()) { case '-': yylval.ival = '-'; string_buff[0] = string_buff[1] = '-'; string_buff[2] = 0; ct_ret(INC_or_DEC); case '=': ct_ret(SUB_ASG); default: un_next(); ct_ret(MINUS); } case SC_COMMA: eat_nl(); ct_ret(COMMA); case SC_MUL: test1_ret('=', MUL_ASG, MUL); case SC_DIV: { static const int can_precede_div[] = {DOUBLE, STRING_, RPAREN, ID, D_ID, RE, RBOX, FIELD, GETLINE, INC_or_DEC, -1}; const int *p = can_precede_div; do { if (*p == current_token) { if (*p != INC_or_DEC) { test1_ret('=', DIV_ASG, DIV); } if (next() == '=') { un_next(); ct_ret(collect_RE()); } } } while (*++p != -1); ct_ret(collect_RE()); } case SC_MOD: test1_ret('=', MOD_ASG, MOD); case SC_POW: test1_ret('=', POW_ASG, POW); case SC_LPAREN: paren_cnt++; ct_ret(LPAREN); case SC_RPAREN: if (--paren_cnt < 0) { compile_error("extra ')'"); paren_cnt = 0; goto reswitch; } ct_ret(RPAREN); case SC_LBOX: ct_ret(LBOX); case SC_RBOX: ct_ret(RBOX); case SC_MATCH: string_buff[1] = '~'; string_buff[0] = 0; yylval.ival = 1; ct_ret(MATCH); case SC_EQUAL: test1_ret('=', EQ, ASSIGN); case SC_NOT: /* ! */ if ((c = next()) == '~') { string_buff[0] = '!'; string_buff[1] = '~'; string_buff[2] = 0; yylval.ival = 0; ct_ret(MATCH); } else if (c == '=') ct_ret(NEQ); un_next(); ct_ret(NOT); case SC_LT: /* '<' */ if (next() == '=') ct_ret(LTE); else un_next(); if (getline_flag) { getline_flag = 0; ct_ret(IO_IN); } else ct_ret(LT); case SC_GT: /* '>' */ if (print_flag && paren_cnt == 0) { print_flag = 0; /* there are 3 types of IO_OUT -- build the error string in string_buff */ string_buff[0] = '>'; if (next() == '>') { yylval.ival = F_APPEND; string_buff[1] = '>'; string_buff[2] = 0; } else { un_next(); yylval.ival = F_TRUNC; string_buff[1] = 0; } return current_token = IO_OUT; } test1_ret('=', GTE, GT); case SC_OR: if (next() == '|') { eat_nl(); ct_ret(OR); } else { un_next(); if (print_flag && paren_cnt == 0) { print_flag = 0; yylval.ival = PIPE_OUT; string_buff[0] = '|'; string_buff[1] = 0; ct_ret(IO_OUT); } else ct_ret(PIPE); } case SC_AND: if (next() == '&') { eat_nl(); ct_ret(AND); } else { un_next(); yylval.ival = '&'; ct_ret(UNEXPECTED); } case SC_QMARK: ct_ret(QMARK); case SC_COLON: ct_ret(COLON); case SC_RBRACE: if (--brace_cnt < 0) { compile_error("extra '}'"); eat_semi_colon(); brace_cnt = 0; goto reswitch; } if ((c = current_token) == NL || c == SEMI_COLON || c == SC_FAKE_SEMI_COLON || c == RBRACE) { /* if the brace_cnt is zero , we've completed a pattern action block. If the user insists on adding a semi-colon on the same line we will eat it. Note what we do below: physical law -- conservation of semi-colons */ if (brace_cnt == 0) eat_semi_colon(); eat_nl(); ct_ret(RBRACE); } /* supply missing semi-colon to statement that precedes a '}' */ brace_cnt++; un_next(); current_token = SC_FAKE_SEMI_COLON; return SEMI_COLON; case SC_DIGIT: case SC_DOT: { double d; int flag; if ((d = collect_decimal(c, &flag)) == 0.0) { if (flag) ct_ret(flag); else yylval.ptr = (PTR) & double_zero; } else if (d == 1.0) { yylval.ptr = (PTR) & double_one; } else { yylval.ptr = (PTR) ZMALLOC(double); *(double *) yylval.ptr = d; } ct_ret(DOUBLE); } case SC_DOLLAR: /* '$' */ { double d; int flag; while (scan_code[NextUChar(c)] == SC_SPACE) { ; /* empty */ }; if (scan_code[c] != SC_DIGIT && scan_code[c] != SC_DOT) { un_next(); ct_ret(DOLLAR); } /* compute field address at compile time */ if ((d = collect_decimal(c, &flag)) <= 0.0) { if (flag) ct_ret(flag); /* an error */ else yylval.cp = &field[0]; } else { int ival = d_to_I(d); double dval = (double) ival; if (dval != d) { compile_error("$%g is invalid field index", d); } yylval.cp = field_ptr(ival); } ct_ret(FIELD); } case SC_DQUOTE: return current_token = collect_string(); case SC_IDCHAR: /* collect an identifier */ { char *p = string_buff + 1; SYMTAB *stp; string_buff[0] = (char) c; while (1) { CheckStringSize(p); c = scan_code[NextUChar(*p++)]; if (c != SC_IDCHAR && c != SC_DIGIT) break; } un_next(); *--p = 0; switch ((stp = find(string_buff))->type) { case ST_NONE: /* check for function call before defined */ if (next() == '(') { stp->type = ST_FUNCT; stp->stval.fbp = (FBLOCK *) zmalloc(sizeof(FBLOCK)); stp->stval.fbp->name = stp->name; stp->stval.fbp->code = (INST *) 0; stp->stval.fbp->size = 0; yylval.fbp = stp->stval.fbp; current_token = FUNCT_ID; } else { yylval.stp = stp; current_token = current_token == DOLLAR ? D_ID : ID; } un_next(); break; case ST_NR: NR_flag = 1; stp->type = ST_VAR; /* FALLTHRU */ case ST_VAR: case ST_ARRAY: case ST_LOCAL_NONE: case ST_LOCAL_VAR: case ST_LOCAL_ARRAY: yylval.stp = stp; current_token = current_token == DOLLAR ? D_ID : ID; break; case ST_ENV: stp->type = ST_ARRAY; stp->stval.array = new_ARRAY(); load_environ(stp->stval.array); yylval.stp = stp; current_token = current_token == DOLLAR ? D_ID : ID; break; case ST_FUNCT: yylval.fbp = stp->stval.fbp; current_token = FUNCT_ID; break; case ST_KEYWORD: current_token = stp->stval.kw; break; case ST_BUILTIN: yylval.bip = stp->stval.bip; current_token = BUILTIN; break; case ST_LENGTH: yylval.bip = stp->stval.bip; /* check for length alone, this is an ugly hack */ while (scan_code[NextUChar(c)] == SC_SPACE) { ; /* empty */ }; un_next(); current_token = c == '(' ? BUILTIN : LENGTH; break; case ST_FIELD: yylval.cp = stp->stval.cp; current_token = FIELD; break; default: bozo("find returned bad st type"); } return current_token; } case SC_UNEXPECTED: yylval.ival = c & 0xff; ct_ret(UNEXPECTED); } return 0; /* never get here make lint happy */ } /* collect a decimal constant in temp_buff. Return the value and error conditions by reference */ static double collect_decimal(int c, int *flag) { register char *p = string_buff + 1; char *endp; char *temp; char *last_decimal = 0; double d; *flag = 0; string_buff[0] = (char) c; if (c == '.') { last_decimal = p - 1; CheckStringSize(p); if (scan_code[NextUChar(*p++)] != SC_DIGIT) { *flag = UNEXPECTED; yylval.ival = '.'; return 0.0; } } else { while (1) { CheckStringSize(p); if (scan_code[NextUChar(*p++)] != SC_DIGIT) { break; } }; if (p[-1] == '.') { last_decimal = p - 1; } else { un_next(); p--; } } /* get rest of digits after decimal point */ while (1) { CheckStringSize(p); if (scan_code[NextUChar(*p++)] != SC_DIGIT) { break; } } /* check for exponent */ if (p[-1] != 'e' && p[-1] != 'E') { un_next(); *--p = 0; } else { /* get the exponent */ if (scan_code[NextUChar(*p)] != SC_DIGIT && *p != '-' && *p != '+') { /* if we can, undo and try again */ if (buffp - buffer >= 2) { un_next(); /* undo the last character */ un_next(); /* undo the 'e' */ *--p = 0; } else { *++p = 0; *flag = BAD_DECIMAL; return 0.0; } } else { /* get the rest of the exponent */ p++; while (1) { CheckStringSize(p); if (scan_code[NextUChar(*p++)] != SC_DIGIT) { break; } } un_next(); *--p = 0; } } #ifdef LOCALE if (last_decimal && decimal_dot) { *last_decimal = decimal_dot; } #endif errno = 0; /* check for overflow/underflow */ d = strtod(string_buff, &temp); endp = temp; #ifndef STRTOD_UNDERFLOW_ON_ZERO_BUG if (errno) compile_error("%s : decimal %sflow", string_buff, d == 0.0 ? "under" : "over"); #else /* ! sun4 bug */ if (errno && d != 0.0) compile_error("%s : decimal overflow", string_buff); #endif if (endp < p) { /* if we can, undo and try again */ if ((p - endp) < (buffp - buffer)) { while (endp < p) { un_next(); ++endp; } } else { *flag = BAD_DECIMAL; return 0.0; } } return d; } /*---------- process escape characters ---------------*/ static const char hex_val['f' - 'A' + 1] = { 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 13, 14, 15}; #define isoctal(x) ((x)>='0'&&(x)<='7') #define hex_value(x) hex_val[(x)-'A'] #define ishex(x) (scan_code[x] == SC_DIGIT ||\ ('A' <= (x) && (x) <= 'f' && hex_value(x))) /* process one , two or three octal digits moving a pointer forward by reference */ static int octal(char **start_p) { register char *p = *start_p; register unsigned x; x = (unsigned) (*p++ - '0'); if (isoctal(*p)) { x = (x << 3) + (unsigned) (*p++ - '0'); if (isoctal(*p)) x = (x << 3) + (unsigned) (*p++ - '0'); } *start_p = p; return (int) (x & 0xff); } /* process one or two hex digits moving a pointer forward by reference */ static int hex(char **start_p) { register UChar *p = (UChar *) * start_p; register unsigned x; unsigned t; if (scan_code[*p] == SC_DIGIT) x = (unsigned) (*p++ - '0'); else x = (unsigned) hex_value(*p++); if (scan_code[*p] == SC_DIGIT) x = (x << 4) + *p++ - '0'; else if ('A' <= *p && *p <= 'f' && (t = (unsigned) hex_value(*p))) { x = (x << 4) + t; p++; } *start_p = (char *) p; return (int) x; } /* process the escape characters in a string, in place . */ char * rm_escape(char *s, size_t *lenp) { register char *p, *q; char *t; q = p = s; while (*p) { if (*p == '\\') { int ch = *++p; switch (ch) { case 'n': p++; *q++ = '\n'; break; case 't': p++; *q++ = '\t'; break; case 'f': p++; *q++ = '\f'; break; case 'b': p++; *q++ = '\b'; break; case 'r': p++; *q++ = '\r'; break; case 'a': p++; *q++ = '\07'; break; case 'v': p++; *q++ = '\013'; break; case '\\': p++; *q++ = '\\'; break; case '\"': p++; *q++ = '\"'; break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': t = p; *q++ = (char) octal(&t); p = t; break; case 'x': if (ishex(*(UChar *) (p + 1))) { t = p + 1; *q++ = (char) hex(&t); p = t; break; } else { goto not_escape; } case '\0': *q++ = '\\'; break; not_escape: default: *q++ = '\\'; *q++ = *p++; break; } } else *q++ = *p++; } *q = 0; if (lenp != 0) *lenp = (unsigned) (q - s); return s; } static int collect_string(void) { register char *p = string_buff; int c; int e_flag = 0; /* on if have an escape char */ size_t len_buff; while (1) { CheckStringSize(p); switch (scan_code[NextUChar(*p++)]) { case SC_DQUOTE: /* done */ *--p = 0; goto out; case SC_NL: p[-1] = 0; /* FALLTHRU */ case 0: /* unterminated string */ compile_error( "runaway string constant \"%.10s ...", string_buff); mawk_exit(2); case SC_ESCAPE: if ((c = next()) == '\n') { p--; lineno++; } else if (c == 0) un_next(); else { *p++ = (char) c; e_flag = 1; } break; default: break; } } out: if (e_flag) rm_escape(string_buff, &len_buff); else len_buff = (unsigned) ((char *) p - string_buff); yylval.ptr = (PTR) new_STRING1(string_buff, len_buff); return STRING_; } static int collect_RE(void) { char *p = string_buff; const char *first = NULL; int limit = sizeof(string_buff) - 2; int c; int boxed = 0; STRING *sval; while (1) { if (p >= (string_buff + limit)) { compile_error( "regular expression /%.10s ..." " exceeds implementation size limit (%d)", string_buff, limit); mawk_exit(2); } CheckStringSize(p); switch (scan_code[NextUChar(c = *p++)]) { case SC_POW: /* Handle [^]] and [^^] correctly. */ if ((p - 1) == first && first != 0 && first[-1] == '[') { first = p; } break; case SC_LBOX: /* * If we're starting a bracket expression, remember where that * started, so we can make comparisons to handle things like * "[]xxxx]" and "[^]xxxx]". */ if (!boxed) { first = p; ++boxed; } else { /* XXX. Does not handle collating symbols or equivalence * class expressions. */ /* XXX. Does not match logic used in rexp0.c to check for * a character class expression, though probably the * latter should be adjusted. * POSIX and common sense give us license to complain about * expressions such as '[[:not a special character class]]'. */ if (next() == ':') { ++boxed; } un_next(); } break; case SC_RBOX: /* * A right square-bracket loses its special meaning if it occurs * first in the list (after an optional "^"). */ if (boxed && p - 1 != first) { --boxed; } break; case SC_DIV: /* done */ if (!boxed) { *--p = 0; goto out; } break; case SC_NL: p[-1] = 0; /* FALLTHRU */ case 0: /* unterminated re */ compile_error( "runaway regular expression /%.10s ...", string_buff); mawk_exit(2); case SC_ESCAPE: switch (c = next()) { case '/': p[-1] = '/'; break; case '\n': p--; break; case 0: un_next(); break; default: *p++ = (char) c; break; } break; } } out: /* now we've got the RE, so compile it */ sval = new_STRING(string_buff); yylval.ptr = re_compile(sval); free_STRING(sval); return RE; } #ifdef NO_LEAKS void scan_leaks(void) { TRACE(("scan_leaks\n")); if (yylval.ptr) { free(yylval.ptr); yylval.ptr = 0; } } #endif mawk-1.3.4-20200120/main.c0000644000175100001440000000366313171250714013162 0ustar tomusers/******************************************** main.c copyright 2009-2014,2017 Thomas E. Dickey copyright 1991-1995,2014, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: main.c,v 1.31 2017/10/17 00:41:48 tom Exp $ */ /* main.c */ #include "mawk.h" #include "bi_vars.h" #include "init.h" #include "code.h" #include "files.h" #ifdef LOCALE #include #endif short mawk_state; /* 0 is compiling */ int exit_code; #if defined(__GNUC__) && defined(_FORTIFY_SOURCE) int ignore_unused; #endif #ifdef LOCALE char decimal_dot; #endif int main(int argc, char **argv) { #ifdef LOCALE setlocale(LC_CTYPE, ""); setlocale(LC_NUMERIC, "C"); #endif initialize(argc, argv); #ifdef LOCALE { struct lconv *data; decimal_dot = '\0'; /* only set to nonzero if not POSIX '.' */ setlocale(LC_NUMERIC, ""); data = localeconv(); if (data != 0 && data->decimal_point != 0 && strlen(data->decimal_point) == 1) { decimal_dot = data->decimal_point[0]; } else { /* back out of this if we cannot handle it */ setlocale(LC_NUMERIC, "C"); } if (decimal_dot == '.') decimal_dot = 0; } #endif parse(); mawk_state = EXECUTION; execute(execution_start, eval_stack - 1, 0); /* never returns */ return 0; } void mawk_exit(int x) { #ifdef HAVE_REAL_PIPES close_out_pipes(); /* actually closes all output */ #else #ifdef HAVE_FAKE_PIPES close_fake_pipes(); #endif #endif #ifdef NO_LEAKS code_leaks(); scan_leaks(); cell_leaks(); re_leaks(); rexp_leaks(); bi_vars_leaks(); hash_leaks(); array_leaks(); files_leaks(); fin_leaks(); field_leaks(); zmalloc_leaks(); #if OPT_TRACE > 0 trace_leaks(); #endif #endif exit(x); } mawk-1.3.4-20200120/MANIFEST0000644000175100001440000002374513611306521013223 0ustar tomusersMANIFEST for mawk-1.3.4-20200120, version t20200120 -------------------------------------------------------------------------------- MANIFEST this file ACKNOWLEDGMENT acknowledgements CHANGES change-log for mawk COPYING GNU General Public License, version 2 INSTALL installation instructions Makefile.in template for makefile README description of mawk aclocal.m4 mawk-specific macros for autoconf array.c array functions (C source) array.h array functions (C header) array.w array functions (noweb) bi_funct.c mawk built-in functions bi_funct.h mawk built-in functions header bi_vars.c mawk predefined variables bi_vars.h mawk predefined variables header cast.c mawk type-conversions code.c machine opcode functions code.h machine opcodes header config.guess configure-script config.sub configure-script config_h.in template for config.h configure Configuration script for UNIX configure.in template for autoconf script da.c disassemble mawk-code error.c error-reporting functions execute.c command-interpreter fcall.c utilities for function-calls field.c field- and cell-utilities field.h field- and cell utilities headers files.c file- and pipe-functions files.h file- and pipe-functions header fin.c file-input functions fin.h file-input functions header fpe_check.c configure-utility for floating-point checks hash.c symbol table hashing/lookup init.c interpreter initialization functions init.h interpreter initialization functions header install-sh configure-script jmp.c byte-code jumps/branches jmp.h byte-code jumps/branches header kw.c keyword table and lookup functions main.c main program makedeps.sh script to regenerate object-dependencies for Makefile.in makescan.c utility which builds scancode.c matherr.c catch/report math-errors mawk.h main header file for mawk memory.c string-allocation functions memory.h string-allocation functions header nstd.h header for missing.c parse.c generated C parser parse.h generated C parser header parse.y mawk grammar patchlev.h patch-level (see version.c) print.c printf- and sprintf-functions for interpreter re_cmpl.c compile regular expressions regexp.c regular expressions (main) regexp.h interface to main regular expressions regexp_system.c wrapper for system's regular expressions repl.h header for re_cmpl.c rexp.c regular expressions rexp.h regular expression details header rexp0.c built-in regular expression parsing rexp1.c built-in regular expression operations rexp2.c built-in regular expressions matching functions rexp3.c built-in regular expressions matching - main rexp4.c regular expressions utility functions rexpdb.c debugging utilities for regular expressions scan.c program file-management scan.h program file-management header scancode.h list of scan-codes for mawk sizes.h data-type sizes header split.c functions for splitting field, strings, etc. split.h prototypes for split.c symtype.h types related to symbols are defined here trace.c mawk trace-functions types.h mawk datatypes header version.c print mawk's version string vs6.mak makefile for Visual Studio 6 zmalloc.c memory allocation functions zmalloc.h memory allocation functions header examples subdirectory examples/ct_length.awk change length to length() examples/decl.awk parse a C declaration by recursive descent examples/deps.awk find include dependencies in C source examples/eatc.awk another program to remove comments examples/gdecl.awk parse a C declaration by recursive descent examples/hcal Bob's latest examples/hical calendar program by Bob Stockler examples/nocomment.awk remove C comments from a list of files examples/primes.awk find all primes between 2 and STOP (parameter) examples/qsort.awk qsort text files icons subdirectory icons/mawk144.png artwork for my webpage icons/mawk48.png artwork for my webpage icons/mawk48.svg a suitable icon for mawk man subdirectory man/Makefile.in makefile for alternate doc-formats man/TODO to-do list (update to conform with POSIX-1003.1-2004) man/array.pdf generated documentation for array.w man/mawk.1 troff source for unix style man pages man/mawk.doc ascii man pages msdos subdirectory msdos/dosexec.c system() and pipes() for DOS msdos/examples subdirectory msdos/examples/add_cr.awk convert files from Unix to Dos line-endings msdos/examples/doslist.awk print truncated DOS file names msdos/examples/objstat.awk Sum up sizes of OBJ files in current directory msdos/examples/shell.awk Test pipes under DOS msdos/examples/srcstat.awk show sizes (line, char) of files msdos/examples/srcstat2.awk show sizes (line, char) of files msdos/examples/texttest.awk print contents of quoted #include's msdos/examples/winexe.awk sum segment-sizes of exe's in current directory msdos/examples/winobj.awk sum sizes of obj's in current directory msdos subdirectory msdos/vs2008.h definitions for building with Visual Studio 2008 msdos/vs2008.mak nmakefile for building with Visual Studio 2008 package/debian subdirectory package/debian/changelog start working on debian package package/debian/compat debian build-script package/debian/control debian build-script package/debian/copyright debian build-script package/debian/docs debian build-script package/debian/postinst debian build-script package/debian/postrm post-removal script package/debian/preinst debian build script package/debian/prerm debian build-script package/debian/rules debian build-script package/debian/source subdirectory package/debian/source/format debian build script package/debian subdirectory package/debian/watch debian build-script package subdirectory package/mawk.spec RPM script for mawk test subdirectory test/decl-awk.out reference for test using decl.awk test/fpe_test scripts to test if fpe handling compiled OK test/fpe_test.bat scripts to test if fpe handling compiled OK test/fpetest1.awk test exception for divide-by-zero test/fpetest2.awk test exception for floating point overflow test/fpetest3.awk test exception for domain error test/full-awk.dat test-data for /dev/full test/mawknull.dat test-file for embedded nulls test/mawktest scripts to test mawk compiled OK test/mawktest.bat scripts to test mawk compiled OK test/mawktest.dat input data for the test test/nextfile.awk script for testing nextfile test/nextfile.out reference data for nextfile test test/noloop.awk test-script from gawk test/null-rs.awk test-script for setting RS to explicit null test/null-rs.dat input-data for null-rs.awk test/null-rs.out reference for null-rs.awk test/nulls.out output from nulls0.awk test/nulls0.awk script for testing FS containing nulls test/reg-awk.out reference for testing regular expressions test/reg0.awk test simple pattern matching test/reg1.awk test pattern with "|" OR test/reg2.awk test pattern with ranges test/reg3.awk testcase for pattern test/reg4.awk test-case for square-brackets and embedded "/" or "]" test/reg5.awk test-case for character-classes test/reg6.awk testcase for J2C machine state test/reg7.awk test-script for gsub test/wc-awk.out reference for wc.awk test/wc.awk test-script which counts words test/wfrq-awk.out reference for wfrq0.awk test/wfrq0.awk test-script which counts word-frequencies mawk-1.3.4-20200120/makescan.c0000644000175100001440000000513612773576071014033 0ustar tomusers/******************************************** makescan.c copyright 2009-2010,2016, Thomas E. Dickey copyright 1991, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: makescan.c,v 1.11 2016/09/30 23:58:49 tom Exp $ */ /* source for makescan.exe which builds the scancode[] via: makescan.exe > scancode.c */ #include #include #include "nstd.h" #include "scancode.h" char scan_code[256]; static void scan_init(void) { register char *p; memset(scan_code, SC_UNEXPECTED, sizeof(scan_code)); for (p = &scan_code['0']; p <= &scan_code['9']; p++) *p = SC_DIGIT; scan_code[0] = 0; scan_code[' '] = scan_code['\t'] = scan_code['\f'] = SC_SPACE; scan_code['\r'] = scan_code['\013'] = SC_SPACE; scan_code[';'] = SC_SEMI_COLON; scan_code['\n'] = SC_NL; scan_code['{'] = SC_LBRACE; scan_code['}'] = SC_RBRACE; scan_code['+'] = SC_PLUS; scan_code['-'] = SC_MINUS; scan_code['*'] = SC_MUL; scan_code['/'] = SC_DIV; scan_code['%'] = SC_MOD; scan_code['^'] = SC_POW; scan_code['('] = SC_LPAREN; scan_code[')'] = SC_RPAREN; scan_code['_'] = SC_IDCHAR; scan_code['='] = SC_EQUAL; scan_code['#'] = SC_COMMENT; scan_code['\"'] = SC_DQUOTE; scan_code[','] = SC_COMMA; scan_code['!'] = SC_NOT; scan_code['<'] = SC_LT; scan_code['>'] = SC_GT; scan_code['|'] = SC_OR; scan_code['&'] = SC_AND; scan_code['?'] = SC_QMARK; scan_code[':'] = SC_COLON; scan_code['['] = SC_LBOX; scan_code[']'] = SC_RBOX; scan_code['\\'] = SC_ESCAPE; scan_code['.'] = SC_DOT; scan_code['~'] = SC_MATCH; scan_code['$'] = SC_DOLLAR; for (p = &scan_code['A']; p <= &scan_code['Z']; p++) p[0] = p['a' - 'A'] = SC_IDCHAR; } static void scan_print(void) { time_t now = time((time_t *) 0); register char *p = scan_code; register int c; /* column */ register int r; /* row */ printf("/*\n * %cMawkId%c\n * generated by makescan.c\n * date: %s */\n", '$', '$', ctime(&now)); printf("#include \"scancode.h\"\n"); printf("/* *INDENT-OFF* */\n"); printf("char scan_code[256] = {\n"); for (r = 1; r <= 16; r++) { for (c = 1; c <= 16; c++) { printf("%2d", *p++); if (r != 16 || c != 16) putchar(','); } putchar('\n'); } printf("} ;\n"); printf("/* *INDENT-ON* */\n"); } int main(void) { scan_init(); scan_print(); return 0; } mawk-1.3.4-20200120/makedeps.sh0000755000175100001440000000224411500456220014206 0ustar tomusers#!/bin/sh # $MawkId: makedeps.sh,v 1.2 2010/12/10 17:00:00 tom Exp $ ############################################################################### # copyright 2009, Thomas E. Dickey # # This is a source file for mawk, an implementation of # the AWK programming language. # # Mawk is distributed without warranty under the terms of # the GNU General Public License, version 2, 1991. ############################################################################### if test ! -f config.h then echo "? config.h not found" exit 1 fi if test ! -f mawk then echo "? mawk not found" exit 1 fi cat >makedeps.awk <<'EOF' # vile:awkmode # regexp.c is a special case function AddDeps() { for (n = 1; n < NF; ++n) { name = $n; if ( name == ":" ) { ; } else { sub("\.o$", ".c", name); deps[name] = 1; } } } BEGIN { count = 0; } EOF egrep 'include.*\.c"' regexp.c | sed -e 's/^#[^"]*"/\/^/' \ -e 's/\.c/\\.o/' \ -e 's/"/\/ { AddDeps(); next; }/' \ >>makedeps.awk cat >>makedeps.awk <<'EOF' { print; } END { printf "regexp.o :"; for (name in deps) { printf " %s", name; } printf "\n"; } EOF WHINY_USERS=yes ./mawk -f examples/deps.awk *.c | mawk -f makedeps.awk mawk-1.3.4-20200120/configure.in0000644000175100001440000000651613611311140014371 0ustar tomusersdnl $MawkId: configure.in,v 1.60 2020/01/20 11:43:28 tom Exp $ dnl configure.in for mawk dnl ########################################################################### dnl copyright 2008-2019,2020, Thomas E. Dickey dnl copyright 1991-1994,1995, Michael D. Brennan dnl dnl This is a source file for mawk, an implementation of dnl the AWK programming language. dnl dnl Mawk is distributed without warranty under the terms of dnl the GNU General Public License, version 2, 1991. dnl ########################################################################### dnl AC_PREREQ(2.52.20190901) AC_INIT(mawk.h) AC_CONFIG_HEADER(config.h:config_h.in) CF_CHECK_CACHE AC_ARG_PROGRAM AC_DEFUN([AC_PATH_XTRA],[]) CF_PROG_CC AC_PROG_MAKE_SET CF_MAKEFLAGS AC_PROG_CPP AC_PROG_INSTALL CF_HELP_MESSAGE(Cross-compiling) CF_BUILD_CC CF_MAWK_MATHLIB CF_HELP_MESSAGE(Miscellaneous options) CF_DISABLE_ECHO CF_ENABLE_WARNINGS CF_WITH_MAN2HTML ############################################################################### AC_MSG_CHECKING(if you want to use mawk's own regular-expressions engine) AC_ARG_WITH([builtin-regex], [ --without-builtin-regex do not use mawk's own regular-expressions engine], [ with_builtin_regex=$withval ]) if test "x${with_builtin_regex}" != xno; then with_builtin_regex=yes CPPFLAGS="$CPPFLAGS -DLOCAL_REGEXP" fi AC_MSG_RESULT($with_builtin_regex) if test "x${with_builtin_regex}" = xno; then CF_REGEX fi ############################################################################### AC_MSG_CHECKING(if you want to use mawk's own srand/rand functions) CF_ARG_ENABLE([builtin-srand], [ --enable-builtin-srand use mawk's own srand/rand functions], [with_builtin_srand=yes], [with_builtin_srand=no]) if test "x${with_builtin_srand}" != xno; then with_builtin_srand=yes fi AC_MSG_RESULT($with_builtin_srand) if test "x${with_builtin_srand}" = xno; then CF_SRAND(mawk_) AC_DEFINE_UNQUOTED(NAME_RANDOM, "$cf_cv_srand_func", [Define to the name of the random-function]) fi ############################################################################### AC_MSG_CHECKING(if you want mawk to initialize random numbers at startup) CF_ARG_DISABLE([init-srand], [ --disable-init-srand suppress automatic initialization of random numbers], [with_init_srand=no], [with_init_srand=yes]) if test "x${with_init_srand}" != xno; then with_init_srand=yes else CPPFLAGS="$CPPFLAGS -DNO_INIT_SRAND" fi AC_MSG_RESULT($with_init_srand) ############################################################################### AC_PROG_YACC CF_PROG_LINT CF_MAKE_TAGS CF_XOPEN_SOURCE CF_LARGEFILE CF_HELP_MESSAGE(Testing-options) CF_DISABLE_LEAKS CF_ENABLE_TRACE if test "x$with_trace" = xyes then EXTRAOBJS="$EXTRAOBJS trace\$o" fi AC_SUBST(EXTRAOBJS) CF_MAWK_FIND_SIZE_T CF_LOCALE CF_CHECK_ENVIRON(environ) AC_CHECK_FUNCS(fork gettimeofday matherr mktime pipe strftime tdestroy tsearch wait) ### Checks for libraries. case $cf_cv_system_name in (*mingw32*) CPPFLAGS="$CPPFLAGS -DWINVER=0x0501" # LIBS=" -lpsapi $LIBS" ;; esac test "$ac_cv_func_fork" = yes && \ test "$ac_cv_func_pipe" = yes && \ test "$ac_cv_func_wait" = yes && \ AC_DEFINE(HAVE_REAL_PIPES,1,[Define to 1 if we have functions needed to setup Unix pipes]) AC_CHECK_HEADERS(errno.h fcntl.h unistd.h sys/wait.h) CF_SET_MATH_LIB_VERSION CF_MAWK_FIND_MAX_INT CF_MAWK_RUN_FPE_TESTS AC_OUTPUT(Makefile man/Makefile) mawk-1.3.4-20200120/array.w0000644000175100001440000010224013611312353013364 0ustar tomusers\input mwebmac \input ctmac \RCSID{$MawkId: array.w,v 1.21 2020/01/20 11:54:19 tom Exp $} \TOC{Mawk Arrays} \def\expr{{\it expr}} \def\Null{{\it null}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Introduction} This is the source and documentation for the [[mawk]] implementation of awk arrays. Arrays in awk are associations of strings to awk scalar values. The mawk implementation stores the associations in hash tables. The hash table scheme was influenced by and is similar to the design presented in Griswold and Townsend, {\sl The Design and Implementation of Dynamic Hashing Sets and Tables in Icon}, {\bf Software Practice and Experience}, 23, 351-367, 1993. @ \section{Data Structures} @ \subsection{Array Structure} The type [[ARRAY]] is a pointer to a [[struct array]]. The [[size]] field is the number of elements in the table. The meaning of the other fields depends on the [[type]] field. <>= typedef struct array { PTR ptr ; /* What this points to depends on the type */ size_t size ; /* number of elts in the table */ size_t limit ; /* Meaning depends on type */ unsigned hmask ; /* bitwise and with hash value to get table index */ short type ; /* values in AY_NULL .. AY_SPLIT */ } *ARRAY ; @ %def ARRAY There are three types of arrays and these are distinguished by the [[type]] field in the structure. The types are: \I[[AY_NULL]] The array is empty and the [[size]] field is always zero. The other fields have no meaning. \I[[AY_SPLIT]] The array was created by the [[AWK]] built-in [[split]]. The return value from [[split]] is stored in the [[size]] field. The [[ptr]] field points at a vector of [[CELLs]]. The number of [[CELLs]] is the [[limit]] field. It is always true that ${\it size}\leq{\it limit}$. The address of [[A[i]]] is [[(CELL*)A->ptr+i-1]] for $1\leq i\leq{\it size}$. The [[hmask]] field has no meaning. \I{\bf Hash Table} The array is a hash table. If the [[AY_STR]] bit in the [[type]] field is set, then the table is keyed on strings. If the [[AY_INT]] bit in the [[type]] field is set, then the table is keyed on integers. Both bits can be set, and then the two keys are consistent, i.e., look up of [[A[-14]]] and [[A["-14"]]] will return identical [[CELL]] pointers although the look up methods will be different. In this case, the [[size]] field is the number of hash nodes in the table. When insertion of a new element would cause [[size]] to exceed [[limit]], the table grows by doubling the number of hash chains. The invariant, $({\it hmask}+1){\it max\_ave\_list\_length}={\it limit}$, is always true. {\it Max\_ave\_list\_length} is a tunable constant. \endhitems <>= #define AY_NULL 0 #define AY_INT 1 #define AY_STR 2 #define AY_SPLIT 4 @ %def AY_NULL AY_INT AY_STR AY_SPLIT @ \subsection{Hash Tables} The hash tables are linked lists of nodes, called [[ANODEs]]. The number of lists is [[hmask+1]] which is always a power of two. The [[ptr]] field points at a vector of list heads. Since there are potentially two types of lists, integer lists and strings lists, each list head is a structure, [[DUAL_LINK]]. <>= struct anode ; typedef struct {struct anode *slink, *ilink ;} DUAL_LINK ; @ %def anode DUAL_LINK @ The string lists are chains connected by [[slinks]] and the integer lists are chains connected by [[ilinks]]. We sometimes refer to these lists as slists and ilists, respectively. The elements on the lists are [[ANODEs]]. The fields of an [[ANODE]] are: \I[[slink]] The link field for slists. \I[[ilink]] The link field for ilists. \I[[sval]] If non-null, then [[sval]] is a pointer to a string key. For a given table, if the [[AY_STR]] bit is set then every [[ANODE]] has a non-null [[sval]] field and conversely, if [[AY_STR]] is not set, then every [[sval]] field is null. \I[[hval]] The hash value of [[sval]]. This field has no meaning if [[sval]] is null. \I[[ival]] The integer key. The field has no meaning if set to the constant, [[NOT_AN_IVALUE]]. If the [[AY_STR]] bit is off, then every [[ANODE]] will have a valid [[ival]] field. If the [[AY_STR]] bit is on, then the [[ival]] field may or may not be valid. \I[[cell]] The data field in the hash table. \endhitems \noindent So the value of $A[\expr]$ is stored in the [[cell]] field, and if \expr{} is an integer, then \expr{} is stored in [[ival]], else it is stored in [[sval]]. <>= typedef struct anode { struct anode *slink ; struct anode *ilink ; STRING *sval ; unsigned hval ; Int ival ; CELL cell ; } ANODE ; @ %def ANODE @ \section{Array Operations} The functions that operate on arrays are, \I[[CELL* array_find(ARRAY A, CELL *cp, int create_flag)]] returns a pointer to $A[\expr]$ where [[cp]] is a pointer to the [[CELL]] holding \expr\/. If the [[create_flag]] is on and \expr\/ is not an element of [[A]], then the element is created with value \Null\/. \I[[void array_delete(ARRAY A, CELL *cp)]] removes an element $A[\expr]$ from the array $A$. [[cp]] points at the [[CELL]] holding \expr\/. \I[[void array_load(ARRAY A, size_t cnt)]] builds a split array. The values [[A[1..cnt]]] are moved into [[A]] from an anonymous buffer with [[transfer_to_array()]] which is declared in [[split.h]]. \I[[void array_clear(ARRAY A)]] removes all elements of $A$. The type of $A$ is then [[AY_NULL]]. \I[[STRING** array_loop_vector(ARRAY A, size_t *sizep)]] returns a pointer to a linear vector that holds all the strings that are indices of $A$. The size of the the vector is returned indirectly in [[*sizep]]. If [[A->size==0]], a \Null{} pointer is returned. \I[[CELL* array_cat(CELL *sp, int cnt)]] concatenates the elements of ${\it sp}[1-cnt..0]$, with each element separated by [[SUBSEP]], to compute an array index. For example, on a reference to $A[i,j]$, [[array_cat]] computes $i\circ{\it SUBSEP}\circ j$ where $\circ$ denotes concatenation. \endhitems <>= CELL* array_find(ARRAY, CELL*, int); void array_delete(ARRAY, CELL*); void array_load(ARRAY, size_t); void array_clear(ARRAY); STRING** array_loop_vector(ARRAY, size_t*); CELL* array_cat(CELL*, int); @ \subsection{Array Find} Any reference to $A[\expr]$ creates a call to [[array_find(A,cp,CREATE)]] where [[cp]] points at the cell holding \expr\/. The test, $\expr \hbox{ in } A$, creates a call to [[array_find(A,cp,NO_CREATE)]]. <>= #define NO_CREATE 0 #define CREATE 1 @ %def NO_CREATE CREATE @ [[Array_find]] is hash-table lookup that breaks into two cases: \list \item{(1)} If [[*cp]] is numeric and integer valued, then lookup by integer value using [[find_by_ival]]. If [[*cp]] is numeric, but not integer valued, then convert to string with [[sprintf(CONVFMT,...)]] and go to case~2. \item{(2)} If [[*cp]] is string valued, then lookup by string value using [[find_by_sval]]. \endlist <>= CELL* array_find( ARRAY A, CELL *cp, int create_flag) { ANODE *ap ; int redid ; if (A->size == 0 && !create_flag) /* eliminating this trivial case early avoids unnecessary conversions later */ return (CELL*) 0 ; switch (cp->type) { case C_DOUBLE: <> break ; case C_NOINIT: ap = find_by_sval(A, &null_str, create_flag, &redid) ; break ; default: ap = find_by_sval(A, string(cp), create_flag, &redid) ; break ; } return ap ? &ap->cell : (CELL *) 0 ; } @ %def array_find @ To test whether [[cp->dval]] is integer, we convert to the nearest integer by rounding towards zero (done by [[do_to_I]]) and then cast back to double. If we get the same number we started with, then [[cp->dval]] is integer valued. <>= { double d = cp->dval ; Int ival = d_to_I(d) ; if ((double)ival == d) { if (A->type == AY_SPLIT) { if (ival >= 1 && ival <= (int) A->size) return (CELL*)A->ptr+(ival-1) ; if (!create_flag) return (CELL*) 0 ; convert_split_array_to_table(A) ; } else if (A->type == AY_NULL) make_empty_table(A, AY_INT) ; ap = find_by_ival(A, ival, create_flag, &redid) ; } else { /* convert to string */ char buff[260] ; STRING *sval ; sprintf(buff, string(CONVFMT)->str, d) ; sval = new_STRING(buff) ; ap = find_by_sval(A, sval, create_flag, &redid) ; free_STRING(sval) ; } } @ When we get to the function [[find_by_ival]], the search has been reduced to lookup in a hash table by integer value. <>= static ANODE* find_by_ival( ARRAY A , Int ival , int create_flag , int *redo ) { DUAL_LINK *table = (DUAL_LINK*) A->ptr ; unsigned indx = (unsigned) ival & A->hmask ; ANODE *p = table[indx].ilink ; /* walks ilist */ ANODE *q = (ANODE*) 0 ; /* trails p */ while(1) { if (!p) { /* search failed */ <> break ; } else if (p->ival == ival) { /* found it, now move to the front */ if (!q) /* already at the front */ return p ; /* delete for insertion at the front */ q->ilink = p->ilink ; break ; } q = p ; p = q->ilink ; } /* insert at the front */ p->ilink = table[indx].ilink ; table[indx].ilink = p ; return p ; } @ %def find_by_ival <>= static ANODE* find_by_ival(ARRAY, Int, int, int*); @ When a search by integer value fails, we have to check by string value to correctly handle the case insertion by [[A["123"]]] and later search as [[A[123]]]. This string search is necessary if and only if the [[AY_STR]] bit is set. An important point is that all [[ANODEs]] get created with a valid [[sval]] if [[AY_STR]] is set, because then creation of new nodes always occurs in a call to [[find_by_sval]]. <>= if (A->type & AY_STR) { /* need to search by string */ char buff[256] ; STRING *sval ; sprintf(buff, INT_FMT, ival) ; sval = new_STRING(buff) ; p = find_by_sval(A, sval, create_flag, redo) ; if (*redo) { table = (DUAL_LINK*) A->ptr ; } free_STRING(sval) ; if (!p) return (ANODE*) 0 ; } else if (create_flag) { p = ZMALLOC(ANODE) ; p->sval = (STRING*) 0 ; p->cell.type = C_NOINIT ; if (++A->size > A->limit) { double_the_hash_table(A) ; /* changes table, may change index */ table = (DUAL_LINK*) A->ptr ; indx = A->hmask & (unsigned) ival ; } } else return (ANODE*) 0 ; p->ival = ival ; A->type |= AY_INT ; @ Searching by string value is easier because [[AWK]] arrays are really string associations. If the array does not have the [[AY_STR]] bit set, then we have to convert the array to a dual hash table with strings which is done by the function [[add_string_associations]]. <>= static ANODE* find_by_sval( ARRAY A , STRING *sval , int create_flag , int *redo ) { unsigned hval = ahash(sval) ; char *str = sval->str ; DUAL_LINK *table ; unsigned indx ; ANODE *p ; /* walks list */ ANODE *q = (ANODE*) 0 ; /* trails p */ if (! (A->type & AY_STR)) add_string_associations(A) ; table = (DUAL_LINK*) A->ptr ; indx = hval & A->hmask ; p = table[indx].slink ; *redo = 0 ; while(1) { if (!p) { if (create_flag) { <> break ; } return (ANODE*) 0 ; } else if (p->hval == hval) { if (strcmp(p->sval->str,str) == 0 ) { /* found */ if (!q) /* already at the front */ return p ; else { /* delete for move to the front */ q->slink = p->slink ; break ; } } } q = p ; p = q->slink ; } p->slink = table[indx].slink ; table[indx].slink = p ; return p ; } @ %def find_by_sval <>= static ANODE* find_by_sval(ARRAY, STRING*, int, int*); @ One [[Int]] value is reserved to show that the [[ival]] field is invalid. This works because [[d_to_I]] returns a value in [[[-Max_Int, Max_Int]]]. <>= #define NOT_AN_IVALUE (-Max_Int-1) /* usually 0x80000000 */ @ %def NOT_AN_IVALUE <>= { p = ZMALLOC(ANODE) ; p->sval = sval ; sval->ref_cnt++ ; p->ival = NOT_AN_IVALUE ; p->hval = hval ; p->cell.type = C_NOINIT ; if (++A->size > A->limit) { double_the_hash_table(A) ; /* changes table, may change index */ table = (DUAL_LINK*) A->ptr ; indx = hval & A->hmask ; *redo = 1 ; } } @ On entry to [[add_string_associations]], we know that the [[AY_STR]] bit is not set. We convert to a dual hash table, then walk all the integer lists and put each [[ANODE]] on a string list. <>= static void add_string_associations(ARRAY A) { if (A->type == AY_NULL) make_empty_table(A, AY_STR) ; else { DUAL_LINK *table ; int i ; /* walks table */ ANODE *p ; /* walks ilist */ char buff[256] ; if (A->type == AY_SPLIT) convert_split_array_to_table(A) ; table = (DUAL_LINK*) A->ptr ; for(i=0; (unsigned) i <= A->hmask; i++) { p = table[i].ilink ; while(p) { sprintf(buff, INT_FMT, p->ival) ; p->sval = new_STRING(buff) ; p->hval = ahash(p->sval) ; p->slink = table[A->hmask&p->hval].slink ; table[A->hmask&p->hval].slink = p ; p = p->ilink ; } } A->type |= AY_STR ; } } @ %def add_string_associations <>= static void add_string_associations(ARRAY); @ \subsection{Array Delete} The execution of the statement, $\hbox{\it delete }A[\expr]$, creates a call to{\hfil\break}[[array_delete(ARRAY A, CELL *cp)]]. Depending on the type of [[*cp]], the call is routed to [[find_by_sval]] or [[find_by_ival]]. Each of these functions leaves its return value on the front of an slist or ilist, respectively, and then it is deleted from the front of the list. The case where $A[\expr]$ is on two lists, e.g., [[A[12]]] and [[A["12"]]] is checked by examining the [[sval]] and [[ival]] fields of the returned [[ANODE*]]. <>= void array_delete( ARRAY A, CELL *cp) { ANODE *ap ; int redid ; if (A->size == 0) return ; switch(cp->type) { case C_DOUBLE : { double d = cp->dval ; Int ival = d_to_I(d) ; if ((double)ival == d) <> else { /* get the string value */ char buff[260] ; STRING *sval ; sprintf(buff, string(CONVFMT)->str, d) ; sval = new_STRING(buff) ; ap = find_by_sval(A, sval, NO_CREATE, &redid) ; free_STRING(sval) ; } } break ; case C_NOINIT : ap = find_by_sval(A, &null_str, NO_CREATE, &redid) ; break ; default : ap = find_by_sval(A, string(cp), NO_CREATE, &redid) ; break ; } if (ap) { /* remove from the front of the slist */ DUAL_LINK *table = (DUAL_LINK*) A->ptr ; table[ap->hval & A->hmask].slink = ap->slink ; <> free_STRING(ap->sval) ; cell_destroy(&ap->cell) ; ZFREE(ap) ; <size]]>> } } <>= { if (A->type == AY_SPLIT) { if (ival >=1 && ival <= (int) A->size) convert_split_array_to_table(A) ; else return ; /* ival not in range */ } ap = find_by_ival(A, ival, NO_CREATE, &redid) ; if (ap) { /* remove from the front of the ilist */ DUAL_LINK *table = (DUAL_LINK*) A->ptr ; table[(unsigned) ap->ival & A->hmask].ilink = ap->ilink ; <> cell_destroy(&ap->cell) ; ZFREE(ap) ; <size]]>> } return ; } @ Even though we found a node by searching an ilist it might also be on an slist and vice-versa. <>= if (ap->sval) { ANODE *p, *q = 0 ; unsigned indx = (unsigned) ap->hval & A->hmask ; p = table[indx].slink ; while(p != ap) { q = p ; p = q->slink ; } if (q) q->slink = p->slink ; else table[indx].slink = p->slink ; free_STRING(ap->sval) ; } <>= if (ap->ival != NOT_AN_IVALUE) { ANODE *p, *q = 0 ; unsigned indx = (unsigned) ap->ival & A->hmask ; p = table[indx].ilink ; while(p != ap) { q = p ; p = q->ilink ; } if (q) q->ilink = p->ilink ; else table[indx].ilink = p->ilink ; } @ When the size of a hash table drops below a certain value, it might be profitable to shrink the hash table. Currently we don't do this, because our guess is that it would be a waste of time for most [[AWK]] applications. However, we do convert an array to [[AY_NULL]] when the size goes to zero which would resize a large hash table that had been completely cleared by successive deletions. <size]]>>= if (--A->size == 0) array_clear(A) ; @ \subsection{Building an Array with Split} A simple operation is to create an array with the [[AWK]] primitive [[split]]. The code that performs [[split]] puts the pieces in an anonymous buffer. [[array_load(A, cnt)]] moves the [[cnt]] elements from the anonymous buffer into [[A]]. This is the only way an array of type [[AY_SPLIT]] is created. <>= void array_load( ARRAY A, size_t cnt) { <> A->size = cnt ; transfer_to_array((CELL*) A->ptr, cnt) ; } @ %def array_load @ If the array [[A]] is a split array and big enough then we reuse it, otherwise we need to allocate a new split array. When we allocate a block of [[CELLs]] for a split array, we round up to a multiple of 4. <>= if (A->type != AY_SPLIT || A->limit < cnt) { array_clear(A) ; A->limit = (cnt & (size_t) ~3) + 4 ; A->ptr = zmalloc(A->limit*sizeof(CELL)) ; A->type = AY_SPLIT ; } else { /* reusing an existing AY_SPLIT array */ size_t i ; for(i=0; i < A->size; i++) { cell_destroy((CELL*)A->ptr + i) ; } } @ \subsection{Array Clear} The function [[array_clear(ARRAY A)]] converts [[A]] to type [[AY_NULL]] and frees all storage used by [[A]] except for the [[struct array]] itself. This function gets called in three contexts: (1)~when an array local to a user function goes out of scope, (2)~execution of the [[AWK]] statement, [[delete A]] and (3)~when an existing changes type or size from [[split()]]. <>= void array_clear(ARRAY A) { unsigned i ; ANODE *p, *q ; if (A->type == AY_SPLIT) { for(i = 0; i < A->size; i++) cell_destroy((CELL*)A->ptr+i) ; zfree(A->ptr, A->limit * sizeof(CELL)) ; } else if (A->type & AY_STR) { DUAL_LINK *table = (DUAL_LINK*) A->ptr ; for(i=0; (unsigned) i <= A->hmask; i++) { p = table[i].slink ; while(p) { q = p ; p = q->slink ; free_STRING(q->sval) ; cell_destroy(&q->cell) ; ZFREE(q) ; } } zfree(A->ptr, (A->hmask+1)*sizeof(DUAL_LINK)) ; } else if (A->type & AY_INT) { DUAL_LINK *table = (DUAL_LINK*) A->ptr ; for(i=0; (unsigned) i <= A->hmask; i++) { p = table[i].ilink ; while(p) { q = p ; p = q->ilink ; cell_destroy(&q->cell) ; ZFREE(q) ; } } zfree(A->ptr, (A->hmask+1)*sizeof(DUAL_LINK)) ; } memset(A, 0, sizeof(*A)) ; } @ %def array_clear @ \subsection{Constructor and Conversions} Arrays are always created as empty arrays of type [[AY_NULL]]. Global arrays are never destroyed although they can go empty or have their type change by conversion. The only constructor function is a macro. <>= #define new_ARRAY() ((ARRAY)memset(ZMALLOC(struct array),0,sizeof(struct array))) @ %def new_ARRAY @ Hash tables only get constructed by conversion. This happens in two ways. The function [[make_empty_table]] converts an empty array of type [[AY_NULL]] to an empty hash table. The number of lists in the table is a power of 2 determined by the constant [[STARTING_HMASK]]. The limit size of the table is determined by the constant [[MAX_AVE_LIST_LENGTH]] which is the largest average size of the hash lists that we are willing to tolerate before enlarging the table. When [[A->size]] exceeds [[A->limit]], the hash table grows in size by doubling the number of lists. [[A->limit]] is then reset to [[MAX_AVE_LIST_LENGTH]] times [[A->hmask+1]]. <>= #define STARTING_HMASK 63 /* 2^6-1, must have form 2^n-1 */ #define MAX_AVE_LIST_LENGTH 12 #define hmask_to_limit(x) (((x)+1)*MAX_AVE_LIST_LENGTH) #define ahash(sval) hash2((sval)->str, (sval)->len) @ %def STARTING_HMASK @ %def MAX_AVE_LIST_LENGTH @ %def hmask_to_limit @ %def ahash <>= static void make_empty_table( ARRAY A , int type ) /* AY_INT or AY_STR */ { size_t sz = (STARTING_HMASK+1)*sizeof(DUAL_LINK) ; A->type = (short) type ; A->hmask = STARTING_HMASK ; A->limit = hmask_to_limit(STARTING_HMASK) ; A->ptr = memset(zmalloc(sz), 0, sz) ; } @ %def make_empty_table <>= static void make_empty_table(ARRAY, int); @ The other way a hash table gets constructed is when a split array is converted to a hash table of type [[AY_INT]]. <>= static void convert_split_array_to_table(ARRAY A) { CELL *cells = (CELL*) A->ptr ; unsigned i ; /* walks cells */ DUAL_LINK *table ; unsigned j ; /* walks table */ size_t entry_limit = A->limit ; <> /* insert each cells[i] in the new hash table on an ilist */ for(i=0, j=1; i < A->size; i++) { ANODE *p = ZMALLOC(ANODE) ; p->sval = (STRING*) 0 ; p->ival = (Int) (i + 1) ; p->cell = cells[i] ; p->ilink = table[j].ilink ; table[j].ilink = p ; j++ ; j &= A->hmask ; } A->type = AY_INT ; zfree(cells, entry_limit*sizeof(CELL)) ; } @ %def convert_split_array_to_table <>= static void convert_split_array_to_table(ARRAY); @ To determine the size of the table, we set the initial size to [[STARTING_HMASK+1]] and then double the size until [[A->size <= A->limit]]. <>= A->hmask = STARTING_HMASK ; A->limit = hmask_to_limit(STARTING_HMASK) ; while(A->size > A->limit) { A->hmask = (A->hmask<<1) + 1 ; /* double the size */ A->limit = hmask_to_limit(A->hmask) ; } { size_t sz = (A->hmask+1)*sizeof(DUAL_LINK) ; A->ptr = memset(zmalloc(sz), 0, sz) ; table = (DUAL_LINK*) A->ptr ; } @ \subsection{Doubling the Size of a Hash Table} The whole point of making the table size a power of two is to facilitate resizing the table. If the table size is $2^n$ and $h$ is the hash key, then $h\bmod 2^n$ is the hash chain index which can be calculated with bit-wise and, {\mathchardef~="2026 $h ~ (2^n-1)$}. When the table size doubles, the new bit-mask has one more bit turned on. Elements of an old hash chain whose hash value have this bit turned on get moved to a new chain. Elements with this bit turned off stay on the same chain. On average only half the old chain moves to the new chain. If the old chain is at ${\it table}[i],\ 0\le i < 2^n$, then the elements that move, all move to the new chain at ${\it table}[i+2^n]$. <>= static void double_the_hash_table(ARRAY A) { unsigned old_hmask = A->hmask ; unsigned new_hmask = (old_hmask<<1)+1 ; DUAL_LINK *table ; <> <> <> A->hmask = new_hmask ; A->limit = hmask_to_limit(new_hmask) ; } @ %def double_the_hash_table <>= static void double_the_hash_table(ARRAY); <>= A->ptr = zrealloc(A->ptr, (old_hmask+1)*sizeof(DUAL_LINK), (new_hmask+1)*sizeof(DUAL_LINK)) ; table = (DUAL_LINK*) A->ptr ; /* zero out the new part which is the back half */ memset(&table[old_hmask+1], 0, (old_hmask+1)*sizeof(DUAL_LINK)) ; <>= if (A->type & AY_STR) { unsigned i ; /* index to old lists */ unsigned j ; /* index to new lists */ ANODE *p ; /* walks an old list */ ANODE *q ; /* trails p for deletion */ ANODE *tail ; /* builds new list from the back */ ANODE dummy0, dummy1 ; for(i=0, j=old_hmask+1; i <= old_hmask; i++, j++) <> } @ As we walk an old string list with pointer [[p]], the expression [[p->hval & new_hmask]] takes one of two values. If it is equal to [[p->hval & old_hmask]] (which equals [[i]]), then the node stays otherwise it gets moved to a new string list at [[j]]. The new string list preserves order so that the positions of the move-to-the-front heuristic are preserved. Nodes moving to the new list are appended at pointer [[tail]]. The [[ANODEs]], [[dummy0]]~and [[dummy1]], are sentinels that remove special handling of boundary conditions. <>= { q = &dummy0 ; q->slink = p = table[i].slink ; tail = &dummy1 ; while (p) { if ((p->hval & new_hmask) != (unsigned) i) { /* move it */ q->slink = p->slink ; tail = tail->slink = p ; } else q = p ; p = q->slink ; } table[i].slink = dummy0.slink ; tail->slink = (ANODE*) 0 ; table[j].slink = dummy1.slink ; } @ The doubling of the integer lists is exactly the same except that [[slink]] is replaced by [[ilink]] and [[hval]] is replaced by [[ival]]. <>= if (A->type & AY_INT) { unsigned i ; /* index to old lists */ unsigned j ; /* index to new lists */ ANODE *p ; /* walks an old list */ ANODE *q ; /* trails p for deletion */ ANODE *tail ; /* builds new list from the back */ ANODE dummy0, dummy1 ; for(i=0, j=old_hmask+1; i <= old_hmask; i++, j++) <> } <>= { q = &dummy0 ; q->ilink = p = table[i].ilink ; tail = &dummy1 ; while (p) { if (((unsigned) p->ival & new_hmask) != i) { /* move it */ q->ilink = p->ilink ; tail = tail->ilink = p ; } else q = p ; p = q->ilink ; } table[i].ilink = dummy0.ilink ; tail->ilink = (ANODE*) 0 ; table[j].ilink = dummy1.ilink ; } @ Initializing Array Loops Our mechanism for dealing with execution of the statement, \medskip \centerline{[[for(i in A) {]] {\it statements} [[}]]} \medskip \noindent is simple. We allocate a vector of [[STRING*]] of size, [[A->size]]. Each element of the vector is a string key for~[[A]]. Note that if the [[AY_STR]] bit of [[A]] is not set, then [[A]] has to be converted to a string hash table, because the index [[i]] walks string indices. To execute the loop, the only state that needs to be saved is the address of [[i]] and an index into the vector of string keys. Since nothing about [[A]] is saved as state, the user program can do anything to [[A]] inside the body of the loop, even [[delete A]], and the loop still works. Essentially, we have traded data space (the string vector) in exchange for implementation simplicity. On a 32-bit system, each [[ANODE]] is 36 bytes, so the extra memory needed for the array loop is 11\% more than the memory consumed by the [[ANODEs]] of the array. Note that the large size of the [[ANODEs]] is indicative of our whole design which pays data space for integer lookup speed and algorithm simplicity. The only aspect of array loops that occurs in [[array.c]] is construction of the string vector. The rest of the implementation is in the file [[execute.c]]. <>= static int string_compare( const void *l, const void *r) { STRING*const * a = (STRING *const *) l; STRING*const * b = (STRING *const *) r; return strcmp((*a)->str, (*b)->str); } @ %def string_compare <>= STRING** array_loop_vector( ARRAY A, size_t *sizep) { STRING** ret ; *sizep = A->size ; if (A->size > 0) { if (!(A->type & AY_STR)) add_string_associations(A) ; ret = (STRING**) zmalloc(A->size*sizeof(STRING*)) ; <> if (getenv("WHINY_USERS") != NULL) /* gawk compatibility */ qsort(ret, A->size, sizeof(STRING*), string_compare); return ret ; } return (STRING**) 0 ; } @ %def array_loop_vector @ As we walk over the hash table [[ANODEs]], putting each [[sval]] in [[ret]], we need to increment each reference count. The user of the return value is responsible for these new reference counts. <>= { int r = 0 ; /* indexes ret */ DUAL_LINK* table = (DUAL_LINK*) A->ptr ; int i ; /* indexes table */ ANODE *p ; /* walks slists */ for(i=0; (unsigned) i <= A->hmask; i++) { for(p = table[i].slink; p ; p = p->slink) { ret[r++] = p->sval ; p->sval->ref_cnt++ ; } } } @ \subsection{Concatenating Array Indices} In [[AWK]], an array expression [[A[i,j]]] is equivalent to the expression [[A[i SUBSEP j]]], i.e., the index is the concatenation of the three elements [[i]], [[SUBSEP]] and [[j]]. This is performed by the function [[array_cat]]. On entry, [[sp]] points at the top of a stack of [[CELLs]]. [[Cnt]] cells are popped off the stack and concatenated together separated by [[SUBSEP]] and the result is pushed back on the stack. On entry, the first multi-index is in [[sp[1-cnt]]] and the last is in [[sp[0]]]. The return value is the new stack top. (The stack is the run-time evaluation stack. This operation really has nothing to do with array structure, so logically this code belongs in [[execute.c]], but remains here for historical reasons.) <>= CELL *array_cat( CELL *sp, int cnt) { CELL *p ; /* walks the eval stack */ CELL subsep ; /* local copy of SUBSEP */ <> size_t total_len ; /* length of cat'ed expression */ CELL *top ; /* value of sp at entry */ char *target ; /* build cat'ed char* here */ STRING *sval ; /* build cat'ed STRING here */ <> <> <> <> <> } @ %def array_cat @ We make a copy of [[SUBSEP]] which we can cast to string in the unlikely event the user has assigned a number to [[SUBSEP]]. <>= size_t subsep_len ; /* string length of subsep_str */ char *subsep_str ; <>= cellcpy(&subsep, SUBSEP) ; if ( subsep.type < C_STRING ) cast1_to_s(&subsep) ; subsep_len = string(&subsep)->len ; subsep_str = string(&subsep)->str ; @ Set [[sp]] and [[top]] so the cells to concatenate are inclusively between [[sp]] and [[top]]. <>= assert(cnt > 0); top = sp ; sp -= (cnt-1) ; @ The [[total_len]] is the sum of the lengths of the [[cnt]] strings and the [[cnt-1]] copies of [[subsep]]. <>= total_len = ((size_t) (cnt-1)) * subsep_len ; for(p = sp ; p <= top ; p++) { if ( p->type < C_STRING ) cast1_to_s(p) ; total_len += string(p)->len ; } <>= sval = new_STRING0(total_len) ; target = sval->str ; for(p = sp ; p < top ; p++) { memcpy(target, string(p)->str, string(p)->len) ; target += string(p)->len ; memcpy(target, subsep_str, subsep_len) ; target += subsep_len ; } /* now p == top */ memcpy(target, string(p)->str, string(p)->len) ; @ The return value is [[sp]] and it is already set correctly. We just need to free the strings and set the contents of [[sp]]. <>= for(p = sp; p <= top ; p++) free_STRING(string(p)) ; free_STRING(string(&subsep)) ; /* set contents of sp , sp->type > C_STRING is possible so reset */ sp->type = C_STRING ; sp->ptr = (PTR) sval ; return sp ; @ \section{Source Files} <<"array.h">>= /* array.h */ <> #ifndef ARRAY_H #define ARRAY_H 1 #include "nstd.h" #include "types.h" <> <> #endif /* ARRAY_H */ <<"array.c">>= /* array.c */ <> #include "mawk.h" #include "symtype.h" #include "memory.h" #include "split.h" #include "field.h" #include "bi_vars.h" <> <> <> <>= /* $MawkId: array.w,v 1.21 2020/01/20 11:54:19 tom Exp $ copyright 2009-2019,2020 Thomas E. Dickey copyright 1991-1996,2014 Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. array.c and array.h were generated with the commands notangle -R'"array.c"' array.w > array.c notangle -R'"array.h"' array.w > array.h Notangle is part of Norman Ramsey's noweb literate programming package available from CTAN(ftp.shsu.edu). It's easiest to read or modify this file by working with array.w. */ @ \idindex mawk-1.3.4-20200120/config.guess0000755000175100001440000013647113577276335014437 0ustar tomusers#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2019 Free Software Foundation, Inc. timestamp='2019-12-21' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. tmp= # shellcheck disable=SC2172 trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 set_cc_for_build() { # prevent multiple calls if $tmp is already set test "$tmp" && return 0 : "${TMPDIR=/tmp}" # shellcheck disable=SC2039 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$driver" break fi done if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac } # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu set_cc_for_build cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" # If ldd exists, use it to detect musl libc. if command -v ldd >/dev/null && \ ldd --version 2>&1 | grep -q ^musl then LIBC=musl fi ;; esac # Note: order is significant - the case branches are not exclusive. case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ "/sbin/$sysctl" 2>/dev/null || \ "/usr/sbin/$sysctl" 2>/dev/null || \ echo unknown)` case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine="${arch}${endian}"-unknown ;; *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "$machine-${os}${release}${abi-}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" exit ;; *:MidnightBSD:*:*) echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; *:OS108:*:*) echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:Sortix:*:*) echo "$UNAME_MACHINE"-unknown-sortix exit ;; *:Twizzler:*:*) echo "$UNAME_MACHINE"-unknown-twizzler exit ;; *:Redox:*:*) echo "$UNAME_MACHINE"-unknown-redox exit ;; mips:OSF1:*.*) echo mips-dec-osf1 exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ [ "$TARGET_BINARY_INTERFACE"x = x ] then echo m88k-dg-dgux"$UNAME_RELEASE" else echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` case "$UNAME_MACHINE" in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "$sc_cpu_version" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "$sc_kernel_bits" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if [ "$HP_ARCH" = "" ]; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ "$HP_ARCH" = hppa2.0w ] then set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo "$UNAME_MACHINE"-unknown-osf1mk else echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi else echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf fi exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case "$UNAME_PROCESSOR" in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) case "$UNAME_MACHINE" in x86) echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; i*:UWIN*:*) echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-pc-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; *:Minix:*:*) echo "$UNAME_MACHINE"-unknown-minix exit ;; aarch64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; k1om:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 test x"${LIBC}" = xgnu && IS_GLIBC=1 sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef mips #undef mipsel #undef mips64 #undef mips64el #if ${IS_GLIBC} && defined(_ABI64) LIBCABI=gnuabi64 #else #if ${IS_GLIBC} && defined(_ABIN32) LIBCABI=gnuabin32 #else LIBCABI=${LIBC} #endif #endif #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa64r6 #else #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa32r6 #else #if defined(__mips64) CPU=mips64 #else CPU=mips #endif #endif #endif #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) MIPS_ENDIAN= #else MIPS_ENDIAN= #endif #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-"$LIBC" exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; xtensa*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv"$UNAME_RELEASE" else echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux"$UNAME_RELEASE" exit ;; SX-ACE:SUPER-UX:*:*) echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac if command -v xcode-select > /dev/null 2> /dev/null && \ ! xcode-select --print-path > /dev/null 2> /dev/null ; then # Avoid executing cc if there is no toolchain installed as # cc will be a stub that puts up a graphical alert # prompting the user to install developer tools. CC_FOR_BUILD=no_compiler_found else set_cc_for_build fi if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-*:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; NSR-*:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; NSV-*:NONSTOP_KERNEL:*:*) echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; NSX-*:NONSTOP_KERNEL:*:*) echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. # shellcheck disable=SC2154 if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) echo "$UNAME_MACHINE"-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; *:Unleashed:*:*) echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" exit ;; esac # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" < #include #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #include #if defined(_SIZE_T_) || defined(SIGLOST) #include #endif #endif #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) #if !defined (ultrix) #include #if defined (BSD) #if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); #else #if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); #else printf ("vax-dec-bsd\n"); exit (0); #endif #endif #else printf ("vax-dec-bsd\n"); exit (0); #endif #else #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname un; uname (&un); printf ("vax-dec-ultrix%s\n", un.release); exit (0); #else printf ("vax-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname *un; uname (&un); printf ("mips-dec-ultrix%s\n", un.release); exit (0); #else printf ("mips-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } echo "$0: unable to guess system type" >&2 case "$UNAME_MACHINE:$UNAME_SYSTEM" in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF exit 1 # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: mawk-1.3.4-20200120/regexp.c0000644000175100001440000000216012371103423013512 0ustar tomusers/* regexp_system.c copyright 2009-2010,2014, Thomas E. Dickey copyright 2005, Aleksey Cheusov This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. */ /* $MawkId: regexp.c,v 1.8 2014/08/08 08:15:15 tom Exp $ */ #ifdef LOCAL_REGEXP # include "mawk.h" #define RE_FILL() { goto refill; } #define RE_CASE() { goto reswitch; } # include "rexp.c" # include "rexp0.c" # include "rexp1.c" # include "rexp2.c" # include "rexp3.c" # include "rexp4.c" # include "rexpdb.c" #else # include "rexp4.c" # include "regexp_system.c" #endif #ifdef NO_LEAKS void rexp_leaks(void) { TRACE(("rexp_leaks\n")); #ifdef LOCAL_REGEXP lookup_cclass(0); if (bv_base) { BV **p = bv_base; while (p != bv_next) { RE_free(*p); ++p; } RE_free(bv_base); bv_base = 0; bv_limit = 0; bv_next = 0; } if (RE_run_stack_base) { RE_free(RE_run_stack_base); RE_run_stack_base = 0; } if (RE_pos_stack_base) { RE_free(RE_pos_stack_base); RE_pos_stack_base = 0; } #endif } #endif mawk-1.3.4-20200120/regexp.h0000644000175100001440000000170212404431616013525 0ustar tomusers/******************************************** regexp.h copyright 2009-2010,2014, Thomas E. Dickey copyright 2005, Aleksey Cheusov copyright 1991,1993, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: regexp.h,v 1.13 2014/09/11 23:43:10 tom Exp $ * @Log: regexp.h,v @ * Revision 1.1.1.1 1993/07/03 18:58:19 mike * move source to cvs * * Revision 5.1 1991/12/05 07:59:30 brennan * 1.1 pre-release * */ #ifndef MAWK_REPL_H #define MAWK_REPL_H #include #include "nstd.h" PTR REcompile(char *, size_t); void REdestroy(PTR); int REtest(char *, size_t, PTR); char *REmatch(char *, size_t, PTR, size_t *, int); void REmprint(PTR, FILE *); const char *REs_type(PTR); const char *REerror(void); #endif /* MAWK_REPL_H */ mawk-1.3.4-20200120/bi_vars.c0000644000175100001440000000417511500456220013654 0ustar tomusers/******************************************** bi_vars.c copyright 2009,2010, Thomas E. Dickey copyright 1991-1992,1993, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: bi_vars.c,v 1.10 2010/12/10 17:00:00 tom Exp $ * @Log: bi_vars.c,v @ * Revision 1.1.1.1 1993/07/03 18:58:09 mike * move source to cvs * * Revision 5.2 1992/07/10 16:17:10 brennan * MsDOS: remove NO_BINMODE macro * * Revision 5.1 1991/12/05 07:55:38 brennan * 1.1 pre-release * */ /* bi_vars.c */ #include "mawk.h" #include "symtype.h" #include "bi_vars.h" #include "field.h" #include "init.h" #include "memory.h" /* the builtin variables */ CELL bi_vars[NUM_BI_VAR]; /* the order here must match the order in bi_vars.h */ static const char *bi_var_names[NUM_BI_VAR] = { "NR", "FNR", "ARGC", "FILENAME", "OFS", "ORS", "RLENGTH", "RSTART", "SUBSEP" #if USE_BINMODE ,"BINMODE" #endif }; /* insert the builtin vars in the hash table */ void bi_vars_init(void) { register int i; register SYMTAB *s; for (i = 0; i < NUM_BI_VAR; i++) { s = insert(bi_var_names[i]); s->type = (char) ((i <= 1) ? ST_NR : ST_VAR); s->stval.cp = bi_vars + i; /* bi_vars[i].type = 0 which is C_NOINIT */ } s = insert("ENVIRON"); s->type = ST_ENV; /* set defaults */ FILENAME->type = C_STRING; FILENAME->ptr = (PTR) new_STRING(""); OFS->type = C_STRING; OFS->ptr = (PTR) new_STRING(" "); ORS->type = C_STRING; ORS->ptr = (PTR) new_STRING("\n"); SUBSEP->type = C_STRING; SUBSEP->ptr = (PTR) new_STRING("\034"); NR->type = FNR->type = C_DOUBLE; /* dval is already 0.0 */ #if USE_BINMODE BINMODE->type = C_DOUBLE; #endif } #ifdef NO_LEAKS void bi_vars_leaks(void) { int n; for (n = 0; n < NUM_BI_VAR; ++n) { switch (bi_vars[n].type) { case C_STRING: case C_STRNUM: case C_MBSTRN: free_STRING(string(&bi_vars[n])); break; } } } #endif mawk-1.3.4-20200120/bi_funct.c0000644000175100001440000006413313604602560014027 0ustar tomusers/******************************************** bi_funct.c copyright 2008-2016,2020, Thomas E. Dickey copyright 1991-1995,1996, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: bi_funct.c,v 1.111 2020/01/06 10:01:20 tom Exp $ */ #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined(mawk_srand) || defined(mawk_rand) #define USE_SYSTEM_SRAND #endif #if defined(HAVE_BSD_STDLIB_H) && defined(USE_SYSTEM_SRAND) #include /* prototype arc4random */ #endif #if defined(WINVER) && (WINVER >= 0x501) #include #endif #if OPT_TRACE > 0 #define return_CELL(func, cell) TRACE(("..." func " ->")); \ TRACE_CELL(cell); \ return cell #else #define return_CELL(func, cell) return cell #endif /* global for the disassembler */ /* *INDENT-OFF* */ const BI_REC bi_funct[] = { /* info to load builtins */ { "length", bi_length, 0, 1 }, /* special must come first */ { "index", bi_index, 2, 2 }, { "substr", bi_substr, 2, 3 }, { "sprintf", bi_sprintf, 1, 255 }, { "sin", bi_sin, 1, 1 }, { "cos", bi_cos, 1, 1 }, { "atan2", bi_atan2, 2, 2 }, { "exp", bi_exp, 1, 1 }, { "log", bi_log, 1, 1 }, { "int", bi_int, 1, 1 }, { "sqrt", bi_sqrt, 1, 1 }, { "rand", bi_rand, 0, 0 }, { "srand", bi_srand, 0, 1 }, { "close", bi_close, 1, 1 }, { "system", bi_system, 1, 1 }, { "toupper", bi_toupper, 1, 1 }, { "tolower", bi_tolower, 1, 1 }, { "fflush", bi_fflush, 0, 1 }, /* useful gawk extension (time functions) */ { "systime", bi_systime, 0, 0 }, #ifdef HAVE_MKTIME { "mktime", bi_mktime, 1, 1 }, #endif #ifdef HAVE_STRFTIME { "strftime", bi_strftime, 0, 3 }, #endif { (char *) 0, (PF_CP) 0, 0, 0 } }; /* *INDENT-ON* */ /* load built-in functions in symbol table */ void bi_funct_init(void) { register const BI_REC *p; register SYMTAB *stp; /* length is special (posix bozo) */ stp = insert(bi_funct->name); stp->type = ST_LENGTH; stp->stval.bip = bi_funct; for (p = bi_funct + 1; p->name; p++) { stp = insert(p->name); stp->type = ST_BUILTIN; stp->stval.bip = p; } #ifndef NO_INIT_SRAND /* seed rand() off the clock */ { CELL c[2]; memset(c, 0, sizeof(c)); c[1].type = C_NOINIT; bi_srand(c + 1); } #endif } /************************************************** string builtins (except split (in split.c) and [g]sub (at end)) **************************************************/ CELL * bi_length(CELL *sp) { size_t len; TRACE_FUNC("bi_length", sp); if (sp->type == 0) cellcpy(sp, field); else sp--; if (sp->type < C_STRING) cast1_to_s(sp); len = string(sp)->len; free_STRING(string(sp)); sp->type = C_DOUBLE; sp->dval = (double) len; return_CELL("bi_length", sp); } char * str_str(char *target, size_t target_len, const char *key, size_t key_len) { register int k = key[0]; int k1; const char *prior; char *result = 0; switch (key_len) { case 0: break; case 1: if (target_len != 0) { result = memchr(target, k, target_len); } break; case 2: k1 = key[1]; prior = target; while (target_len >= key_len && (target = memchr(target, k, target_len))) { target_len = target_len - (size_t) (target - prior) - 1; prior = ++target; if (target[0] == k1) { result = target - 1; break; } } break; default: key_len--; prior = target; while (target_len > key_len && (target = memchr(target, k, target_len))) { target_len = target_len - (size_t) (target - prior) - 1; prior = ++target; if (memcmp(target, key + 1, key_len) == 0) { result = target - 1; break; } } break; } return result; } CELL * bi_index(CELL *sp) { size_t idx; size_t len; const char *p; TRACE_FUNC("bi_index", sp); sp--; if (TEST2(sp) != TWO_STRINGS) cast2_to_s(sp); if ((len = string(sp + 1)->len)) { idx = (size_t) ((p = str_str(string(sp)->str, string(sp)->len, string(sp + 1)->str, len)) ? p - string(sp)->str + 1 : 0); } else { /* index of the empty string */ idx = 1; } free_STRING(string(sp)); free_STRING(string(sp + 1)); sp->type = C_DOUBLE; sp->dval = (double) idx; return_CELL("bi_index", sp); } /* substr(s, i, n) if l = length(s) then get the characters from max(1,i) to min(l,n-i-1) inclusive */ CELL * bi_substr(CELL *sp) { int n_args, len; register int i, n; STRING *sval; /* substr(sval->str, i, n) */ TRACE_FUNC("bi_substr", sp); n_args = sp->type; sp -= n_args; if (sp->type != C_STRING) cast1_to_s(sp); /* don't use < C_STRING shortcut */ sval = string(sp); if ((len = (int) sval->len) == 0) /* substr on null string */ { if (n_args == 3) { cell_destroy(sp + 2); } cell_destroy(sp + 1); return_CELL("bi_substr", sp); } if (n_args == 2) { n = len; if (sp[1].type != C_DOUBLE) { cast1_to_d(sp + 1); } } else { if (TEST2(sp + 1) != TWO_DOUBLES) cast2_to_d(sp + 1); n = d_to_i(sp[2].dval); } i = d_to_i(sp[1].dval) - 1; /* i now indexes into string */ /* * If the starting index is past the end of the string, there is nothing * to extract other than an empty string. */ if (i > len) { n = 0; } /* * Workaround in case someone's written a script that does substr(0,last-1) * by transforming it into substr(1,last). */ if (i < 0) { n -= i + 1; i = 0; } /* * Keep 'n' from extending past the end of the string. */ if (n > len - i) { n = len - i; } if (n <= 0) /* the null string */ { sp->ptr = (PTR) & null_str; null_str.ref_cnt++; } else { /* got something */ sp->ptr = (PTR) new_STRING0((size_t) n); memcpy(string(sp)->str, sval->str + i, (size_t) n); } free_STRING(sval); return_CELL("bi_substr", sp); } /* match(s,r) sp[0] holds r, sp[-1] holds s */ CELL * bi_match(CELL *sp) { char *p; size_t length; TRACE_FUNC("bi_match", sp); if (sp->type != C_RE) cast_to_RE(sp); if ((--sp)->type < C_STRING) cast1_to_s(sp); cell_destroy(RSTART); cell_destroy(RLENGTH); RSTART->type = C_DOUBLE; RLENGTH->type = C_DOUBLE; p = REmatch(string(sp)->str, string(sp)->len, cast_to_re((sp + 1)->ptr), &length, 0); if (p) { sp->dval = (double) (p - string(sp)->str + 1); RLENGTH->dval = (double) length; } else { sp->dval = 0.0; RLENGTH->dval = -1.0; /* posix */ } free_STRING(string(sp)); sp->type = C_DOUBLE; RSTART->dval = sp->dval; return_CELL("bi_match", sp); } CELL * bi_toupper(CELL *sp) { STRING *old; register char *p, *q; TRACE_FUNC("bi_toupper", sp); if (sp->type != C_STRING) cast1_to_s(sp); old = string(sp); sp->ptr = (PTR) new_STRING0(old->len); q = string(sp)->str; p = old->str; while (*p) { *q = *p++; *q = (char) toupper((UChar) * q); q++; } free_STRING(old); return_CELL("bi_toupper", sp); } CELL * bi_tolower(CELL *sp) { STRING *old; register char *p, *q; TRACE_FUNC("bi_tolower", sp); if (sp->type != C_STRING) cast1_to_s(sp); old = string(sp); sp->ptr = (PTR) new_STRING0(old->len); q = string(sp)->str; p = old->str; while (*p) { *q = *p++; *q = (char) tolower((UChar) * q); q++; } free_STRING(old); return_CELL("bi_tolower", sp); } /* * Like gawk... */ CELL * bi_systime(CELL *sp) { time_t result; time(&result); TRACE_FUNC("bi_systime", sp); sp++; sp->type = C_DOUBLE; sp->dval = (double) result; return_CELL("bi_systime", sp); } #ifdef HAVE_MKTIME /* mktime(datespec) Turns datespec into a time stamp of the same form as returned by systime(). The datespec is a string of the form YYYY MM DD HH MM SS [DST]. */ CELL * bi_mktime(CELL *sp) { time_t result; struct tm my_tm; STRING *sval = string(sp); TRACE_FUNC("bi_mktime", sp); if (!sval) goto error; memset(&my_tm, 0, sizeof(my_tm)); switch (sscanf(sval->str, "%d %d %d %d %d %d %d", &my_tm.tm_year, &my_tm.tm_mon, &my_tm.tm_mday, &my_tm.tm_hour, &my_tm.tm_min, &my_tm.tm_sec, &my_tm.tm_isdst)) { case 7: break; case 6: my_tm.tm_isdst = -1; /* ask mktime to get timezone */ break; default: goto error; /* not enough data */ } if (0) { error: result = -1; } else { my_tm.tm_year -= 1900; my_tm.tm_mon -= 1; result = mktime(&my_tm); } TRACE(("...bi_mktime(%s) ->%s", sval->str, ctime(&result))); cell_destroy(sp); sp->type = C_DOUBLE; sp->dval = (double) result; return_CELL("bi_mktime", sp); } #endif /* strftime(format, timestamp, utc) should be equal to gawk strftime. all parameters are optional: format: ansi c strftime format descriptor. default is "%c" timestamp: seconds since unix epoch. default is now utc: when set and != 0 date is utc otherwise local. default is 0 */ #ifdef HAVE_STRFTIME CELL * bi_strftime(CELL *sp) { const char *format = "%c"; time_t rawtime; struct tm *ptm; int n_args; int utc; STRING *sval = 0; /* strftime(sval->str, timestamp, utc) */ char buff[128]; size_t result; TRACE_FUNC("bi_strftime", sp); n_args = sp->type; sp -= n_args; if (n_args > 0) { if (sp->type != C_STRING) cast1_to_s(sp); /* don't use < C_STRING shortcut */ sval = string(sp); if ((int) sval->len != 0) /* strftime on valid format */ format = sval->str; } else { sp->type = C_STRING; } if (n_args > 1) { if (sp[1].type != C_DOUBLE) cast1_to_d(sp + 1); rawtime = d_to_i(sp[1].dval); } else { time(&rawtime); } if (n_args > 2) { if (sp[2].type != C_DOUBLE) cast1_to_d(sp + 2); utc = d_to_i(sp[2].dval); } else { utc = 0; } if (utc != 0) ptm = gmtime(&rawtime); else ptm = localtime(&rawtime); result = strftime(buff, sizeof(buff) / sizeof(buff[0]), format, ptm); TRACE(("...bi_strftime (%s, \"%d.%d.%d %d.%d.%d %d\", %d) ->%s\n", format, ptm->tm_year, ptm->tm_mon, ptm->tm_mday, ptm->tm_hour, ptm->tm_min, ptm->tm_sec, ptm->tm_isdst, utc, buff)); if (sval) free_STRING(sval); sp->ptr = (PTR) new_STRING1(buff, result); while (n_args > 1) { n_args--; cell_destroy(sp + n_args); } return_CELL("bi_strftime", sp); } #endif /* HAVE_STRFTIME */ /************************************************ arithmetic builtins ************************************************/ #if STDC_MATHERR static void fplib_err( char *fname, double val, char *error) { rt_error("%s(%g) : %s", fname, val, error); } #endif CELL * bi_sin(CELL *sp) { TRACE_FUNC("bi_sin", sp); #if ! STDC_MATHERR if (sp->type != C_DOUBLE) cast1_to_d(sp); sp->dval = sin(sp->dval); #else { double x; errno = 0; if (sp->type != C_DOUBLE) cast1_to_d(sp); x = sp->dval; sp->dval = sin(sp->dval); if (errno) fplib_err("sin", x, "loss of precision"); } #endif return_CELL("bi_sin", sp); } CELL * bi_cos(CELL *sp) { TRACE_FUNC("bi_cos", sp); #if ! STDC_MATHERR if (sp->type != C_DOUBLE) cast1_to_d(sp); sp->dval = cos(sp->dval); #else { double x; errno = 0; if (sp->type != C_DOUBLE) cast1_to_d(sp); x = sp->dval; sp->dval = cos(sp->dval); if (errno) fplib_err("cos", x, "loss of precision"); } #endif return_CELL("bi_cos", sp); } CELL * bi_atan2(CELL *sp) { TRACE_FUNC("bi_atan2", sp); #if ! STDC_MATHERR sp--; if (TEST2(sp) != TWO_DOUBLES) cast2_to_d(sp); sp->dval = atan2(sp->dval, (sp + 1)->dval); #else { errno = 0; sp--; if (TEST2(sp) != TWO_DOUBLES) cast2_to_d(sp); sp->dval = atan2(sp->dval, (sp + 1)->dval); if (errno) rt_error("atan2(0,0) : domain error"); } #endif return_CELL("bi_atan2", sp); } CELL * bi_log(CELL *sp) { TRACE_FUNC("bi_log", sp); #if ! STDC_MATHERR if (sp->type != C_DOUBLE) cast1_to_d(sp); sp->dval = log(sp->dval); #else { double x; errno = 0; if (sp->type != C_DOUBLE) cast1_to_d(sp); x = sp->dval; sp->dval = log(sp->dval); if (errno) fplib_err("log", x, "domain error"); } #endif return_CELL("bi_log", sp); } CELL * bi_exp(CELL *sp) { TRACE_FUNC("bi_exp", sp); #if ! STDC_MATHERR if (sp->type != C_DOUBLE) cast1_to_d(sp); sp->dval = exp(sp->dval); #else { double x; errno = 0; if (sp->type != C_DOUBLE) cast1_to_d(sp); x = sp->dval; sp->dval = exp(sp->dval); if (errno && sp->dval) fplib_err("exp", x, "overflow"); /* on underflow sp->dval==0, ignore */ } #endif return_CELL("bi_exp", sp); } CELL * bi_int(CELL *sp) { TRACE_FUNC("bi_int", sp); if (sp->type != C_DOUBLE) cast1_to_d(sp); sp->dval = sp->dval >= 0.0 ? floor(sp->dval) : ceil(sp->dval); return_CELL("bi_int", sp); } CELL * bi_sqrt(CELL *sp) { TRACE_FUNC("bi_sqrt", sp); #if ! STDC_MATHERR if (sp->type != C_DOUBLE) cast1_to_d(sp); sp->dval = sqrt(sp->dval); #else { double x; errno = 0; if (sp->type != C_DOUBLE) cast1_to_d(sp); x = sp->dval; sp->dval = sqrt(sp->dval); if (errno) fplib_err("sqrt", x, "domain error"); } #endif return_CELL("bi_sqrt", sp); } #if !(defined(mawk_srand) || defined(mawk_rand)) /* For portability, we'll use our own random number generator , taken from: Park, SK and Miller KW, "Random Number Generators: Good Ones are Hard to Find", CACM, 31, 1192-1201, 1988. */ static long seed; /* must be >=1 and < 2^31-1 */ static CELL cseed; /* argument of last call to srand() */ #define M 0x7fffffff /* 2^31-1 */ #define MX 0xffffffff #define A 16807 #define Q 127773 /* M/A */ #define R 2836 /* M%A */ #if M == MAX__LONG #define crank(s) s = A * (s % Q) - R * (s / Q) ;\ if ( s <= 0 ) s += M #else /* 64 bit longs */ #define crank(s) { unsigned long t = (unsigned long) s ;\ t = (A * (t % Q) - R * (t / Q)) & MX ;\ if ( t >= M ) t = (t+M)&M ;\ s = (long) t ;\ } #endif /* M == MAX__LONG */ #endif /* defined(mawk_srand) || defined(mawk_rand) */ static double initial_seed(void) { double result; #if defined(HAVE_GETTIMEOFDAY) struct timeval data; gettimeofday(&data, (struct timezone *) 0); result = (data.tv_sec * 1000000) + data.tv_usec; #elif defined(WINVER) && (WINVER >= 0x501) union { FILETIME ft; long long since1601; /* time since 1 Jan 1601 in 100ns units */ } data; GetSystemTimeAsFileTime(&data.ft); result = (double) (data.since1601 / 10LL); #else time_t now; (void) time(&now); result = (double) now; #endif return result; } CELL * bi_srand(CELL *sp) { #ifdef USE_SYSTEM_SRAND static long seed = 1; static CELL cseed = { C_DOUBLE, 0, 0, 1.0 }; #endif CELL c; TRACE_FUNC("bi_srand", sp); if (sp->type == C_NOINIT) /* seed off clock */ { cellcpy(sp, &cseed); cell_destroy(&cseed); cseed.type = C_DOUBLE; cseed.dval = initial_seed(); } else { /* user seed */ sp--; /* swap cseed and *sp ; don't need to adjust ref_cnts */ c = *sp; *sp = cseed; cseed = c; } #ifdef USE_SYSTEM_SRAND seed = d_to_i(cseed.dval); mawk_srand((unsigned) seed); #else /* The old seed is now in *sp ; move the value in cseed to seed in range [1,M) */ cellcpy(&c, &cseed); if (c.type == C_NOINIT) cast1_to_d(&c); seed = ((c.type == C_DOUBLE) ? (long) (d_to_i(c.dval) & M) % M + 1 : (long) hash(string(&c)->str) % M + 1); if (seed == M) seed = M - 1; cell_destroy(&c); /* crank it once so close seeds don't give a close first result */ crank(seed); #endif return_CELL("bi_srand", sp); } CELL * bi_rand(CELL *sp) { TRACE_FUNC("bi_rand", sp); #ifdef USE_SYSTEM_SRAND { long value = (long) mawk_rand(); sp++; sp->type = C_DOUBLE; sp->dval = ((double) value) / ((unsigned long) MAWK_RAND_MAX); } #else crank(seed); sp++; sp->type = C_DOUBLE; sp->dval = (double) seed / (double) M; #endif return_CELL("bi_rand", sp); } #undef A #undef M #undef MX #undef Q #undef R #undef crank /************************************************* miscellaneous builtins close, system and getline fflush *************************************************/ CELL * bi_close(CELL *sp) { int x; TRACE_FUNC("bi_close", sp); if (sp->type < C_STRING) cast1_to_s(sp); x = file_close((STRING *) sp->ptr); free_STRING(string(sp)); sp->type = C_DOUBLE; sp->dval = (double) x; return_CELL("bi_close", sp); } CELL * bi_fflush(CELL *sp) { int ret = 0; TRACE_FUNC("bi_fflush", sp); if (sp->type == 0) fflush(stdout); else { sp--; if (sp->type < C_STRING) cast1_to_s(sp); ret = file_flush(string(sp)); free_STRING(string(sp)); } sp->type = C_DOUBLE; sp->dval = (double) ret; return_CELL("bi_fflush", sp); } CELL * bi_system(CELL *sp GCC_UNUSED) { #ifdef HAVE_REAL_PIPES int ret_val; TRACE_FUNC("bi_system", sp); if (sp->type < C_STRING) cast1_to_s(sp); flush_all_output(); ret_val = wait_status(system(string(sp)->str)); cell_destroy(sp); sp->type = C_DOUBLE; sp->dval = (double) ret_val; #elif defined(MSDOS) int retval; if (sp->type < C_STRING) cast1_to_s(sp); retval = DOSexec(string(sp)->str); free_STRING(string(sp)); sp->type = C_DOUBLE; sp->dval = (double) retval; #else sp = 0; #endif return_CELL("bi_system", sp); } /* getline() */ /* if type == 0 : stack is 0 , target address if type == F_IN : stack is F_IN, expr(filename), target address if type == PIPE_IN : stack is PIPE_IN, target address, expr(pipename) */ CELL * bi_getline(CELL *sp) { CELL tc; CELL *cp = 0; char *p = 0; size_t len = 0; FIN *fin_p; TRACE_FUNC("bi_getline", sp); switch (sp->type) { case 0: sp--; if (!main_fin) open_main(); if (!(p = FINgets(main_fin, &len))) goto eof; cp = (CELL *) sp->ptr; if (TEST2(NR) != TWO_DOUBLES) cast2_to_d(NR); NR->dval += 1.0; rt_nr++; FNR->dval += 1.0; rt_fnr++; break; case F_IN: sp--; if (sp->type < C_STRING) cast1_to_s(sp); fin_p = (FIN *) file_find(sp->ptr, F_IN); free_STRING(string(sp)); sp--; if (!fin_p) goto open_failure; if (!(p = FINgets(fin_p, &len))) { FINsemi_close(fin_p); goto eof; } cp = (CELL *) sp->ptr; break; case PIPE_IN: sp -= 2; if (sp->type < C_STRING) cast1_to_s(sp); fin_p = (FIN *) file_find(sp->ptr, PIPE_IN); free_STRING(string(sp)); if (!fin_p) goto open_failure; if (!(p = FINgets(fin_p, &len))) { FINsemi_close(fin_p); #ifdef HAVE_REAL_PIPES /* reclaim process slot */ wait_for(0); #endif goto eof; } cp = (CELL *) (sp + 1)->ptr; break; default: bozo("type in bi_getline"); } /* we've read a line , store it */ if (len == 0) { tc.type = C_STRING; tc.ptr = (PTR) & null_str; null_str.ref_cnt++; } else { tc.type = C_MBSTRN; tc.ptr = (PTR) new_STRING0(len); memcpy(string(&tc)->str, p, len); } slow_cell_assign(cp, &tc); cell_destroy(&tc); sp->dval = 1.0; goto done; open_failure: sp->dval = -1.0; goto done; eof: sp->dval = 0.0; /* fall thru to done */ done: sp->type = C_DOUBLE; return_CELL("bi_getline", sp); } /********************************************** sub() and gsub() **********************************************/ /* entry: sp[0] = address of CELL to sub on sp[-1] = substitution CELL sp[-2] = regular expression to match */ CELL * bi_sub(CELL *sp) { CELL *cp; /* pointer to the replacement target */ CELL tc; /* build the new string here */ CELL sc; /* copy of the target CELL */ char *front, *middle, *back; /* pieces */ size_t front_len, middle_len, back_len; TRACE_FUNC("bi_sub", sp); sp -= 2; if (sp->type != C_RE) cast_to_RE(sp); if (sp[1].type != C_REPL && sp[1].type != C_REPLV) cast_to_REPL(sp + 1); cp = (CELL *) (sp + 2)->ptr; /* make a copy of the target, because we won't change anything including type unless the match works */ cellcpy(&sc, cp); if (sc.type < C_STRING) cast1_to_s(&sc); front = string(&sc)->str; middle = REmatch(front, string(&sc)->len, cast_to_re(sp->ptr), &middle_len, 0); if (middle != 0) { front_len = (size_t) (middle - front); back = middle + middle_len; back_len = string(&sc)->len - front_len - middle_len; if ((sp + 1)->type == C_REPLV) { STRING *sval = new_STRING0(middle_len); memcpy(sval->str, middle, middle_len); replv_to_repl(sp + 1, sval); free_STRING(sval); } tc.type = C_STRING; tc.ptr = (PTR) new_STRING0(front_len + string(sp + 1)->len + back_len); { char *p = string(&tc)->str; if (front_len) { memcpy(p, front, front_len); p += front_len; } if (string(sp + 1)->len) { memcpy(p, string(sp + 1)->str, string(sp + 1)->len); p += string(sp + 1)->len; } if (back_len) memcpy(p, back, back_len); } slow_cell_assign(cp, &tc); free_STRING(string(&tc)); } free_STRING(string(&sc)); repl_destroy(sp + 1); sp->type = C_DOUBLE; sp->dval = middle != (char *) 0 ? 1.0 : 0.0; return_CELL("bi_sub", sp); } static unsigned repl_cnt; /* number of global replacements */ static STRING * gsub3(PTR re, CELL *repl, CELL *target) { int j; CELL xrepl; STRING *input = string(target); STRING *output; STRING *buffer; STRING *sval; size_t have; size_t used = 0; size_t guess = input->len; size_t limit = guess; int skip0 = -1; size_t howmuch; char *where; TRACE(("called gsub3\n")); /* * If the replacement is constant, do it only once. */ if (repl->type != C_REPLV) { cellcpy(&xrepl, repl); } else { memset(&xrepl, 0, sizeof(xrepl)); } repl_cnt = 0; output = new_STRING0(limit); for (j = 0; j <= (int) input->len; ++j) { where = REmatch(input->str + j, input->len - (size_t) j, cast_to_re(re), &howmuch, (j != 0)); /* * REmatch returns a non-null pointer if it found a match. But * that can be an empty string, e.g., for "*" or "?". The length * is in 'howmuch'. */ if (where != 0) { have = (size_t) (where - (input->str + j)); if (have) { skip0 = -1; TRACE(("..before match:%d:", (int) have)); TRACE_STRING2(input->str + j, have); TRACE(("\n")); memcpy(output->str + used, input->str + j, have); used += have; } TRACE(("REmatch %d vs %d len=%d:", (int) j, skip0, (int) howmuch)); TRACE_STRING2(where, howmuch); TRACE(("\n")); if (repl->type == C_REPLV) { if (xrepl.ptr == 0 || string(&xrepl)->len != howmuch || (howmuch != 0 && memcmp(string(&xrepl)->str, where, howmuch))) { if (xrepl.ptr != 0) repl_destroy(&xrepl); sval = new_STRING1(where, howmuch); cellcpy(&xrepl, repl); replv_to_repl(&xrepl, sval); free_STRING(sval); } } have = string(&xrepl)->len; TRACE(("..replace:")); TRACE_STRING2(string(&xrepl)->str, have); TRACE(("\n")); if (howmuch || (j != skip0)) { ++repl_cnt; /* * If this new chunk is longer than its replacement, add that * to the estimate of the length. Then, if the estimate goes * past the allocated length, reallocate and copy the existing * data. */ if (have > howmuch) { /* growing */ guess += (have - howmuch); if (guess >= limit) { buffer = output; limit = (++guess) * 2; /* FIXME - too coarse? */ output = new_STRING0(limit); memcpy(output->str, buffer->str, used); free_STRING(buffer); } } else if (howmuch > have) { /* shrinking */ guess -= (howmuch - have); } /* * Finally, copy the new chunk. */ memcpy(output->str + used, string(&xrepl)->str, have); used += have; } if (howmuch) { j = (int) ((size_t) (where - input->str) + howmuch) - 1; } else { j = (int) (where - input->str); if (j < (int) input->len) { TRACE(("..emptied:")); TRACE_STRING2(input->str + j, 1); TRACE(("\n")); output->str[used++] = input->str[j]; } } skip0 = (howmuch != 0) ? (j + 1) : -1; } else { have = (input->len - (size_t) j); TRACE(("..after match:%d:", (int) have)); TRACE_STRING2(input->str + j, have); TRACE(("\n")); memcpy(output->str + used, input->str + j, have); used += have; break; } } TRACE(("..input %d ->output %d\n", (int) input->len, (int) output->len)); repl_destroy(&xrepl); if (output->len > used) { buffer = output; output = new_STRING1(output->str, used); free_STRING(buffer); } TRACE(("..done gsub3\n")); return output; } /* set up for call to gsub() */ CELL * bi_gsub(CELL *sp) { CELL *cp; /* pts at the replacement target */ CELL sc; /* copy of replacement target */ CELL tc; /* build the result here */ STRING *result; TRACE_FUNC("bi_gsub", sp); sp -= 2; if (sp->type != C_RE) cast_to_RE(sp); if ((sp + 1)->type != C_REPL && (sp + 1)->type != C_REPLV) cast_to_REPL(sp + 1); cellcpy(&sc, cp = (CELL *) (sp + 2)->ptr); if (sc.type < C_STRING) cast1_to_s(&sc); TRACE(("..actual gsub args:\n")); TRACE(("arg0: ")); TRACE_CELL(sp); TRACE(("arg1: ")); TRACE_CELL(sp + 1); TRACE(("arg2: ")); TRACE_CELL(&sc); result = gsub3(sp->ptr, sp + 1, &sc); tc.ptr = (PTR) result; if (repl_cnt) { tc.type = C_STRING; slow_cell_assign(cp, &tc); } sp->type = C_DOUBLE; sp->dval = (double) repl_cnt; TRACE(("Result: ")); TRACE_CELL(sp); TRACE(("String: ")); TRACE_STRING(result); TRACE(("\n")); /* cleanup */ free_STRING(string(&sc)); free_STRING(string(&tc)); repl_destroy(sp + 1); return_CELL("bi_gsub", sp); } mawk-1.3.4-20200120/symtype.h0000644000175100001440000001000113604765326013750 0ustar tomusers/******************************************** symtype.h copyright 2009-2016,2020, Thomas E. Dickey copyright 1991, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: symtype.h,v 1.20 2020/01/07 02:20:06 tom Exp $ */ /* types related to symbols are defined here */ #ifndef SYMTYPE_H #define SYMTYPE_H #include /* struct to hold info about builtins */ typedef struct { const char *name; PF_CP fp; /* ptr to function that does the builtin */ unsigned char min_args, max_args; /* info for parser to check correct number of arguments */ } BI_REC; /*--------------------------- structures and types for arrays *--------------------------*/ #include extern ARRAY Argv; /* for parsing (i,j) in A */ typedef struct { int start; /* offset to code_base */ int cnt; } ARG2_REC; /*------------------------ user defined functions ------------------------*/ typedef struct fblock { const char *name; INST *code; size_t size; unsigned short nargs; char *typev; /* array of size nargs holding types */ } FBLOCK; /* function block */ extern void add_to_fdump_list(FBLOCK *); extern void dump_funcs(void); extern void dump_regex(void); /*------------------------- elements of the symbol table -----------------------*/ typedef enum { ST_NONE ,ST_VAR ,ST_KEYWORD ,ST_BUILTIN /* a pointer to a builtin record */ ,ST_ARRAY /* a void * ptr to a hash table */ ,ST_FIELD /* a cell ptr to a field */ ,ST_FUNCT ,ST_NR /* NR is special */ ,ST_ENV /* and so is ENVIRON */ ,ST_LENGTH /* ditto and bozo */ ,ST_LOCAL_NONE ,ST_LOCAL_VAR ,ST_LOCAL_ARRAY } SYMTAB_TYPES; #define is_array(stp) ((stp)->type == ST_ARRAY || (stp)->type == ST_LOCAL_ARRAY) #define is_local(stp) ((stp)->type >= ST_LOCAL_NONE) typedef struct { const char *name; char type; unsigned char offset; /* offset in stack frame for local vars */ #ifdef NO_LEAKS char free_name; #endif union { CELL *cp; int kw; PF_CP fp; const BI_REC *bip; ARRAY array; FBLOCK *fbp; } stval; } SYMTAB; /***************************** structures for type checking function calls ******************************/ typedef struct ca_rec { struct ca_rec *link; short type; short arg_num; /* position in callee's stack */ /*--------- this data only set if we'll need to patch -------*/ /* happens if argument is an ID or type ST_NONE or ST_LOCAL_NONE */ int call_offset; unsigned call_lineno; /* where the type is stored */ SYMTAB *sym_p; /* if type is ST_NONE */ char *type_p; /* if type is ST_LOCAL_NONE */ } CA_REC; /* call argument record */ /* type field of CA_REC matches with ST_ types */ #define CA_EXPR ST_LOCAL_VAR #define CA_ARRAY ST_LOCAL_ARRAY typedef struct fcall { struct fcall *link; FBLOCK *callee; short call_scope; short move_level; FBLOCK *call; /* only used if call_scope == SCOPE_FUNCT */ INST *call_start; /* computed later as code may be moved */ CA_REC *arg_list; short arg_cnt_checked; } FCALL_REC; extern FCALL_REC *resolve_list; extern void resolve_fcalls(void); extern void check_fcall(FBLOCK * callee, int call_scope, int move_level, FBLOCK * call, CA_REC * arg_list); extern void relocate_resolve_list(int, int, FBLOCK *, int, unsigned, int); /* hash.c */ extern unsigned hash(const char *); extern unsigned hash2(const char *, size_t); extern SYMTAB *insert(const char *); extern SYMTAB *find(const char *); extern const char *reverse_find(int, PTR); extern SYMTAB *save_id(const char *); extern void restore_ids(void); /* error.c */ extern const char *type_to_str(int); extern void type_error(SYMTAB *); #ifdef NO_LEAKS extern void no_leaks_array(ARRAY); #else #define no_leaks_array(a) /* nothing */ #endif #endif /* SYMTYPE_H */ mawk-1.3.4-20200120/matherr.c0000644000175100001440000001272712257146627013714 0ustar tomusers/******************************************** matherr.c copyright 2009-2012,2013 Thomas E. Dickey copyright 1991, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: matherr.c,v 1.27 2013/12/27 00:45:11 tom Exp $ * * @Log: matherr.c,v @ * Revision 1.9 1996/09/01 16:54:35 mike * Third try at bug fix for solaris strtod. * * Revision 1.6 1994/12/18 20:53:43 mike * check NetBSD mathlib defines * * Revision 1.5 1994/12/14 14:48:57 mike * add include -- sysV doesn't have it inside * restore #else that had been removed * * Revision 1.4 1994/10/11 00:36:17 mike * systemVr4 siginfo * * Revision 1.3 1993/07/17 13:23:04 mike * indent and general code cleanup * * Revision 1.2 1993/07/04 12:52:03 mike * start on autoconfig changes * * Revision 5.2 1992/03/31 16:14:44 brennan * patch2: * TURN_ON_FPE_TRAPS() macro * USE_IEEEFP_H macro * * Revision 5.1 91/12/05 07:56:18 brennan * 1.1 pre-release * */ #include "mawk.h" #include "init.h" #include #ifdef HAVE_SIGACTION_SA_SIGACTION #define FPE_ARGS int sig, siginfo_t *sip, void *data #define FPE_DECL int why = sip->si_code #else #define FPE_ARGS int sig, int why #define FPE_DECL /* nothing */ #endif #ifdef USE_IEEEFP_H #include #ifdef HAVE_STRTOD_OVF_BUG static fp_except entry_mask; static fp_except working_mask; #endif #endif #ifndef TURN_OFF_FPE_TRAPS #define TURN_OFF_FPE_TRAPS /* nothing */ #endif #ifndef TURN_ON_FPE_TRAPS #define TURN_ON_FPE_TRAPS /* nothing */ #endif #ifdef HAVE_SIGINFO_H #include #define FPE_UNDERFLOW FPE_FLTUND #endif #ifdef FPE_TRAPS_ON #include #ifndef FPE_FLTDIV #ifdef WIN32 #include #define FPE_FLTDIV FPE_ZERODIVIDE #define FPE_FLTOVF FPE_OVERFLOW #define FPE_FLTUND FPE_UNDERFLOW #endif #endif /* machine dependent changes might be needed here */ static void fpe_catch(FPE_ARGS) { FPE_DECL; #if defined(NOINFO_SIGFPE) rt_error("floating point exception, probably overflow"); /* does not return */ #else switch (why) { #ifdef FPE_FLTDIV case FPE_FLTDIV: rt_error("floating point division by zero"); #endif #ifdef FPE_FLTOVF case FPE_FLTOVF: rt_error("floating point overflow"); #endif #ifdef FPE_FLTUND case FPE_FLTUND: rt_error("floating point underflow"); #endif default: rt_error("floating point exception"); } #endif /* noinfo_sigfpe */ } void fpe_init(void) { #ifdef HAVE_MATH__LIB_VERSION _LIB_VERSION = _IEEE_; #endif TURN_ON_FPE_TRAPS; #ifdef HAVE_SIGACTION_SA_SIGACTION { struct sigaction x; memset(&x, 0, sizeof(x)); x.sa_sigaction = fpe_catch; x.sa_flags = SA_SIGINFO; sigaction(SIGFPE, &x, (struct sigaction *) 0); } #else signal(SIGFPE, fpe_catch); #endif #ifdef HAVE_STRTOD_OVF_BUG /* we've already turned the traps on */ working_mask = fpgetmask(); entry_mask = working_mask & ~FP_X_DZ & ~FP_X_OFL; #endif } #else /* FPE_TRAPS not defined */ void fpe_init(void) { TURN_OFF_FPE_TRAPS; } #endif #ifdef HAVE_MATHERR #ifndef FPE_TRAPS_ON /* If we are not trapping math errors, we will shutup the library calls */ struct exception; int matherr(struct exception *e) { (void) e; return 1; } #else /* print error message and exit */ int matherr(struct exception *e) { char *error = "?"; switch (e->type) { case DOMAIN: case SING: error = "domain error"; break; case OVERFLOW: error = "overflow"; break; case TLOSS: case PLOSS: error = "loss of significance"; break; case UNDERFLOW: e->retval = 0.0; return 1; /* ignore it */ } if (strcmp(e->name, "atan2") == 0) rt_error("atan2(%g,%g) : %s", e->arg1, e->arg2, error); else rt_error("%s(%g) : %s", e->name, e->arg1, error); /* won't get here */ return 0; } #endif /* FPE_TRAPS_ON */ #endif /* ! no matherr */ /* this is how one gets the libm calls to do the right thing on bsd43_vax */ #if defined(BSD43_VAX) || defined(__vax__) #include double infnan(int arg) { switch (arg) { case ERANGE: errno = ERANGE; return HUGE; case -ERANGE: errno = EDOM; return -HUGE; default: errno = EDOM; } return 0.0; } #endif /* BSD43_VAX */ /* This routine is for XENIX-68K 2.3A. Error check routine to be called after fp arithmetic. */ #ifdef SW_FP_CHECK /* Definitions of bit values in iserr() return value */ #define OVFLOW 2 #define UFLOW 4 #define ZERODIV 8 #define OVFLFIX 32 #define INFNAN 64 void fpcheck(void) { register int fperrval; char *errdesc; if ((fperrval = iserr()) == 0) return; /* no error */ errdesc = (char *) 0; if (fperrval & INFNAN) errdesc = "arg is infinity or NAN"; else if (fperrval & ZERODIV) errdesc = "division by zero"; else if (fperrval & OVFLOW) errdesc = "overflow"; else if (fperrval & UFLOW) { ; /* ignored */ } if (errdesc) rt_error("%s", errdesc); } #endif #ifdef HAVE_STRTOD_OVF_BUG /* buggy strtod in solaris, probably any sysv with ieee754 strtod can generate an fpe */ double strtod_with_ovf_bug(const char *s, char **ep) { double ret; fpsetmask(entry_mask); /* traps off */ #undef strtod /* make real strtod visible */ ret = strtod(s, ep); fpsetmask(working_mask); /* traps on */ return ret; } #endif mawk-1.3.4-20200120/array.h0000644000175100001440000000275613611312405013356 0ustar tomusers/* array.h */ /* @MawkId: array.w,v 1.21 2020/01/20 11:54:19 tom Exp @ copyright 2009-2019,2020 Thomas E. Dickey copyright 1991-1996,2014 Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. array.c and array.h were generated with the commands notangle -R'"array.c"' array.w > array.c notangle -R'"array.h"' array.w > array.h Notangle is part of Norman Ramsey's noweb literate programming package available from CTAN(ftp.shsu.edu). It's easiest to read or modify this file by working with array.w. */ #ifndef ARRAY_H #define ARRAY_H 1 #include "nstd.h" #include "types.h" typedef struct array { PTR ptr ; /* What this points to depends on the type */ size_t size ; /* number of elts in the table */ size_t limit ; /* Meaning depends on type */ unsigned hmask ; /* bitwise and with hash value to get table index */ short type ; /* values in AY_NULL .. AY_SPLIT */ } *ARRAY ; #define AY_NULL 0 #define AY_INT 1 #define AY_STR 2 #define AY_SPLIT 4 #define NO_CREATE 0 #define CREATE 1 #define new_ARRAY() ((ARRAY)memset(ZMALLOC(struct array),0,sizeof(struct array))) CELL* array_find(ARRAY, CELL*, int); void array_delete(ARRAY, CELL*); void array_load(ARRAY, size_t); void array_clear(ARRAY); STRING** array_loop_vector(ARRAY, size_t*); CELL* array_cat(CELL*, int); #endif /* ARRAY_H */ mawk-1.3.4-20200120/rexp.c0000644000175100001440000001231213171255223013203 0ustar tomusers/******************************************** rexp.c copyright 2008-2016,2017, Thomas E. Dickey copyright 1991-1993,1996, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: rexp.c,v 1.21 2017/10/17 01:19:15 tom Exp $ */ /* op precedence parser for regular expressions */ #include "rexp.h" #include "regexp.h" /* DATA */ int REerrno; const char *const REerrlist[] = {(char *) 0, /* 1 */ "missing '('", /* 2 */ "missing ')'", /* 3 */ "bad class -- [], [^] or [", /* 4 */ "missing operand", /* 5 */ "resource exhaustion -- regular expression too large", /* 6 */ "syntax error ^* or ^+" }; /* E5 is very unlikely to occur */ /* This table drives the operator precedence parser */ /* *INDENT-OFF* */ static short table[8][8] = { /* 0 | CAT * + ? ( ) */ /* 0 */ {0, L, L, L, L, L, L, E1}, /* | */ {G, G, L, L, L, L, L, G}, /* CAT*/ {G, G, G, L, L, L, L, G}, /* * */ {G, G, G, G, G, G, E7, G}, /* + */ {G, G, G, G, G, G, E7, G}, /* ? */ {G, G, G, G, G, G, E7, G}, /* ( */ {E2, L, L, L, L, L, L, EQ}, /* ) */ {G , G, G, G, G, G, E7, G}}; /* *INDENT-ON* */ #define STACKSZ 64 static jmp_buf err_buf; /* used to trap on error */ #if OPT_TRACE > 0 static const char * token_name(int token) { const char *result; #define CASE(name) case name: result = #name; break switch (token) { CASE(T_NONE); CASE(T_OR); CASE(T_CAT); CASE(T_STAR); CASE(T_PLUS); CASE(T_Q); CASE(T_LP); CASE(T_RP); CASE(T_START); CASE(T_END); CASE(T_ANY); CASE(T_CLASS); CASE(T_SLASH); CASE(T_CHAR); CASE(T_STR); CASE(T_U); default: result = "?"; break; } #undef CASE return result; } #endif void RE_error_trap(int x) { REerrno = x; longjmp(err_buf, 1); } PTR REcompile(char *re, size_t len) { MACHINE m_stack[STACKSZ]; struct op { int token; int prec; } op_stack[STACKSZ]; register MACHINE *m_ptr; register struct op *op_ptr; register int t; /* do this first because it also checks if we have a run time stack */ RE_lex_init(re, len); if (len == 0) { STATE *p = (STATE *) RE_malloc(sizeof(STATE)); p->s_type = M_ACCEPT; return (PTR) p; } if (setjmp(err_buf)) return (PTR) 0; /* we used to try to recover memory left on machine stack ; but now m_ptr is in a register so it won't be right unless we force it out of a register which isn't worth the trouble */ /* initialize the stacks */ m_ptr = m_stack - 1; op_ptr = op_stack; op_ptr->token = 0; t = RE_lex(m_stack); while (1) { TRACE(("RE_lex token %s\n", token_name(t))); switch (t) { case T_STR: case T_ANY: case T_U: case T_START: case T_END: case T_CLASS: m_ptr++; break; case 0: /* end of reg expr */ if (op_ptr->token == 0) { /* done */ if (m_ptr == m_stack) { return (PTR) m_ptr->start; } else { /* machines still on the stack */ RE_panic("values still on machine stack"); } } /* FALLTHRU */ /* otherwise, default is operator case */ default: if ((op_ptr->prec = table[op_ptr->token][t]) == G) { do { /* op_pop */ if (op_ptr->token <= T_CAT) { /*binary op */ if (m_ptr == m_stack && op_ptr->token == T_CAT) { TRACE(("...ignoring empty T_CAT\n")); op_ptr--; continue; } m_ptr--; } /* if not enough values on machine stack then we have a missing operand */ if (m_ptr < m_stack) RE_error_trap(-E4); switch (op_ptr->token) { case T_CAT: RE_cat(m_ptr, m_ptr + 1); break; case T_OR: RE_or(m_ptr, m_ptr + 1); break; case T_STAR: RE_close(m_ptr); break; case T_PLUS: RE_poscl(m_ptr); break; case T_Q: RE_01(m_ptr); break; default: /*nothing on ( or ) */ break; } op_ptr--; } while (op_ptr->prec != L); continue; /* back thru switch at top */ } if (op_ptr->prec < 0) { if (op_ptr->prec == E7) RE_panic("parser returns E7"); else RE_error_trap(-op_ptr->prec); } if (++op_ptr == op_stack + STACKSZ) { /* stack overflow */ RE_error_trap(-E5); } op_ptr->token = t; } /* end of switch */ if (m_ptr == m_stack + (STACKSZ - 1)) { /*overflow */ RE_error_trap(-E5); } t = RE_lex(m_ptr + 1); } } void REdestroy(PTR ptr) { int done = 0; int n = 0; STATE *q = (STATE *) ptr; TRACE(("REdestroy %p\n", ptr)); while (!done) { TRACE(("...%d type %d\n", n, q->s_type)); switch (q->s_type) { case M_ACCEPT: done = 1; break; case M_STR: RE_free(q->s_data.str); break; default: if (q->s_type < 0 || q->s_type > END_ON) done = -1; break; } ++q; ++n; } RE_free(ptr); } /* getting here means a logic flaw or unforeseen case */ void RE_panic(const char *s) { fprintf(stderr, "REcompile() - panic: %s\n", s); mawk_exit(100); } /* getting regexp error message */ const char * REerror(void) { return REerrlist[REerrno]; } mawk-1.3.4-20200120/configure0000755000175100001440000103273213611311205013771 0ustar tomusers#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by Autoconf 2.52.20200111. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Name of the executable. as_me=`echo "$0" |sed 's,.*[\\/],,'` if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file as_executable_p="test -f" # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # NLS nuisances. $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} ac_unique_file="mawk.h" # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${datarootdir}/info' mandir='${datarootdir}/man' # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst \ | --runs | --run | --ru) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* \ | --runs=* | --run=* | --ru=*) runstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. build=$build_alias host=$host_alias target=$target_alias # FIXME: should be removed in autoconf 3.0. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat < if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. EOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue cd $ac_subdir # A "../" for each directory in /$ac_subdir. ac_dots=`echo $ac_subdir | sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'` case $srcdir in .) # No --srcdir option. We are building in place. ac_sub_srcdir=$srcdir ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_sub_srcdir=$srcdir/$ac_subdir ;; *) # Relative path. ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;; esac # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_sub_srcdir/configure.gnu; then echo $SHELL $ac_sub_srcdir/configure.gnu --help=recursive elif test -f $ac_sub_srcdir/configure; then echo $SHELL $ac_sub_srcdir/configure --help=recursive elif test -f $ac_sub_srcdir/configure.ac || test -f $ac_sub_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\EOF Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. EOF exit 0 fi exec 5>config.log cat >&5 </dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` PATH = $PATH _ASUNAME } >&5 cat >&5 <\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" ac_sep=" " ;; *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg" ac_sep=" " ;; esac # Get rid of the leading space. done # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. trap 'exit_status=$? # Save into config.log some information that might help in debugging. echo >&5 echo "## ----------------- ##" >&5 echo "## Cache variables. ##" >&5 echo "## ----------------- ##" >&5 echo >&5 # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } >&5 sed "/^$/d" confdefs.h >conftest.log if test -s conftest.log; then echo >&5 echo "## ------------ ##" >&5 echo "## confdefs.h. ##" >&5 echo "## ------------ ##" >&5 echo >&5 cat conftest.log >&5 fi (echo; echo) >&5 test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" >&5 echo "$as_me: exit $exit_status" >&5 rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:878: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} cat "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:889: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:897: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:913: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:917: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:923: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:925: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:927: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. It doesn't matter if # we pass some twice (in addition to the command line arguments). if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:946: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:948: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C= # newlines do not sed ;-) only broken shells would use this case anyway ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac echo "#! $SHELL" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh if { (echo "$as_me:969: PATH=\".;.\"; conftest.sh") >&5 (PATH=".;."; conftest.sh) 2>&5 ac_status=$? echo "$as_me:972: \$? = $ac_status" >&5 (exit $ac_status); }; then ac_path_separator=';' else ac_path_separator=: fi PATH_SEPARATOR="$ac_path_separator" rm -f conftest.sh ac_config_headers="$ac_config_headers config.h:config_h.in" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:1000: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:1010: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:1014: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:1023: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:1027: error: $ac_config_sub $ac_cv_build_alias failed." >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:1032: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then echo "$as_me:1040: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:1049: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:1054: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` system_name="$host_os" else system_name="`(uname -s -r) 2>/dev/null`" if test -z "$system_name" ; then system_name="`(hostname) 2>/dev/null`" fi fi test -n "$system_name" && cat >>confdefs.h <&6 else cf_cv_system_name="$system_name" fi test -z "$system_name" && system_name="$cf_cv_system_name" test -n "$cf_cv_system_name" && echo "$as_me:1080: result: Configuring for $cf_cv_system_name" >&5 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6 if test ".$system_name" != ".$cf_cv_system_name" ; then echo "$as_me:1084: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6 { { echo "$as_me:1086: error: \"Please remove config.cache and try again.\"" >&5 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;} { (exit 1); exit 1; }; } fi test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:1113: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:1128: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1136: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1139: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:1148: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:1163: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:1171: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1174: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:1187: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:1202: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1210: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1213: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:1222: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="cc" echo "$as_me:1237: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:1245: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1248: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:1261: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:1281: found $ac_dir/$ac_word" >&5 break done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift set dummy "$ac_dir/$ac_word" ${1+"$@"} shift ac_cv_prog_CC="$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1303: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1306: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:1317: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:1332: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1340: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1343: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:1356: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:1371: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:1379: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1382: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:1394: error: no acceptable cc found in \$PATH" >&5 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:1399:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:1402: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:1405: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:1407: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:1410: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:1412: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:1415: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF #line 1419 "configure" #include "confdefs.h" int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:1435: checking for C compiler default output" >&5 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:1438: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:1441: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. for ac_file in `ls a.exe conftest.exe 2>/dev/null; ls a.out conftest 2>/dev/null; ls a.* conftest.* 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; a.out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:1464: error: C compiler cannot create executables" >&5 echo "$as_me: error: C compiler cannot create executables" >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:1470: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:1475: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:1481: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1484: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:1491: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:1499: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:1506: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:1508: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:1511: checking for executable suffix" >&5 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 if { (eval echo "$as_me:1513: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:1516: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:1532: error: cannot compute EXEEXT: cannot compile and link" >&5 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:1538: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:1544: checking for object suffix" >&5 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 1550 "configure" #include "confdefs.h" int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:1562: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1565: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:1577: error: cannot compute OBJEXT: cannot compile" >&5 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:1584: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:1588: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 1594 "configure" #include "confdefs.h" int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1609: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1612: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1615: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1618: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:1630: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:1636: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 1642 "configure" #include "confdefs.h" int main (void) { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1654: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1657: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1660: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1663: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:1673: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1700: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1703: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1706: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1709: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line 1721 "configure" #include "confdefs.h" #include $ac_declaration int main (void) { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1734: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1737: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1740: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1743: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line 1753 "configure" #include "confdefs.h" $ac_declaration int main (void) { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1765: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1768: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1771: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1774: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -rf conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return GCC_VERSION=none if test "$GCC" = yes ; then echo "$as_me:1804: checking version of $CC" >&5 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6 GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown echo "$as_me:1808: result: $GCC_VERSION" >&5 echo "${ECHO_T}$GCC_VERSION" >&6 fi INTEL_COMPILER=no if test "$GCC" = yes ; then case $host_os in (linux*|gnu*) echo "$as_me:1817: checking if this is really Intel C compiler" >&5 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6 cf_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -no-gcc" cat >conftest.$ac_ext <<_ACEOF #line 1822 "configure" #include "confdefs.h" int main (void) { #ifdef __INTEL_COMPILER #else make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1839: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1842: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1845: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1848: \$? = $ac_status" >&5 (exit $ac_status); }; }; then INTEL_COMPILER=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" echo "$as_me:1859: result: $INTEL_COMPILER" >&5 echo "${ECHO_T}$INTEL_COMPILER" >&6 ;; esac fi CLANG_COMPILER=no if test "$GCC" = yes ; then echo "$as_me:1868: checking if this is really Clang C compiler" >&5 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6 cf_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Qunused-arguments" cat >conftest.$ac_ext <<_ACEOF #line 1873 "configure" #include "confdefs.h" int main (void) { #ifdef __clang__ #else make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1890: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1893: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1896: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1899: \$? = $ac_status" >&5 (exit $ac_status); }; }; then CLANG_COMPILER=yes cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" echo "$as_me:1910: result: $CLANG_COMPILER" >&5 echo "${ECHO_T}$CLANG_COMPILER" >&6 fi echo "$as_me:1914: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF #line 1922 "configure" #include "confdefs.h" #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main (void) { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:1971: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1974: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1977: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1980: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:1997: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:2000: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # This should have been defined by AC_PROG_CC : ${CC:=cc} echo "$as_me:2008: checking \$CFLAGS variable" >&5 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6 case "x$CFLAGS" in (*-[IUD]*) echo "$as_me:2012: result: broken" >&5 echo "${ECHO_T}broken" >&6 { echo "$as_me:2014: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;} cf_flags="$CFLAGS" CFLAGS= for cf_arg in $cf_flags do cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_arg do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi done ;; (*) echo "$as_me:2122: result: ok" >&5 echo "${ECHO_T}ok" >&6 ;; esac echo "$as_me:2127: checking \$CC variable" >&5 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6 case "$CC" in (*[\ \ ]-*) echo "$as_me:2131: result: broken" >&5 echo "${ECHO_T}broken" >&6 { echo "$as_me:2133: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;} # humor him... cf_prog=`echo "$CC" | sed -e 's/ / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'` cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'` CC="$cf_prog" for cf_arg in $cf_flags do case "x$cf_arg" in (x-[IUDfgOW]*) cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_arg do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi ;; (*) CC="$CC $cf_arg" ;; esac done test -n "$verbose" && echo " resulting CC: '$CC'" 1>&6 echo "${as_me:-configure}:2250: testing resulting CC: '$CC' ..." 1>&5 test -n "$verbose" && echo " resulting CFLAGS: '$CFLAGS'" 1>&6 echo "${as_me:-configure}:2254: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5 test -n "$verbose" && echo " resulting CPPFLAGS: '$CPPFLAGS'" 1>&6 echo "${as_me:-configure}:2258: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5 ;; (*) echo "$as_me:2262: result: ok" >&5 echo "${ECHO_T}ok" >&6 ;; esac echo "$as_me:2267: checking whether ${MAKE-make} sets \${MAKE}" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:2287: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:2291: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi echo "$as_me:2296: checking for makeflags variable" >&5 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6 if test "${cf_cv_makeflags+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_makeflags='' for cf_option in '-${MAKEFLAGS}' '${MFLAGS}' do cat >cf_makeflags.tmp </dev/null | fgrep -v "ing directory" | sed -e 's,[ ]*$,,'` case "$cf_result" in (.*k|.*kw) cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` case "$cf_result" in (.*CC=*) cf_cv_makeflags= ;; (*) cf_cv_makeflags=$cf_option ;; esac break ;; (.-) ;; (*) echo "${as_me:-configure}:2326: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5 ;; esac done rm -f cf_makeflags.tmp fi echo "$as_me:2334: result: $cf_cv_makeflags" >&5 echo "${ECHO_T}$cf_cv_makeflags" >&6 ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return echo "$as_me:2343: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line 2364 "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:2369: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2375: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line 2398 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:2402: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2408: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:2445: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line 2455 "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:2460: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2466: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line 2489 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:2493: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2499: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:2527: error: C preprocessor \"$CPP\" fails sanity check" >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:2551: checking for a BSD compatible install" >&5 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_IFS=$IFS; IFS=$ac_path_separator for ac_dir in $PATH; do IFS=$ac_save_IFS # Account for people who put trailing slashes in PATH elements. case $ac_dir/ in / | ./ | .// | /cC/* \ | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \ | /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if $as_executable_p "$ac_dir/$ac_prog"; then if test $ac_prog = install && grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:2600: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' if test "$cross_compiling" = yes ; then # defaults that we might want to override : ${BUILD_CFLAGS:=''} : ${BUILD_CPPFLAGS:=''} : ${BUILD_LDFLAGS:=''} : ${BUILD_LIBS:=''} : ${BUILD_EXEEXT:='$x'} : ${BUILD_OBJEXT:='o'} # Check whether --with-build-cc or --without-build-cc was given. if test "${with_build_cc+set}" = set; then withval="$with_build_cc" BUILD_CC="$withval" else for ac_prog in gcc clang c99 c89 cc cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:2630: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_BUILD_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$BUILD_CC"; then ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_BUILD_CC="$ac_prog" echo "$as_me:2645: found $ac_dir/$ac_word" >&5 break done fi fi BUILD_CC=$ac_cv_prog_BUILD_CC if test -n "$BUILD_CC"; then echo "$as_me:2653: result: $BUILD_CC" >&5 echo "${ECHO_T}$BUILD_CC" >&6 else echo "$as_me:2656: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$BUILD_CC" && break done test -n "$BUILD_CC" || BUILD_CC="none" fi; echo "$as_me:2665: checking for native build C compiler" >&5 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6 echo "$as_me:2667: result: $BUILD_CC" >&5 echo "${ECHO_T}$BUILD_CC" >&6 echo "$as_me:2670: checking for native build C preprocessor" >&5 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6 # Check whether --with-build-cpp or --without-build-cpp was given. if test "${with_build_cpp+set}" = set; then withval="$with_build_cpp" BUILD_CPP="$withval" else BUILD_CPP='${BUILD_CC} -E' fi; echo "$as_me:2680: result: $BUILD_CPP" >&5 echo "${ECHO_T}$BUILD_CPP" >&6 echo "$as_me:2683: checking for native build C flags" >&5 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6 # Check whether --with-build-cflags or --without-build-cflags was given. if test "${with_build_cflags+set}" = set; then withval="$with_build_cflags" BUILD_CFLAGS="$withval" fi; echo "$as_me:2691: result: $BUILD_CFLAGS" >&5 echo "${ECHO_T}$BUILD_CFLAGS" >&6 echo "$as_me:2694: checking for native build C preprocessor-flags" >&5 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6 # Check whether --with-build-cppflags or --without-build-cppflags was given. if test "${with_build_cppflags+set}" = set; then withval="$with_build_cppflags" BUILD_CPPFLAGS="$withval" fi; echo "$as_me:2702: result: $BUILD_CPPFLAGS" >&5 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6 echo "$as_me:2705: checking for native build linker-flags" >&5 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6 # Check whether --with-build-ldflags or --without-build-ldflags was given. if test "${with_build_ldflags+set}" = set; then withval="$with_build_ldflags" BUILD_LDFLAGS="$withval" fi; echo "$as_me:2713: result: $BUILD_LDFLAGS" >&5 echo "${ECHO_T}$BUILD_LDFLAGS" >&6 echo "$as_me:2716: checking for native build linker-libraries" >&5 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6 # Check whether --with-build-libs or --without-build-libs was given. if test "${with_build_libs+set}" = set; then withval="$with_build_libs" BUILD_LIBS="$withval" fi; echo "$as_me:2724: result: $BUILD_LIBS" >&5 echo "${ECHO_T}$BUILD_LIBS" >&6 # this assumes we're on Unix. BUILD_EXEEXT= BUILD_OBJEXT=o : ${BUILD_CC:='${CC}'} if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then { { echo "$as_me:2734: error: Cross-build requires two compilers. Use --with-build-cc to specify the native compiler." >&5 echo "$as_me: error: Cross-build requires two compilers. Use --with-build-cc to specify the native compiler." >&2;} { (exit 1); exit 1; }; } fi else : ${BUILD_CC:='${CC}'} : ${BUILD_CPP:='${CPP}'} : ${BUILD_CFLAGS:='${CFLAGS}'} : ${BUILD_CPPFLAGS:='${CPPFLAGS}'} : ${BUILD_LDFLAGS:='${LDFLAGS}'} : ${BUILD_LIBS:='${LIBS}'} : ${BUILD_EXEEXT:='$x'} : ${BUILD_OBJEXT:='o'} fi if test "${MATHLIB+set}" != set ; then echo "$as_me:2753: checking for log in -lm" >&5 echo $ECHO_N "checking for log in -lm... $ECHO_C" >&6 if test "${ac_cv_lib_m_log+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 2761 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char log (); int main (void) { log (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:2780: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:2783: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:2786: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2789: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_m_log=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_m_log=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:2800: result: $ac_cv_lib_m_log" >&5 echo "${ECHO_T}$ac_cv_lib_m_log" >&6 if test $ac_cv_lib_m_log = yes; then MATHLIB=-lm ; LIBS="-lm $LIBS" else # maybe don't need separate math library echo "$as_me:2806: checking for log" >&5 echo $ECHO_N "checking for log... $ECHO_C" >&6 if test "${ac_cv_func_log+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 2812 "configure" #include "confdefs.h" #define log autoconf_temporary #include /* least-intrusive standard header which defines gcc2 __stub macros */ #undef log #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char log (void); int main (void) { /* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_log) || defined (__stub___log) #error found stub for log #endif return log (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:2843: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:2846: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:2849: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2852: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_log=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_log=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:2862: result: $ac_cv_func_log" >&5 echo "${ECHO_T}$ac_cv_func_log" >&6 if test $ac_cv_func_log = yes; then log=yes fi if test "$log" = yes then MATHLIB='' # evidently don't need one else { { echo "$as_me:2872: error: Cannot find a math library. You need to set MATHLIB in config.user" >&5 echo "$as_me: error: Cannot find a math library. You need to set MATHLIB in config.user" >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:2879: checking if you want to see long compiling messages" >&5 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6 # Check whether --enable-echo or --disable-echo was given. if test "${enable_echo+set}" = set; then enableval="$enable_echo" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then ECHO_LT='--silent' ECHO_LD='@echo linking $@;' RULE_CC='@echo compiling $<' SHOW_CC='@echo compiling $@' ECHO_CC='@' else ECHO_LT='' ECHO_LD='' RULE_CC='' SHOW_CC='' ECHO_CC='' fi else enableval=yes ECHO_LT='' ECHO_LD='' RULE_CC='' SHOW_CC='' ECHO_CC='' fi; echo "$as_me:2913: result: $enableval" >&5 echo "${ECHO_T}$enableval" >&6 if ( test "$GCC" = yes || test "$GXX" = yes ) then echo "$as_me:2918: checking if you want to turn on gcc warnings" >&5 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6 # Check whether --enable-warnings or --disable-warnings was given. if test "${enable_warnings+set}" = set; then enableval="$enable_warnings" test "$enableval" != yes && enableval=no if test "$enableval" != "no" ; then with_warnings=yes else with_warnings=no fi else enableval=no with_warnings=no fi; echo "$as_me:2935: result: $with_warnings" >&5 echo "${ECHO_T}$with_warnings" >&6 if test "$with_warnings" = "yes" then if test "$GCC" = yes then cat > conftest.i <&5 echo "$as_me: checking for $CC __attribute__ directives..." >&6;} cat > conftest.$ac_ext <&5 case $cf_attribute in (printf) cf_printf_attribute=yes cat >conftest.h <conftest.h <conftest.h <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3013: \$? = $ac_status" >&5 (exit $ac_status); }; then test -n "$verbose" && echo "$as_me:3015: result: ... $cf_attribute" >&5 echo "${ECHO_T}... $cf_attribute" >&6 cat conftest.h >>confdefs.h case $cf_attribute in (noreturn) cat >>confdefs.h <>confdefs.h <<\EOF #define GCC_PRINTF 1 EOF fi cat >>confdefs.h <>confdefs.h <<\EOF #define GCC_SCANF 1 EOF fi cat >>confdefs.h <>confdefs.h <>confdefs.h fi rm -rf conftest* fi if test "x$have_x" = xyes; then cf_save_LIBS_CF_CONST_X_STRING="$LIBS" cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS" cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS" LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}" for cf_X_CFLAGS in $X_CFLAGS do case "x$cf_X_CFLAGS" in x-[IUD]*) CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS" ;; *) CFLAGS="$CFLAGS $cf_X_CFLAGS" ;; esac done cat >conftest.$ac_ext <<_ACEOF #line 3093 "configure" #include "confdefs.h" #include #include int main (void) { String foo = malloc(1) ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:3108: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3111: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:3114: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3117: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:3120: checking for X11/Xt const-feature" >&5 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6 if test "${cf_cv_const_x_string+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 3127 "configure" #include "confdefs.h" #define _CONST_X_STRING /* X11R7.8 (perhaps) */ #undef XTSTRINGDEFINES /* X11R5 and later */ #include #include int main (void) { String foo = malloc(1); *foo = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:3144: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3147: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:3150: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3153: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_const_x_string=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_const_x_string=yes fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:3168: result: $cf_cv_const_x_string" >&5 echo "${ECHO_T}$cf_cv_const_x_string" >&6 LIBS="$cf_save_LIBS_CF_CONST_X_STRING" CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING" CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING" case $cf_cv_const_x_string in (no) test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES" ;; (*) test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING" ;; esac else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext fi cat > conftest.$ac_ext <&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="-Wall" for cf_opt in \ wd1419 \ wd1683 \ wd1684 \ wd193 \ wd593 \ wd279 \ wd810 \ wd869 \ wd981 do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" if { (eval echo "$as_me:3229: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3232: \$? = $ac_status" >&5 (exit $ac_status); }; then test -n "$verbose" && echo "$as_me:3234: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" fi done CFLAGS="$cf_save_CFLAGS" elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown" then { echo "$as_me:3242: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS= cf_warn_CONST="" test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings" cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs" test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings= for cf_opt in W Wall \ Wbad-function-cast \ Wcast-align \ Wcast-qual \ Wdeclaration-after-statement \ Wextra \ Winline \ Wmissing-declarations \ Wmissing-prototypes \ Wnested-externs \ Wpointer-arith \ Wshadow \ Wstrict-prototypes \ Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" if { (eval echo "$as_me:3266: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3269: \$? = $ac_status" >&5 (exit $ac_status); }; then test -n "$verbose" && echo "$as_me:3271: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 case $cf_opt in (Winline) case $GCC_VERSION in ([34].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 echo "${as_me:-configure}:3279: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac ;; (Wpointer-arith) case $GCC_VERSION in ([12].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 echo "${as_me:-configure}:3289: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac ;; esac EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" fi done CFLAGS="$cf_save_CFLAGS" fi rm -rf conftest* fi fi # Extract the first word of "groff", so it can be a program name with args. set dummy groff; ac_word=$2 echo "$as_me:3307: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_GROFF_PATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GROFF_PATH in [\\/]* | ?:[\\/]*) ac_cv_path_GROFF_PATH="$GROFF_PATH" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_GROFF_PATH="$ac_dir/$ac_word" echo "$as_me:3324: found $ac_dir/$ac_word" >&5 break fi done test -z "$ac_cv_path_GROFF_PATH" && ac_cv_path_GROFF_PATH="no" ;; esac fi GROFF_PATH=$ac_cv_path_GROFF_PATH if test -n "$GROFF_PATH"; then echo "$as_me:3336: result: $GROFF_PATH" >&5 echo "${ECHO_T}$GROFF_PATH" >&6 else echo "$as_me:3339: result: no" >&5 echo "${ECHO_T}no" >&6 fi for ac_prog in nroff mandoc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:3347: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_NROFF_PATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $NROFF_PATH in [\\/]* | ?:[\\/]*) ac_cv_path_NROFF_PATH="$NROFF_PATH" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_NROFF_PATH="$ac_dir/$ac_word" echo "$as_me:3364: found $ac_dir/$ac_word" >&5 break fi done ;; esac fi NROFF_PATH=$ac_cv_path_NROFF_PATH if test -n "$NROFF_PATH"; then echo "$as_me:3375: result: $NROFF_PATH" >&5 echo "${ECHO_T}$NROFF_PATH" >&6 else echo "$as_me:3378: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$NROFF_PATH" && break done test -n "$NROFF_PATH" || NROFF_PATH="no" # Extract the first word of "tbl", so it can be a program name with args. set dummy tbl; ac_word=$2 echo "$as_me:3388: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_TBL_PATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $TBL_PATH in [\\/]* | ?:[\\/]*) ac_cv_path_TBL_PATH="$TBL_PATH" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_TBL_PATH="$ac_dir/$ac_word" echo "$as_me:3405: found $ac_dir/$ac_word" >&5 break fi done test -z "$ac_cv_path_TBL_PATH" && ac_cv_path_TBL_PATH="cat" ;; esac fi TBL_PATH=$ac_cv_path_TBL_PATH if test -n "$TBL_PATH"; then echo "$as_me:3417: result: $TBL_PATH" >&5 echo "${ECHO_T}$TBL_PATH" >&6 else echo "$as_me:3420: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "x$GROFF_PATH" = xno then NROFF_NOTE= GROFF_NOTE="#" else NROFF_NOTE="#" GROFF_NOTE= fi case "x${with_man2html}" in (xno) cf_man2html=no ;; (x|xyes) # Extract the first word of "man2html", so it can be a program name with args. set dummy man2html; ac_word=$2 echo "$as_me:3440: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_cf_man2html+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $cf_man2html in [\\/]* | ?:[\\/]*) ac_cv_path_cf_man2html="$cf_man2html" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_cf_man2html="$ac_dir/$ac_word" echo "$as_me:3457: found $ac_dir/$ac_word" >&5 break fi done test -z "$ac_cv_path_cf_man2html" && ac_cv_path_cf_man2html="no" ;; esac fi cf_man2html=$ac_cv_path_cf_man2html if test -n "$cf_man2html"; then echo "$as_me:3469: result: $cf_man2html" >&5 echo "${ECHO_T}$cf_man2html" >&6 else echo "$as_me:3472: result: no" >&5 echo "${ECHO_T}no" >&6 fi case "x$cf_man2html" in (x/*) echo "$as_me:3478: checking for the modified Earl Hood script" >&5 echo $ECHO_N "checking for the modified Earl Hood script... $ECHO_C" >&6 if ( $cf_man2html -help 2>&1 | grep 'Make an index of headers at the end' >/dev/null ) then cf_man2html_ok=yes else cf_man2html=no cf_man2html_ok=no fi echo "$as_me:3487: result: $cf_man2html_ok" >&5 echo "${ECHO_T}$cf_man2html_ok" >&6 ;; (*) cf_man2html=no ;; esac esac echo "$as_me:3496: checking for program to convert manpage to html" >&5 echo $ECHO_N "checking for program to convert manpage to html... $ECHO_C" >&6 # Check whether --with-man2html or --without-man2html was given. if test "${with_man2html+set}" = set; then withval="$with_man2html" cf_man2html=$withval else cf_man2html=$cf_man2html fi; cf_with_groff=no case $cf_man2html in (yes) echo "$as_me:3511: result: man2html" >&5 echo "${ECHO_T}man2html" >&6 # Extract the first word of "man2html", so it can be a program name with args. set dummy man2html; ac_word=$2 echo "$as_me:3515: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_cf_man2html+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $cf_man2html in [\\/]* | ?:[\\/]*) ac_cv_path_cf_man2html="$cf_man2html" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_cf_man2html="$ac_dir/$ac_word" echo "$as_me:3532: found $ac_dir/$ac_word" >&5 break fi done test -z "$ac_cv_path_cf_man2html" && ac_cv_path_cf_man2html="no" ;; esac fi cf_man2html=$ac_cv_path_cf_man2html if test -n "$cf_man2html"; then echo "$as_me:3544: result: $cf_man2html" >&5 echo "${ECHO_T}$cf_man2html" >&6 else echo "$as_me:3547: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; (no|groff|*/groff*) cf_with_groff=yes cf_man2html=$GROFF_PATH echo "$as_me:3555: result: $cf_man2html" >&5 echo "${ECHO_T}$cf_man2html" >&6 ;; (*) echo "$as_me:3559: result: $cf_man2html" >&5 echo "${ECHO_T}$cf_man2html" >&6 ;; esac MAN2HTML_TEMP="man2html.tmp" cat >$MAN2HTML_TEMP <>$MAN2HTML_TEMP <&5 echo "$as_me: error: expected a pathname, not \"$cf_man2html\"" >&2;} { (exit 1); exit 1; }; } ;; esac MAN2HTML_PATH="$cf_man2html" echo "$as_me:3630: checking for $cf_man2html top/bottom margins" >&5 echo $ECHO_N "checking for $cf_man2html top/bottom margins... $ECHO_C" >&6 # for this example, expect 3 lines of content, the remainder is head/foot cat >conftest.in <conftest.out cf_man2html_1st=`fgrep -n MARKER conftest.out |sed -e 's/^[^0-9]*://' -e 's/:.*//'` cf_man2html_top=`expr $cf_man2html_1st - 2` cf_man2html_bot=`wc -l conftest.out |sed -e 's/[^0-9]//g'` cf_man2html_bot=`expr $cf_man2html_bot - 2 - $cf_man2html_top` cf_man2html_top_bot="-topm=$cf_man2html_top -botm=$cf_man2html_bot" echo "$as_me:3648: result: $cf_man2html_top_bot" >&5 echo "${ECHO_T}$cf_man2html_top_bot" >&6 echo "$as_me:3651: checking for pagesize to use" >&5 echo $ECHO_N "checking for pagesize to use... $ECHO_C" >&6 for cf_block in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 do cat >>conftest.in <conftest.out cf_man2html_page=`fgrep -n HEAD1 conftest.out |sed -n '$p' |sed -e 's/^[^0-9]*://' -e 's/:.*//'` test -z "$cf_man2html_page" && cf_man2html_page=99999 test "$cf_man2html_page" -gt 100 && cf_man2html_page=99999 rm -rf conftest* echo "$as_me:3676: result: $cf_man2html_page" >&5 echo "${ECHO_T}$cf_man2html_page" >&6 cat >>$MAN2HTML_TEMP <&5 echo $ECHO_N "checking if you want to use mawk's own regular-expressions engine... $ECHO_C" >&6 # Check whether --with-builtin-regex or --without-builtin-regex was given. if test "${with_builtin_regex+set}" = set; then withval="$with_builtin_regex" with_builtin_regex=$withval fi; if test "x${with_builtin_regex}" != xno; then with_builtin_regex=yes CPPFLAGS="$CPPFLAGS -DLOCAL_REGEXP" fi echo "$as_me:3710: result: $with_builtin_regex" >&5 echo "${ECHO_T}$with_builtin_regex" >&6 if test "x${with_builtin_regex}" = xno; then cf_regex_func=no cf_regex_libs="regex re" case $host_os in (mingw*) cf_regex_libs="gnurx $cf_regex_libs" ;; esac echo "$as_me:3724: checking for regcomp" >&5 echo $ECHO_N "checking for regcomp... $ECHO_C" >&6 if test "${ac_cv_func_regcomp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 3730 "configure" #include "confdefs.h" #define regcomp autoconf_temporary #include /* least-intrusive standard header which defines gcc2 __stub macros */ #undef regcomp #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char regcomp (void); int main (void) { /* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_regcomp) || defined (__stub___regcomp) #error found stub for regcomp #endif return regcomp (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:3761: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:3764: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:3767: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3770: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_regcomp=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_regcomp=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:3780: result: $ac_cv_func_regcomp" >&5 echo "${ECHO_T}$ac_cv_func_regcomp" >&6 if test $ac_cv_func_regcomp = yes; then cf_regex_func=regcomp else for cf_regex_lib in $cf_regex_libs do as_ac_Lib=`echo "ac_cv_lib_$cf_regex_lib''_regcomp" | $as_tr_sh` echo "$as_me:3789: checking for regcomp in -l$cf_regex_lib" >&5 echo $ECHO_N "checking for regcomp in -l$cf_regex_lib... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l$cf_regex_lib $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 3797 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char regcomp (); int main (void) { regcomp (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:3816: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:3819: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:3822: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3825: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:3836: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then cf_add_libs="$LIBS" # reverse order cf_add_0lib= for cf_add_1lib in -l$cf_regex_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done # filter duplicates for cf_add_1lib in $cf_add_0lib; do for cf_add_2lib in $cf_add_libs; do if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" cf_regex_func=regcomp break fi done fi if test "$cf_regex_func" = no ; then echo "$as_me:3865: checking for compile" >&5 echo $ECHO_N "checking for compile... $ECHO_C" >&6 if test "${ac_cv_func_compile+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 3871 "configure" #include "confdefs.h" #define compile autoconf_temporary #include /* least-intrusive standard header which defines gcc2 __stub macros */ #undef compile #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char compile (void); int main (void) { /* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_compile) || defined (__stub___compile) #error found stub for compile #endif return compile (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:3902: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:3905: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:3908: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3911: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_compile=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_compile=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:3921: result: $ac_cv_func_compile" >&5 echo "${ECHO_T}$ac_cv_func_compile" >&6 if test $ac_cv_func_compile = yes; then cf_regex_func=compile else echo "$as_me:3927: checking for compile in -lgen" >&5 echo $ECHO_N "checking for compile in -lgen... $ECHO_C" >&6 if test "${ac_cv_lib_gen_compile+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgen $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 3935 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char compile (); int main (void) { compile (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:3954: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:3957: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:3960: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3963: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gen_compile=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_gen_compile=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:3974: result: $ac_cv_lib_gen_compile" >&5 echo "${ECHO_T}$ac_cv_lib_gen_compile" >&6 if test $ac_cv_lib_gen_compile = yes; then cf_add_libs="$LIBS" # reverse order cf_add_0lib= for cf_add_1lib in -lgen; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done # filter duplicates for cf_add_1lib in $cf_add_0lib; do for cf_add_2lib in $cf_add_libs; do if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" cf_regex_func=compile fi fi fi if test "$cf_regex_func" = no ; then { echo "$as_me:4002: WARNING: cannot find regular expression library" >&5 echo "$as_me: WARNING: cannot find regular expression library" >&2;} fi echo "$as_me:4006: checking for regular-expression headers" >&5 echo $ECHO_N "checking for regular-expression headers... $ECHO_C" >&6 if test "${cf_cv_regex_hdrs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_regex_hdrs=no case $cf_regex_func in (compile) for cf_regex_hdr in regexp.h regexpr.h do cat >conftest.$ac_ext <<_ACEOF #line 4018 "configure" #include "confdefs.h" #include <$cf_regex_hdr> int main (void) { char *p = compile("", "", "", 0); int x = step("", ""); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:4033: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:4036: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:4039: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4042: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_regex_hdrs=$cf_regex_hdr break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done ;; (*) for cf_regex_hdr in regex.h do cat >conftest.$ac_ext <<_ACEOF #line 4059 "configure" #include "confdefs.h" #include #include <$cf_regex_hdr> int main (void) { regex_t *p; int x = regcomp(p, "", 0); int y = regexec(p, "", 0, 0, 0); regfree(p); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:4077: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:4080: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:4083: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4086: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_regex_hdrs=$cf_regex_hdr break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done ;; esac fi echo "$as_me:4102: result: $cf_cv_regex_hdrs" >&5 echo "${ECHO_T}$cf_cv_regex_hdrs" >&6 case $cf_cv_regex_hdrs in (no) { echo "$as_me:4106: WARNING: no regular expression header found" >&5 echo "$as_me: WARNING: no regular expression header found" >&2;} ;; (regex.h) cat >>confdefs.h <<\EOF #define HAVE_REGEX_H_FUNCS 1 EOF ;; (regexp.h) cat >>confdefs.h <<\EOF #define HAVE_REGEXP_H_FUNCS 1 EOF ;; (regexpr.h) cat >>confdefs.h <<\EOF #define HAVE_REGEXPR_H_FUNCS 1 EOF ;; esac fi ############################################################################### echo "$as_me:4128: checking if you want to use mawk's own srand/rand functions" >&5 echo $ECHO_N "checking if you want to use mawk's own srand/rand functions... $ECHO_C" >&6 # Check whether --enable-builtin-srand or --disable-builtin-srand was given. if test "${enable_builtin_srand+set}" = set; then enableval="$enable_builtin_srand" test "$enableval" != yes && enableval=no if test "$enableval" != "no" ; then with_builtin_srand=yes else with_builtin_srand=no fi else enableval=no with_builtin_srand=no fi; if test "x${with_builtin_srand}" != xno; then with_builtin_srand=yes fi echo "$as_me:4148: result: $with_builtin_srand" >&5 echo "${ECHO_T}$with_builtin_srand" >&6 if test "x${with_builtin_srand}" = xno; then echo "$as_me:4153: checking for random-integer functions" >&5 echo $ECHO_N "checking for random-integer functions... $ECHO_C" >&6 if test "${cf_cv_srand_func+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_srand_func=unknown for cf_func in arc4random_push/arc4random arc4random_stir/arc4random srandom/random srand48/lrand48 srand/rand do cf_srand_func=`echo $cf_func | sed -e 's%/.*%%'` cf_rand_func=`echo $cf_func | sed -e 's%.*/%%'` case $cf_srand_func in (arc4random_stir) cf_srand_func='(void)' ;; esac cat >conftest.$ac_ext <<_ACEOF #line 4173 "configure" #include "confdefs.h" #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_LIMITS_H #include #endif int main (void) { long seed = 1; $cf_srand_func(seed); seed = $cf_rand_func() ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:4192: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:4195: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:4198: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4201: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_srand_func=$cf_func break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done fi echo "$as_me:4213: result: $cf_cv_srand_func" >&5 echo "${ECHO_T}$cf_cv_srand_func" >&6 if test "$cf_cv_srand_func" != unknown ; then echo "$as_me:4216: checking for range of random-integers" >&5 echo $ECHO_N "checking for range of random-integers... $ECHO_C" >&6 if test "${cf_cv_rand_max+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $cf_cv_srand_func in (srand/rand) cf_cv_rand_max=RAND_MAX cf_rand_max=16 ;; (*/arc4random) cf_cv_rand_max=0xFFFFFFFFUL cf_rand_max=32 ;; (*) cf_cv_rand_max=INT_MAX cf_rand_max=31 ;; esac cat >conftest.$ac_ext <<_ACEOF #line 4237 "configure" #include "confdefs.h" #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_LIMITS_H #include #endif int main (void) { long x = $cf_cv_rand_max ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:4256: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4259: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:4262: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4265: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_rand_max="(1UL<<$cf_rand_max)-1" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:4276: result: $cf_cv_rand_max" >&5 echo "${ECHO_T}$cf_cv_rand_max" >&6 case $cf_cv_srand_func in (*/arc4random) echo "$as_me:4281: checking if should be included" >&5 echo $ECHO_N "checking if should be included... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line 4284 "configure" #include "confdefs.h" #include int main (void) { void *arc4random(int); void *x = arc4random(1) ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:4297: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4300: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:4303: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4306: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_bsd_stdlib_h=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF #line 4313 "configure" #include "confdefs.h" #include int main (void) { unsigned x = arc4random() ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:4325: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4328: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:4331: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4334: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_bsd_stdlib_h=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_bsd_stdlib_h=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:4345: result: $cf_bsd_stdlib_h" >&5 echo "${ECHO_T}$cf_bsd_stdlib_h" >&6 if test "$cf_bsd_stdlib_h" = yes then cat >>confdefs.h <<\EOF #define HAVE_BSD_STDLIB_H 1 EOF else echo "$as_me:4355: checking if should be included" >&5 echo $ECHO_N "checking if should be included... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line 4358 "configure" #include "confdefs.h" #include int main (void) { void *arc4random(int); void *x = arc4random(1) ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:4371: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4374: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:4377: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4380: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_bsd_random_h=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF #line 4387 "configure" #include "confdefs.h" #include int main (void) { unsigned x = arc4random() ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:4399: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4402: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:4405: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4408: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_bsd_random_h=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_bsd_random_h=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:4419: result: $cf_bsd_random_h" >&5 echo "${ECHO_T}$cf_bsd_random_h" >&6 if test "$cf_bsd_random_h" = yes then cat >>confdefs.h <<\EOF #define HAVE_BSD_RANDOM_H 1 EOF else { echo "$as_me:4429: WARNING: no header file found for arc4random" >&5 echo "$as_me: WARNING: no header file found for arc4random" >&2;} fi fi ;; esac cf_srand_func=`echo $cf_func | sed -e 's%/.*%%'` cf_rand_func=`echo $cf_func | sed -e 's%.*/%%'` case $cf_srand_func in (arc4random_stir) cf_srand_func='(void)' ;; esac cf_rand_max=`echo "mawk_rand_max" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <&5 echo $ECHO_N "checking if you want mawk to initialize random numbers at startup... $ECHO_C" >&6 # Check whether --enable-init-srand or --disable-init-srand was given. if test "${enable_init_srand+set}" = set; then enableval="$enable_init_srand" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then with_init_srand=no else with_init_srand=yes fi else enableval=yes with_init_srand=yes fi; if test "x${with_init_srand}" != xno; then with_init_srand=yes else CPPFLAGS="$CPPFLAGS -DNO_INIT_SRAND" fi echo "$as_me:4489: result: $with_init_srand" >&5 echo "${ECHO_T}$with_init_srand" >&6 ############################################################################### for ac_prog in byacc 'bison -y' do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:4498: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_YACC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_YACC="$ac_prog" echo "$as_me:4513: found $ac_dir/$ac_word" >&5 break done fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then echo "$as_me:4521: result: $YACC" >&5 echo "${ECHO_T}$YACC" >&6 else echo "$as_me:4524: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" for ac_prog in lint cppcheck splint do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:4536: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_LINT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LINT"; then ac_cv_prog_LINT="$LINT" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_LINT="$ac_prog" echo "$as_me:4551: found $ac_dir/$ac_word" >&5 break done fi fi LINT=$ac_cv_prog_LINT if test -n "$LINT"; then echo "$as_me:4559: result: $LINT" >&5 echo "${ECHO_T}$LINT" >&6 else echo "$as_me:4562: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$LINT" && break done case "x$LINT" in (xcppcheck|x*/cppcheck) test -z "$LINT_OPTS" && LINT_OPTS="--enable=all" ;; esac echo "$as_me:4575: checking if filesystem supports mixed-case filenames" >&5 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6 if test "${cf_cv_mixedcase+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes ; then case $target_alias in (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*) cf_cv_mixedcase=no ;; (*) cf_cv_mixedcase=yes ;; esac else rm -f conftest CONFTEST echo test >conftest if test -f CONFTEST ; then cf_cv_mixedcase=no else cf_cv_mixedcase=yes fi rm -f conftest CONFTEST fi fi echo "$as_me:4602: result: $cf_cv_mixedcase" >&5 echo "${ECHO_T}$cf_cv_mixedcase" >&6 test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF #define MIXEDCASE_FILENAMES 1 EOF for ac_prog in exctags ctags do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:4613: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CTAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CTAGS"; then ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CTAGS="$ac_prog" echo "$as_me:4628: found $ac_dir/$ac_word" >&5 break done fi fi CTAGS=$ac_cv_prog_CTAGS if test -n "$CTAGS"; then echo "$as_me:4636: result: $CTAGS" >&5 echo "${ECHO_T}$CTAGS" >&6 else echo "$as_me:4639: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CTAGS" && break done for ac_prog in exetags etags do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:4650: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ETAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ETAGS"; then ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ETAGS="$ac_prog" echo "$as_me:4665: found $ac_dir/$ac_word" >&5 break done fi fi ETAGS=$ac_cv_prog_ETAGS if test -n "$ETAGS"; then echo "$as_me:4673: result: $ETAGS" >&5 echo "${ECHO_T}$ETAGS" >&6 else echo "$as_me:4676: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ETAGS" && break done # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args. set dummy ${CTAGS:-ctags}; ac_word=$2 echo "$as_me:4685: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MAKE_LOWER_TAGS"; then ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_MAKE_LOWER_TAGS="yes" echo "$as_me:4700: found $ac_dir/$ac_word" >&5 break done test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no" fi fi MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS if test -n "$MAKE_LOWER_TAGS"; then echo "$as_me:4709: result: $MAKE_LOWER_TAGS" >&5 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6 else echo "$as_me:4712: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$cf_cv_mixedcase" = yes ; then # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args. set dummy ${ETAGS:-etags}; ac_word=$2 echo "$as_me:4719: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MAKE_UPPER_TAGS"; then ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_MAKE_UPPER_TAGS="yes" echo "$as_me:4734: found $ac_dir/$ac_word" >&5 break done test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no" fi fi MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS if test -n "$MAKE_UPPER_TAGS"; then echo "$as_me:4743: result: $MAKE_UPPER_TAGS" >&5 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6 else echo "$as_me:4746: result: no" >&5 echo "${ECHO_T}no" >&6 fi else MAKE_UPPER_TAGS=no fi if test "$MAKE_UPPER_TAGS" = yes ; then MAKE_UPPER_TAGS= else MAKE_UPPER_TAGS="#" fi if test "$MAKE_LOWER_TAGS" = yes ; then MAKE_LOWER_TAGS= else MAKE_LOWER_TAGS="#" fi echo "$as_me:4766: checking if the POSIX test-macros are already defined" >&5 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6 if test "${cf_cv_posix_visible+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 4773 "configure" #include "confdefs.h" #include int main (void) { #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \ && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \ && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \ && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0) #error conflicting symbols found #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:4792: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4795: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:4798: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4801: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_posix_visible=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_posix_visible=yes fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:4812: result: $cf_cv_posix_visible" >&5 echo "${ECHO_T}$cf_cv_posix_visible" >&6 if test "$cf_cv_posix_visible" = no; then cf_XOPEN_SOURCE=500 cf_POSIX_C_SOURCE=199506L cf_xopen_source= case $host_os in (aix[4-7]*) cf_xopen_source="-D_ALL_SOURCE" ;; (msys) cf_XOPEN_SOURCE=600 ;; (darwin[0-8].*) cf_xopen_source="-D_APPLE_C_SOURCE" ;; (darwin*) cf_xopen_source="-D_DARWIN_C_SOURCE" cf_XOPEN_SOURCE= ;; (freebsd*|dragonfly*|midnightbsd*) # 5.x headers associate # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L cf_POSIX_C_SOURCE=200112L cf_XOPEN_SOURCE=600 cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" ;; (hpux11*) cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500" ;; (hpux*) cf_xopen_source="-D_HPUX_SOURCE" ;; (irix[56].*) cf_xopen_source="-D_SGI_SOURCE" cf_XOPEN_SOURCE= ;; (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) cf_gnu_xopen_source=$cf_XOPEN_SOURCE echo "$as_me:4857: checking if this is the GNU C library" >&5 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6 if test "${cf_cv_gnu_library+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 4864 "configure" #include "confdefs.h" #include int main (void) { #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0 return 0; #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0 return 0; #else # error not GNU C library #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:4883: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4886: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:4889: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4892: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gnu_library=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_gnu_library=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:4903: result: $cf_cv_gnu_library" >&5 echo "${ECHO_T}$cf_cv_gnu_library" >&6 if test x$cf_cv_gnu_library = xyes; then # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE # was changed to help a little. newlib incorporated the change about 4 # years later. echo "$as_me:4911: checking if _DEFAULT_SOURCE can be used as a basis" >&5 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6 if test "${cf_cv_gnu_library_219+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_save="$CPPFLAGS" test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE" cat >conftest.$ac_ext <<_ACEOF #line 4923 "configure" #include "confdefs.h" #include int main (void) { #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2) return 0; #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3) return 0; #else # error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:4942: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4945: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:4948: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4951: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gnu_library_219=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_gnu_library_219=no fi rm -f conftest.$ac_objext conftest.$ac_ext CPPFLAGS="$cf_save" fi echo "$as_me:4963: result: $cf_cv_gnu_library_219" >&5 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6 if test "x$cf_cv_gnu_library_219" = xyes; then cf_save="$CPPFLAGS" echo "$as_me:4968: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi cat >conftest.$ac_ext <<_ACEOF #line 5073 "configure" #include "confdefs.h" #include #include int main (void) { #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1) return 0; #else # error GNU C library is too old #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:5093: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5096: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:5099: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5102: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gnu_dftsrc_219=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_gnu_dftsrc_219=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:5113: result: $cf_cv_gnu_dftsrc_219" >&5 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save" else cf_cv_gnu_dftsrc_219=maybe fi if test "x$cf_cv_gnu_dftsrc_219" != xyes; then echo "$as_me:5122: checking if we must define _GNU_SOURCE" >&5 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6 if test "${cf_cv_gnu_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 5129 "configure" #include "confdefs.h" #include int main (void) { #ifndef _XOPEN_SOURCE #error expected _XOPEN_SOURCE to be defined #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:5144: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5147: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:5150: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5153: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gnu_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in -D_GNU_SOURCE do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi cat >conftest.$ac_ext <<_ACEOF #line 5260 "configure" #include "confdefs.h" #include int main (void) { #ifdef _XOPEN_SOURCE #error expected _XOPEN_SOURCE to be undefined #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:5275: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5278: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:5281: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5284: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gnu_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_gnu_source=yes fi rm -f conftest.$ac_objext conftest.$ac_ext CPPFLAGS="$cf_save" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:5299: result: $cf_cv_gnu_source" >&5 echo "${ECHO_T}$cf_cv_gnu_source" >&6 if test "$cf_cv_gnu_source" = yes then echo "$as_me:5304: checking if we should also define _DEFAULT_SOURCE" >&5 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6 if test "${cf_cv_default_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE" cat >conftest.$ac_ext <<_ACEOF #line 5314 "configure" #include "confdefs.h" #include int main (void) { #ifdef _DEFAULT_SOURCE #error expected _DEFAULT_SOURCE to be undefined #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:5329: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5332: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:5335: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5338: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_default_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_default_source=yes fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:5349: result: $cf_cv_default_source" >&5 echo "${ECHO_T}$cf_cv_default_source" >&6 if test "$cf_cv_default_source" = yes then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE" fi fi fi fi ;; (minix*) cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this... ;; (mirbsd*) # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks and other headers which use u_int / u_short types cf_XOPEN_SOURCE= if test "$cf_cv_posix_visible" = no; then cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \ sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \ sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` echo "$as_me:5386: checking if we should define _POSIX_C_SOURCE" >&5 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6 if test "${cf_cv_posix_c_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else echo "${as_me:-configure}:5392: testing if the symbol is already defined go no further ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF #line 5395 "configure" #include "confdefs.h" #include int main (void) { #ifndef _POSIX_C_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:5410: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5413: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:5416: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5419: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_posix_c_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_want_posix_source=no case .$cf_POSIX_C_SOURCE in (.[12]??*) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" ;; (.2) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" cf_want_posix_source=yes ;; (.*) cf_want_posix_source=yes ;; esac if test "$cf_want_posix_source" = yes ; then cat >conftest.$ac_ext <<_ACEOF #line 5440 "configure" #include "confdefs.h" #include int main (void) { #ifdef _POSIX_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:5455: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5458: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:5461: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5464: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "${as_me:-configure}:5475: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source" echo "${as_me:-configure}:5483: testing if the second compile does not leave our definition intact error ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF #line 5486 "configure" #include "confdefs.h" #include int main (void) { #ifndef _POSIX_C_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:5501: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5504: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:5507: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5510: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_posix_c_source=no fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:5526: result: $cf_cv_posix_c_source" >&5 echo "${ECHO_T}$cf_cv_posix_c_source" >&6 if test "$cf_cv_posix_c_source" != no ; then CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_cv_posix_c_source do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi fi fi # cf_cv_posix_visible ;; (netbsd*) cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw ;; (openbsd[4-9]*) # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw cf_xopen_source="-D_BSD_SOURCE" cf_XOPEN_SOURCE=600 ;; (openbsd*) # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw ;; (osf[45]*) cf_xopen_source="-D_OSF_SOURCE" ;; (nto-qnx*) cf_xopen_source="-D_QNX_SOURCE" ;; (sco*) # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer ;; (solaris2.*) cf_xopen_source="-D__EXTENSIONS__" cf_cv_xopen_source=broken ;; (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2) cf_XOPEN_SOURCE= cf_POSIX_C_SOURCE= ;; (*) echo "$as_me:5666: checking if we should define _XOPEN_SOURCE" >&5 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6 if test "${cf_cv_xopen_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 5673 "configure" #include "confdefs.h" #include #include #include int main (void) { #ifndef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:5692: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5695: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:5698: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5701: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" cat >conftest.$ac_ext <<_ACEOF #line 5713 "configure" #include "confdefs.h" #include #include #include int main (void) { #ifdef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:5732: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5735: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:5738: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5741: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_xopen_source=$cf_XOPEN_SOURCE fi rm -f conftest.$ac_objext conftest.$ac_ext CPPFLAGS="$cf_save" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:5756: result: $cf_cv_xopen_source" >&5 echo "${ECHO_T}$cf_cv_xopen_source" >&6 if test "$cf_cv_xopen_source" != no ; then CFLAGS=`echo "$CFLAGS" | \ sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_temp_xopen_source do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi fi if test "$cf_cv_posix_visible" = no; then cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \ sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \ sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` echo "$as_me:5886: checking if we should define _POSIX_C_SOURCE" >&5 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6 if test "${cf_cv_posix_c_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else echo "${as_me:-configure}:5892: testing if the symbol is already defined go no further ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF #line 5895 "configure" #include "confdefs.h" #include int main (void) { #ifndef _POSIX_C_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:5910: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5913: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:5916: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5919: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_posix_c_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_want_posix_source=no case .$cf_POSIX_C_SOURCE in (.[12]??*) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" ;; (.2) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" cf_want_posix_source=yes ;; (.*) cf_want_posix_source=yes ;; esac if test "$cf_want_posix_source" = yes ; then cat >conftest.$ac_ext <<_ACEOF #line 5940 "configure" #include "confdefs.h" #include int main (void) { #ifdef _POSIX_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:5955: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5958: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:5961: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5964: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "${as_me:-configure}:5975: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source" echo "${as_me:-configure}:5983: testing if the second compile does not leave our definition intact error ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF #line 5986 "configure" #include "confdefs.h" #include int main (void) { #ifndef _POSIX_C_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:6001: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6004: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:6007: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6010: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_posix_c_source=no fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:6026: result: $cf_cv_posix_c_source" >&5 echo "${ECHO_T}$cf_cv_posix_c_source" >&6 if test "$cf_cv_posix_c_source" != no ; then CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_cv_posix_c_source do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi fi fi # cf_cv_posix_visible ;; esac if test -n "$cf_xopen_source" ; then cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_xopen_source do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6 echo "${as_me:-configure}:6220: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5 test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$verbose" && echo " add to \$CPPFLAGS $cf_new_cppflags" 1>&6 echo "${as_me:-configure}:6230: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$verbose" && echo " add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6 echo "${as_me:-configure}:6240: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi fi if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then echo "$as_me:6250: checking if _XOPEN_SOURCE really is set" >&5 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line 6253 "configure" #include "confdefs.h" #include int main (void) { #ifndef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:6268: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6271: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:6274: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6277: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_XOPEN_SOURCE_set=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_XOPEN_SOURCE_set=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:6286: result: $cf_XOPEN_SOURCE_set" >&5 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6 if test $cf_XOPEN_SOURCE_set = yes then cat >conftest.$ac_ext <<_ACEOF #line 6291 "configure" #include "confdefs.h" #include int main (void) { #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:6306: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6309: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:6312: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6315: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_XOPEN_SOURCE_set_ok=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_XOPEN_SOURCE_set_ok=no fi rm -f conftest.$ac_objext conftest.$ac_ext if test $cf_XOPEN_SOURCE_set_ok = no then { echo "$as_me:6326: WARNING: _XOPEN_SOURCE is lower than requested" >&5 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;} fi else echo "$as_me:6331: checking if we should define _XOPEN_SOURCE" >&5 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6 if test "${cf_cv_xopen_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 6338 "configure" #include "confdefs.h" #include #include #include int main (void) { #ifndef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:6357: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6360: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:6363: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6366: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" cat >conftest.$ac_ext <<_ACEOF #line 6378 "configure" #include "confdefs.h" #include #include #include int main (void) { #ifdef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:6397: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6400: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:6403: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6406: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_xopen_source=$cf_XOPEN_SOURCE fi rm -f conftest.$ac_objext conftest.$ac_ext CPPFLAGS="$cf_save" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:6421: result: $cf_cv_xopen_source" >&5 echo "${ECHO_T}$cf_cv_xopen_source" >&6 if test "$cf_cv_xopen_source" != no ; then CFLAGS=`echo "$CFLAGS" | \ sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_temp_xopen_source do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi fi fi fi fi # cf_cv_posix_visible # Check whether --enable-largefile or --disable-largefile was given. if test "${enable_largefile+set}" = set; then enableval="$enable_largefile" fi; if test "$enable_largefile" != no; then echo "$as_me:6547: checking for special C compiler options needed for large files" >&5 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_largefile_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat >conftest.$ac_ext <<_ACEOF #line 6559 "configure" #include "confdefs.h" #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:6579: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6582: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:6585: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6588: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext CC="$CC -n32" rm -f conftest.$ac_objext if { (eval echo "$as_me:6598: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6601: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:6604: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6607: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_largefile_CC=' -n32'; break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi echo "$as_me:6621: result: $ac_cv_sys_largefile_CC" >&5 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi echo "$as_me:6627: checking for _FILE_OFFSET_BITS value needed for large files" >&5 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_file_offset_bits+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do ac_cv_sys_file_offset_bits=no cat >conftest.$ac_ext <<_ACEOF #line 6635 "configure" #include "confdefs.h" #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:6655: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6658: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:6661: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6664: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line 6673 "configure" #include "confdefs.h" #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:6694: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6697: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:6700: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6703: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_file_offset_bits=64; break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext break done fi echo "$as_me:6714: result: $ac_cv_sys_file_offset_bits" >&5 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 if test "$ac_cv_sys_file_offset_bits" != no; then cat >>confdefs.h <&5 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_large_files+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do ac_cv_sys_large_files=no cat >conftest.$ac_ext <<_ACEOF #line 6732 "configure" #include "confdefs.h" #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:6752: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6755: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:6758: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6761: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line 6770 "configure" #include "confdefs.h" #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:6791: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6794: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:6797: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6800: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_large_files=1; break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext break done fi echo "$as_me:6811: result: $ac_cv_sys_large_files" >&5 echo "${ECHO_T}$ac_cv_sys_large_files" >&6 if test "$ac_cv_sys_large_files" != no; then cat >>confdefs.h <&5 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_largefile_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do ac_cv_sys_largefile_source=no cat >conftest.$ac_ext <<_ACEOF #line 6832 "configure" #include "confdefs.h" #include int main (void) { return !fseeko; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:6844: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6847: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:6850: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6853: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line 6862 "configure" #include "confdefs.h" #define _LARGEFILE_SOURCE 1 #include int main (void) { return !fseeko; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:6875: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6878: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:6881: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6884: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_largefile_source=1; break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext break done fi echo "$as_me:6895: result: $ac_cv_sys_largefile_source" >&5 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6 if test "$ac_cv_sys_largefile_source" != no; then cat >>confdefs.h <&5 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6 if test "${ac_cv_func_fseeko+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 6915 "configure" #include "confdefs.h" #include int main (void) { return fseeko && fseeko (stdin, 0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:6927: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:6930: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:6933: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6936: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_fseeko=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_fseeko=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:6946: result: $ac_cv_func_fseeko" >&5 echo "${ECHO_T}$ac_cv_func_fseeko" >&6 if test $ac_cv_func_fseeko = yes; then cat >>confdefs.h <<\EOF #define HAVE_FSEEKO 1 EOF fi # Normally we would collect these definitions in the config.h, # but (like _XOPEN_SOURCE), some environments rely on having these # defined before any of the system headers are included. Another # case comes up with C++, e.g., on AIX the compiler compiles the # header files by themselves before looking at the body files it is # told to compile. For ncurses, those header files do not include # the config.h if test "$ac_cv_sys_large_files" != no then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES" fi if test "$ac_cv_sys_largefile_source" != no then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE" fi if test "$ac_cv_sys_file_offset_bits" != no then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits" fi echo "$as_me:6985: checking whether to use struct dirent64" >&5 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6 if test "${cf_cv_struct_dirent64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 6992 "configure" #include "confdefs.h" #pragma GCC diagnostic error "-Wincompatible-pointer-types" #include #include int main (void) { /* if transitional largefile support is setup, this is true */ extern struct dirent64 * readdir(DIR *); struct dirent64 *x = readdir((DIR *)0); struct dirent *y = readdir((DIR *)0); int z = x - y; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:7014: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:7017: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:7020: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7023: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_struct_dirent64=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_struct_dirent64=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:7034: result: $cf_cv_struct_dirent64" >&5 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6 test "$cf_cv_struct_dirent64" = yes && cat >>confdefs.h <<\EOF #define HAVE_STRUCT_DIRENT64 1 EOF fi echo "$as_me:7043: checking if you want to use dmalloc for testing" >&5 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6 # Check whether --with-dmalloc or --without-dmalloc was given. if test "${with_dmalloc+set}" = set; then withval="$with_dmalloc" cat >>confdefs.h <&5 echo "${ECHO_T}${with_dmalloc:-no}" >&6 case .$with_cflags in (.*-g*) case .$CFLAGS in (.*-g*) ;; (*) cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in -g do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi ;; esac ;; esac if test "$with_dmalloc" = yes ; then echo "$as_me:7174: checking for dmalloc.h" >&5 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6 if test "${ac_cv_header_dmalloc_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 7180 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:7184: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:7190: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_dmalloc_h=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_dmalloc_h=no fi rm -f conftest.err conftest.$ac_ext fi echo "$as_me:7209: result: $ac_cv_header_dmalloc_h" >&5 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6 if test $ac_cv_header_dmalloc_h = yes; then echo "$as_me:7213: checking for dmalloc_debug in -ldmalloc" >&5 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 7221 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dmalloc_debug (); int main (void) { dmalloc_debug (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:7240: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7243: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:7246: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7249: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dmalloc_dmalloc_debug=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_dmalloc_dmalloc_debug=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:7260: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6 # Check whether --with-dbmalloc or --without-dbmalloc was given. if test "${with_dbmalloc+set}" = set; then withval="$with_dbmalloc" cat >>confdefs.h <&5 echo "${ECHO_T}${with_dbmalloc:-no}" >&6 case .$with_cflags in (.*-g*) case .$CFLAGS in (.*-g*) ;; (*) cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in -g do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi ;; esac ;; esac if test "$with_dbmalloc" = yes ; then echo "$as_me:7406: checking for dbmalloc.h" >&5 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6 if test "${ac_cv_header_dbmalloc_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 7412 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:7416: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:7422: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_dbmalloc_h=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_dbmalloc_h=no fi rm -f conftest.err conftest.$ac_ext fi echo "$as_me:7441: result: $ac_cv_header_dbmalloc_h" >&5 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6 if test $ac_cv_header_dbmalloc_h = yes; then echo "$as_me:7445: checking for debug_malloc in -ldbmalloc" >&5 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldbmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 7453 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char debug_malloc (); int main (void) { debug_malloc (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:7472: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7475: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:7478: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7481: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dbmalloc_debug_malloc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_dbmalloc_debug_malloc=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:7492: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6 # Check whether --with-valgrind or --without-valgrind was given. if test "${with_valgrind+set}" = set; then withval="$with_valgrind" cat >>confdefs.h <&5 echo "${ECHO_T}${with_valgrind:-no}" >&6 case .$with_cflags in (.*-g*) case .$CFLAGS in (.*-g*) ;; (*) cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in -g do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi ;; esac ;; esac echo "$as_me:7637: checking if you want to perform memory-leak testing" >&5 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6 # Check whether --enable-leaks or --disable-leaks was given. if test "${enable_leaks+set}" = set; then enableval="$enable_leaks" if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi else : ${with_no_leaks:=no} fi; echo "$as_me:7647: result: $with_no_leaks" >&5 echo "${ECHO_T}$with_no_leaks" >&6 if test "$with_no_leaks" = yes ; then cat >>confdefs.h <<\EOF #define NO_LEAKS 1 EOF cat >>confdefs.h <<\EOF #define YY_NO_LEAKS 1 EOF fi echo "$as_me:7662: checking if you want to enable debugging trace" >&5 echo $ECHO_N "checking if you want to enable debugging trace... $ECHO_C" >&6 # Check whether --enable-trace or --disable-trace was given. if test "${enable_trace+set}" = set; then enableval="$enable_trace" test "$enableval" != yes && enableval=no if test "$enableval" != "no" ; then with_trace=yes else with_trace=no fi else enableval=no with_trace=no fi; echo "$as_me:7679: result: $with_trace" >&5 echo "${ECHO_T}$with_trace" >&6 if test "$with_trace" = "yes" then cat >>confdefs.h <<\EOF #define OPT_TRACE 1 EOF fi if test "x$with_trace" = xyes then EXTRAOBJS="$EXTRAOBJS trace\$o" fi if test "x$cf_mawk_check_size_t" != xyes ; then if test "${cf_cv_size_t_SIZE_T_STDDEF_H+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else echo "$as_me:7701: checking for stddef.h" >&5 echo $ECHO_N "checking for stddef.h... $ECHO_C" >&6 if test "${ac_cv_header_stddef_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 7707 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:7711: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:7717: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_stddef_h=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_stddef_h=no fi rm -f conftest.err conftest.$ac_ext fi echo "$as_me:7736: result: $ac_cv_header_stddef_h" >&5 echo "${ECHO_T}$ac_cv_header_stddef_h" >&6 if test $ac_cv_header_stddef_h = yes; then cf_mawk_check_size=ok fi if test "x$cf_mawk_check_size" = xok ; then echo "$as_me:7743: checking if size_t is declared in stddef.h" >&5 echo $ECHO_N "checking if size_t is declared in stddef.h... $ECHO_C" >&6 if test "${cf_cv_size_t_SIZE_T_STDDEF_H+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 7750 "configure" #include "confdefs.h" #include int main (void) { size_t *n ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:7762: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:7765: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:7768: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7771: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_size_t_SIZE_T_STDDEF_H=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_size_t_SIZE_T_STDDEF_H=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:7781: result: $cf_cv_size_t_SIZE_T_STDDEF_H" >&5 echo "${ECHO_T}$cf_cv_size_t_SIZE_T_STDDEF_H" >&6 fi fi if test "x$cf_cv_size_t_SIZE_T_STDDEF_H" = xyes ; then cat >>confdefs.h <&6 else echo "$as_me:7803: checking for sys/types.h" >&5 echo $ECHO_N "checking for sys/types.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_types_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 7809 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:7813: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:7819: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_sys_types_h=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_sys_types_h=no fi rm -f conftest.err conftest.$ac_ext fi echo "$as_me:7838: result: $ac_cv_header_sys_types_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_types_h" >&6 if test $ac_cv_header_sys_types_h = yes; then cf_mawk_check_size=ok fi if test "x$cf_mawk_check_size" = xok ; then echo "$as_me:7845: checking if size_t is declared in sys/types.h" >&5 echo $ECHO_N "checking if size_t is declared in sys/types.h... $ECHO_C" >&6 if test "${cf_cv_size_t_SIZE_T_TYPES_H+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 7852 "configure" #include "confdefs.h" #include int main (void) { size_t *n ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:7864: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:7867: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:7870: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7873: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_size_t_SIZE_T_TYPES_H=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_size_t_SIZE_T_TYPES_H=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:7883: result: $cf_cv_size_t_SIZE_T_TYPES_H" >&5 echo "${ECHO_T}$cf_cv_size_t_SIZE_T_TYPES_H" >&6 fi fi if test "x$cf_cv_size_t_SIZE_T_TYPES_H" = xyes ; then cat >>confdefs.h <&5 echo $ECHO_N "checking for setlocale()... $ECHO_C" >&6 if test "${cf_cv_locale+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 7906 "configure" #include "confdefs.h" #include int main (void) { setlocale(LC_ALL, "") ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:7918: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7921: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:7924: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7927: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_locale=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_locale=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:7939: result: $cf_cv_locale" >&5 echo "${ECHO_T}$cf_cv_locale" >&6 test $cf_cv_locale = yes && { cat >>confdefs.h <<\EOF #define LOCALE 1 EOF } echo "$as_me:7947: checking if external environ is declared" >&5 echo $ECHO_N "checking if external environ is declared... $ECHO_C" >&6 if test "${cf_cv_dcl_environ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 7954 "configure" #include "confdefs.h" #ifdef HAVE_STDLIB_H #include #endif #include int main (void) { int x = (int) environ ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:7970: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:7973: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:7976: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7979: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_dcl_environ=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_dcl_environ=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:7990: result: $cf_cv_dcl_environ" >&5 echo "${ECHO_T}$cf_cv_dcl_environ" >&6 if test "$cf_cv_dcl_environ" = no ; then cf_result=`echo "decl_environ" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >>confdefs.h <&5 echo $ECHO_N "checking if external environ exists... $ECHO_C" >&6 if test "${cf_cv_have_environ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 8012 "configure" #include "confdefs.h" #undef environ extern int environ; int main (void) { environ = 2 ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:8027: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8030: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:8033: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8036: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_have_environ=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_have_environ=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:8047: result: $cf_cv_have_environ" >&5 echo "${ECHO_T}$cf_cv_have_environ" >&6 if test "$cf_cv_have_environ" = yes ; then cf_result=`echo "have_environ" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >>confdefs.h <&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 8069 "configure" #include "confdefs.h" #define $ac_func autoconf_temporary #include /* least-intrusive standard header which defines gcc2 __stub macros */ #undef $ac_func #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (void); int main (void) { /* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) #error found stub for $ac_func #endif return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:8100: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8103: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:8106: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8109: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:8119: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <>confdefs.h <<\EOF #define HAVE_REAL_PIPES 1 EOF for ac_header in errno.h fcntl.h unistd.h sys/wait.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:8148: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 8154 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:8158: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:8164: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_ext fi echo "$as_me:8183: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking if math.h declares _LIB_VERSION... $ECHO_C" >&6 if test "${cf_cv_get_math_lib_version+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 8200 "configure" #include "confdefs.h" #include int main (void) { int foo = _LIB_VERSION ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:8213: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8216: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:8219: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8222: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_get_math_lib_version=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_get_math_lib_version=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:8233: result: $cf_cv_get_math_lib_version" >&5 echo "${ECHO_T}$cf_cv_get_math_lib_version" >&6 if test "x$cf_cv_get_math_lib_version" = xyes then echo "$as_me:8238: checking if we can update _LIB_VERSION" >&5 echo $ECHO_N "checking if we can update _LIB_VERSION... $ECHO_C" >&6 if test "${cf_cv_set_math_lib_version+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 8245 "configure" #include "confdefs.h" #include int main (void) { _LIB_VERSION = _IEEE_ ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:8258: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8261: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:8264: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8267: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_set_math_lib_version=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_set_math_lib_version=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:8278: result: $cf_cv_set_math_lib_version" >&5 echo "${ECHO_T}$cf_cv_set_math_lib_version" >&6 if test "x$cf_cv_set_math_lib_version" = xyes then cat >>confdefs.h <<\EOF #define HAVE_MATH__LIB_VERSION 1 EOF else { echo "$as_me:8288: WARNING: this is probably due to a defect in your system headers" >&5 echo "$as_me: WARNING: this is probably due to a defect in your system headers" >&2;} fi fi echo "$as_me:8293: checking for limits.h" >&5 echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 if test "${ac_cv_header_limits_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 8299 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:8303: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:8309: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_limits_h=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_limits_h=no fi rm -f conftest.err conftest.$ac_ext fi echo "$as_me:8328: result: $ac_cv_header_limits_h" >&5 echo "${ECHO_T}$ac_cv_header_limits_h" >&6 if test $ac_cv_header_limits_h = yes; then cf_limits_h=yes fi if test "$cf_limits_h" = yes ; then : else echo "$as_me:8336: checking for values.h" >&5 echo $ECHO_N "checking for values.h... $ECHO_C" >&6 if test "${ac_cv_header_values_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 8342 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:8346: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:8352: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_values_h=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_values_h=no fi rm -f conftest.err conftest.$ac_ext fi echo "$as_me:8371: result: $ac_cv_header_values_h" >&5 echo "${ECHO_T}$ac_cv_header_values_h" >&6 if test $ac_cv_header_values_h = yes; then cf_values_h=yes fi if test "$cf_values_h" = yes ; then if test "$cross_compiling" = yes; then { { echo "$as_me:8379: error: cannot run test program while cross compiling" >&5 echo "$as_me: error: cannot run test program while cross compiling" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #line 8384 "configure" #include "confdefs.h" #include #include int main(void) { FILE *out = fopen("conftest.out", "w") ; unsigned max_uint = 0; if ( ! out ) exit(1) ; fprintf(out, "MAX__INT 0x%x\n", MAXINT) ; fprintf(out, "MAX__LONG 0x%lx\n", MAXLONG) ; #ifdef MAXUINT max_uint = MAXUINT; /* not likely (SunOS/Solaris lacks it) */ #else max_uint = MAXINT; max_uint <<= 1; max_uint |= 1; #endif fprintf(out, "MAX__UINT 0x%lx\n", max_uint) ; exit(0) ; return(0) ; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:8407: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8410: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:8412: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8415: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_maxint_set=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:8422: error: C program to compute maxint and maxlong failed. Please send bug report to dickey@invisible-island.net." >&5 echo "$as_me: error: C program to compute maxint and maxlong failed. Please send bug report to dickey@invisible-island.net." >&2;} { (exit 1); exit 1; }; } fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi if test "x$cf_maxint_set" != xyes ; then # compute it -- assumes two's complement if test "$cross_compiling" = yes; then { { echo "$as_me:8434: error: cannot run test program while cross compiling" >&5 echo "$as_me: error: cannot run test program while cross compiling" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #line 8439 "configure" #include "confdefs.h" #include int main(void) { int y ; unsigned yu; long yy ; FILE *out ; if ( !(out = fopen("conftest.out","w")) ) exit(1) ; /* find max int and max long */ y = 0x1000 ; while ( y > 0 ) { yu = y; y *= 2 ; } fprintf(out,"MAX__INT 0x%x\n", y-1) ; yu = yu - 1; yu <<= 1; yu |= 1; fprintf(out,"MAX__UINT 0x%x\n", y-1) ; yy = 0x1000 ; while ( yy > 0 ) yy *= 2 ; fprintf(out,"MAX__LONG 0x%lx\n", yy-1) ; exit(0) ; return 0 ; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:8465: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8468: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:8470: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8473: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:8480: error: C program to compute maxint and maxlong failed. Please send bug report to dickey@invisible-island.net." >&5 echo "$as_me: error: C program to compute maxint and maxlong failed. Please send bug report to dickey@invisible-island.net." >&2;} { (exit 1); exit 1; }; } fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi cat conftest.out | while true do read name value test -z "$name" && break cat >>confdefs.h <&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 8510 "configure" #include "confdefs.h" #define $ac_func autoconf_temporary #include /* least-intrusive standard header which defines gcc2 __stub macros */ #undef $ac_func #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (void); int main (void) { /* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) #error found stub for $ac_func #endif return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:8541: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8544: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:8547: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8550: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:8560: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 8581 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:8585: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:8591: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_ext fi echo "$as_me:8610: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking if we should use siginfo... $ECHO_C" >&6 if test "${cf_cv_use_sv_siginfo+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$sigaction" = 1 && test "$siginfo_h" = 1 ; then cf_cv_use_sv_siginfo=yes else cf_cv_use_sv_siginfo=no fi fi echo "$as_me:8635: result: $cf_cv_use_sv_siginfo" >&5 echo "${ECHO_T}$cf_cv_use_sv_siginfo" >&6 echo "$as_me:8638: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 8644 "configure" #include "confdefs.h" #include #include #ifdef signal # undef signal #endif #ifdef __cplusplus extern "C" void (*signal (int, void (*)(int)))(int); #else void (*signal ()) (); #endif int main (void) { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:8666: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:8669: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:8672: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8675: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_type_signal=int fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:8685: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 cat >>confdefs.h <&5 echo $ECHO_N "checking if we should use sigaction.sa_sigaction... $ECHO_C" >&6 if test "${cf_cv_use_sa_sigaction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_use_sa_sigaction=no if test "$ac_cv_func_sigaction" = yes then cat >conftest.$ac_ext <<_ACEOF #line 8702 "configure" #include "confdefs.h" #include int main (void) { struct sigaction foo; foo.sa_sigaction = 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:8717: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:8720: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:8723: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8726: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_use_sa_sigaction=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:8737: result: $cf_cv_use_sa_sigaction" >&5 echo "${ECHO_T}$cf_cv_use_sa_sigaction" >&6 test "$cf_cv_use_sa_sigaction" = yes && cat >>confdefs.h <<\EOF #define HAVE_SIGACTION_SA_SIGACTION 1 EOF cf_FPE_DEFS="$CPPFLAGS" cf_FPE_LIBS="$LIBS" cf_FPE_SRCS="$srcdir/fpe_check.c" CPPFLAGS="$CPPFLAGS -I. -DRETSIGTYPE=$ac_cv_type_signal" test "$ac_cv_func_isnan" = yes && CPPFLAGS="$CPPFLAGS -DHAVE_ISNAN" test "$ac_cv_func_nanf" = yes && CPPFLAGS="$CPPFLAGS -DHAVE_NANF" test "$ac_cv_func_sigaction" = yes && CPPFLAGS="$CPPFLAGS -DHAVE_SIGACTION" test "$ac_cv_header_siginfo_h" = yes && CPPFLAGS="$CPPFLAGS -DHAVE_SIGINFO_H" test "$cf_cv_use_sa_sigaction" = yes && CPPFLAGS="$CPPFLAGS -DHAVE_SIGACTION_SA_SIGACTION" LIBS="$MATHLIB $LIBS" echo checking handling of floating point exceptions cat >conftest.$ac_ext < CF_EOF rm -f conftest$ac_exeext if { (eval echo "$as_me:8766: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8769: \$? = $ac_status" >&5 (exit $ac_status); }; then echo "FPE_CHECK 1:check_fpe_traps" >&5 ./conftest 2>/dev/null cf_status=$? else echo "$cf_FPE_SRCS failed to compile" 1>&2 cf_status=100 fi echo "FPE_CHECK status=$cf_status" >&5 case $cf_status in (0) ;; # good news do nothing (3) # reasonably good news cat >>confdefs.h <<\EOF #define FPE_TRAPS_ON 1 EOF if test "x$cf_cv_use_sv_siginfo" = "xno" then echo "$as_me:8790: checking for sigvec" >&5 echo $ECHO_N "checking for sigvec... $ECHO_C" >&6 if test "${ac_cv_func_sigvec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 8796 "configure" #include "confdefs.h" #define sigvec autoconf_temporary #include /* least-intrusive standard header which defines gcc2 __stub macros */ #undef sigvec #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char sigvec (void); int main (void) { /* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_sigvec) || defined (__stub___sigvec) #error found stub for sigvec #endif return sigvec (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:8827: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8830: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:8833: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8836: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_sigvec=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_sigvec=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:8846: result: $ac_cv_func_sigvec" >&5 echo "${ECHO_T}$ac_cv_func_sigvec" >&6 if test $ac_cv_func_sigvec = yes; then cf_have_sigvec=1 fi echo "FPE_CHECK 2:get_fpe_codes" >&5 if test "$cf_have_sigvec" = 1 && ./fpe_check$ac_exeext phoney_arg >> defines.out ; then : else cat >>confdefs.h <<\EOF #define NOINFO_SIGFPE 1 EOF fi fi ;; (1|2|4) # bad news have to turn off traps # only know how to do this on systemV and solaris echo "$as_me:8866: checking for ieeefp.h" >&5 echo $ECHO_N "checking for ieeefp.h... $ECHO_C" >&6 if test "${ac_cv_header_ieeefp_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 8872 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:8876: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:8882: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_ieeefp_h=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_ieeefp_h=no fi rm -f conftest.err conftest.$ac_ext fi echo "$as_me:8901: result: $ac_cv_header_ieeefp_h" >&5 echo "${ECHO_T}$ac_cv_header_ieeefp_h" >&6 if test $ac_cv_header_ieeefp_h = yes; then cf_have_ieeefp_h=1 fi echo "$as_me:8907: checking for fpsetmask" >&5 echo $ECHO_N "checking for fpsetmask... $ECHO_C" >&6 if test "${ac_cv_func_fpsetmask+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 8913 "configure" #include "confdefs.h" #define fpsetmask autoconf_temporary #include /* least-intrusive standard header which defines gcc2 __stub macros */ #undef fpsetmask #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char fpsetmask (void); int main (void) { /* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_fpsetmask) || defined (__stub___fpsetmask) #error found stub for fpsetmask #endif return fpsetmask (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:8944: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8947: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:8950: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8953: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_fpsetmask=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_fpsetmask=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:8963: result: $ac_cv_func_fpsetmask" >&5 echo "${ECHO_T}$ac_cv_func_fpsetmask" >&6 if test $ac_cv_func_fpsetmask = yes; then cf_have_fpsetmask=1 fi if test "$cf_have_ieeefp_h" = 1 && test "$cf_have_fpsetmask" = 1 ; then cat >>confdefs.h <<\EOF #define FPE_TRAPS_ON 1 EOF cat >>confdefs.h <<\EOF #define USE_IEEEFP_H 1 EOF cat >>confdefs.h <>confdefs.h <&5 echo $ECHO_N "checking for sigvec... $ECHO_C" >&6 if test "${ac_cv_func_sigvec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 8994 "configure" #include "confdefs.h" #define sigvec autoconf_temporary #include /* least-intrusive standard header which defines gcc2 __stub macros */ #undef sigvec #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char sigvec (void); int main (void) { /* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_sigvec) || defined (__stub___sigvec) #error found stub for sigvec #endif return sigvec (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:9025: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:9028: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:9031: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9034: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_sigvec=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_sigvec=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:9044: result: $ac_cv_func_sigvec" >&5 echo "${ECHO_T}$ac_cv_func_sigvec" >&6 if test $ac_cv_func_sigvec = yes; then cf_have_sigvec=1 fi echo "FPE_CHECK 2:get_fpe_codes" >&5 if test "$cf_have_sigvec" = 1 && ./fpe_check$ac_exeext phoney_arg >> defines.out ; then : else cat >>confdefs.h <<\EOF #define NOINFO_SIGFPE 1 EOF fi fi # look for strtod overflow bug echo "$as_me:9063: checking strtod bug on overflow" >&5 echo $ECHO_N "checking strtod bug on overflow... $ECHO_C" >&6 rm -f conftest$ac_exeext CPPFLAGS="$CPPFLAGS -DUSE_IEEEFP_H" cat >conftest.$ac_ext < CF_EOF if { (eval echo "$as_me:9073: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:9076: \$? = $ac_status" >&5 (exit $ac_status); }; then echo "FPE_CHECK 3:check_strtod_ovf" >&5 if ./conftest phoney_arg phoney_arg 2>/dev/null then echo "$as_me:9081: result: no bug" >&5 echo "${ECHO_T}no bug" >&6 else echo "$as_me:9084: result: buggy -- will use work around" >&5 echo "${ECHO_T}buggy -- will use work around" >&6 cat >>confdefs.h <&5 echo "${ECHO_T}$cf_FPE_SRCS failed to compile" >&6 fi else if test $cf_status != 4 ; then cat >>confdefs.h <<\EOF #define FPE_TRAPS_ON 1 EOF if test "x$cf_cv_use_sv_siginfo" = "xno" then echo "$as_me:9104: checking for sigvec" >&5 echo $ECHO_N "checking for sigvec... $ECHO_C" >&6 if test "${ac_cv_func_sigvec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 9110 "configure" #include "confdefs.h" #define sigvec autoconf_temporary #include /* least-intrusive standard header which defines gcc2 __stub macros */ #undef sigvec #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char sigvec (void); int main (void) { /* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_sigvec) || defined (__stub___sigvec) #error found stub for sigvec #endif return sigvec (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:9141: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:9144: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:9147: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9150: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_sigvec=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_sigvec=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:9160: result: $ac_cv_func_sigvec" >&5 echo "${ECHO_T}$ac_cv_func_sigvec" >&6 if test $ac_cv_func_sigvec = yes; then cf_have_sigvec=1 fi echo "FPE_CHECK 2:get_fpe_codes" >&5 if test "$cf_have_sigvec" = 1 && ./fpe_check$ac_exeext phoney_arg >> defines.out ; then : else cat >>confdefs.h <<\EOF #define NOINFO_SIGFPE 1 EOF fi fi fi case $cf_status in (1) cat 1>&2 <<-'EOF' Warning: Your system defaults generate floating point exception on divide by zero but not on overflow. You need to #define TURN_ON_FPE_TRAPS to handle overflow. EOF ;; (2) cat 1>&2 <<-'EOF' Warning: Your system defaults generate floating point exception on overflow but not on divide by zero. You need to #define TURN_ON_FPE_TRAPS to handle divide by zero. EOF ;; (4) cat 1>&2 <<-'EOF' Warning: Your system defaults do not generate floating point exceptions, but your math library does not support this behavior. You need to #define TURN_ON_FPE_TRAPS to use fp exceptions for consistency. EOF ;; esac cat 1>&2 <<-'EOF' Please report this so I can fix this script to do it automatically. dickey@invisible-island.net You can continue with the build and the resulting mawk will be usable, but getting FPE_TRAPS_ON correct eventually is best. EOF fi ;; (*) # some sort of disaster if test "x$cross_compiling" = xno then cat 1>&2 <<-EOF The program \`fpe_check' compiled from $cf_FPE_SRCS seems to have unexpectly blown up. Please report this to dickey@invisible-island.net EOF # quit or not ??? else cat 1>&2 <<-EOF The program \`fpe_check' will not work for cross-compiling. You can continue with the build and the resulting mawk will be usable, but getting FPE_TRAPS_ON correct eventually is best. EOF fi ;; esac CPPFLAGS="$cf_FPE_DEFS" LIBS="$cf_FPE_LIBS" rm -f conftest.$ac_ext fpe_check$ac_exeext # whew!! ac_config_files="$ac_config_files Makefile man/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overriden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if cmp -s $cache_file confcache; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:9315: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated automatically by configure. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false SHELL=\${CONFIG_SHELL-$SHELL} ac_cs_invocation="\$0 \$@" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Name of the executable. as_me=`echo "$0" |sed 's,.*[\\/],,'` if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file as_executable_p="test -f" # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # NLS nuisances. $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } exec 6>&1 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\EOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` shift set dummy "$ac_option" "$ac_optarg" ${1+"$@"} shift ;; -*);; *) # This is not an option, so the user has probably given explicit # arguments. ac_need_defaults=false;; esac case $1 in # Handling of the options. EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:9488: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) shift CONFIG_FILES="$CONFIG_FILES $1" ac_need_defaults=false;; --header | --heade | --head | --hea ) shift CONFIG_HEADERS="$CONFIG_HEADERS $1" ac_need_defaults=false;; # This is an error. -*) { { echo "$as_me:9507: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done exec 5>>config.log cat >&5 << _ACEOF ## ----------------------- ## ## Running config.status. ## ## ----------------------- ## This file was extended by $as_me 2.52.20200111, executed with CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS > $ac_cs_invocation on `(hostname || uname -n) 2>/dev/null | sed 1q` _ACEOF EOF cat >>$CONFIG_STATUS <<\EOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "man/Makefile" ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config_h.in" ;; *) { { echo "$as_me:9545: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. : ${TMPDIR=/tmp} { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=$TMPDIR/cs$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 { (exit 1); exit 1; } } EOF cat >>$CONFIG_STATUS <\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datarootdir@,$datarootdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@runstatedir@,$runstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@DEFS@,$DEFS,;t t s,@LIBS@,$LIBS,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t s,@CPP@,$CPP,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@BUILD_CC@,$BUILD_CC,;t t s,@BUILD_CPP@,$BUILD_CPP,;t t s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t s,@BUILD_LIBS@,$BUILD_LIBS,;t t s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t s,@MATHLIB@,$MATHLIB,;t t s,@ECHO_LT@,$ECHO_LT,;t t s,@ECHO_LD@,$ECHO_LD,;t t s,@RULE_CC@,$RULE_CC,;t t s,@SHOW_CC@,$SHOW_CC,;t t s,@ECHO_CC@,$ECHO_CC,;t t s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t s,@GROFF_PATH@,$GROFF_PATH,;t t s,@NROFF_PATH@,$NROFF_PATH,;t t s,@TBL_PATH@,$TBL_PATH,;t t s,@GROFF_NOTE@,$GROFF_NOTE,;t t s,@NROFF_NOTE@,$NROFF_NOTE,;t t s,@cf_man2html@,$cf_man2html,;t t s,@MAN2HTML_NOTE@,$MAN2HTML_NOTE,;t t s,@MAN2HTML_PATH@,$MAN2HTML_PATH,;t t s,@MAN2HTML_TEMP@,$MAN2HTML_TEMP,;t t s,@YACC@,$YACC,;t t s,@LINT@,$LINT,;t t s,@LINT_OPTS@,$LINT_OPTS,;t t s,@CTAGS@,$CTAGS,;t t s,@ETAGS@,$ETAGS,;t t s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t s,@EXTRAOBJS@,$EXTRAOBJS,;t t CEOF EOF cat >>$CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed # It is possible to make a multiline substitution using escaped newlines. # Ensure that we do not split the substitution between script fragments. ac_BEG=$ac_end ac_END=`expr $ac_end + $ac_max_sed_lines` sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next if test -s $tmp/subs.next; then grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit if test ! -s $tmp/subs.edit; then grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit if test ! -s $tmp/subs.edit; then if test $ac_beg -gt 1; then ac_end=`expr $ac_end - 1` continue fi fi fi fi if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" EOF cat >>$CONFIG_STATUS <<\EOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then { case "$ac_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" ;; esac done; } ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'` else ac_dir_suffix= ac_dots= fi case $srcdir in .) ac_srcdir=. if test -z "$ac_dots"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_dots$srcdir$ac_dir_suffix ac_top_srcdir=$ac_dots$srcdir ;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_dots$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:9814: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated automatically by config.status. */ configure_input="Generated automatically from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:9832: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:9845: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } EOF cat >>$CONFIG_STATUS <<\EOF ac_warn_datarootdir=no if test x"$ac_file" != x-; then for ac_item in $ac_file_inputs do ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item` if test -n "$ac_seen"; then ac_used=`grep '@datarootdir@' $ac_item` if test -z "$ac_used"; then { echo "$as_me:9861: WARNING: datarootdir was used implicitly but not set: $ac_seen" >&5 echo "$as_me: WARNING: datarootdir was used implicitly but not set: $ac_seen" >&2;} ac_warn_datarootdir=yes fi fi ac_seen=`grep '${datarootdir}' $ac_item` if test -n "$ac_seen"; then { echo "$as_me:9870: WARNING: datarootdir was used explicitly but not set: $ac_seen" >&5 echo "$as_me: WARNING: datarootdir was used explicitly but not set: $ac_seen" >&2;} ac_warn_datarootdir=yes fi done fi if test "x$ac_warn_datarootdir" = xyes; then ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'" fi EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then cp $tmp/out $ac_file for ac_name in prefix exec_prefix datarootdir do ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file` if test -n "$ac_seen"; then ac_init=`egrep '[ ]*'$ac_name'[ ]*=' $ac_file` if test -z "$ac_init"; then ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'` { echo "$as_me:9907: WARNING: Variable $ac_name is used but was not set: $ac_seen" >&5 echo "$as_me: WARNING: Variable $ac_name is used but was not set: $ac_seen" >&2;} fi fi done egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out if test -s $tmp/out; then ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out` { echo "$as_me:9918: WARNING: Some variables may not be substituted: $ac_seen" >&5 echo "$as_me: WARNING: Some variables may not be substituted: $ac_seen" >&2;} fi else cat $tmp/out fi rm -f $tmp/out done EOF cat >>$CONFIG_STATUS <<\EOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE". ac_iA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_iB='\([ ]\),\1#\2define\3' ac_iC=' ' ac_iD='\4,;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:9967: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:9978: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:9991: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in EOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\EOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\(\([^ (][^ (]*\)([^)]*)\)[ ]*\(.*\)$,${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end EOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs sed 's/ac_d/ac_i/g' conftest.defines >>conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\EOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, EOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # egrep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\EOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated automatically by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated automatically by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated automatically by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if cmp -s $ac_file $tmp/config.h 2>/dev/null; then { echo "$as_me:10109: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then { case "$ac_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" ;; esac done; } fi rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi done EOF cat >>$CONFIG_STATUS <<\EOF { (exit 0); exit 0; } EOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: exec 5>/dev/null $SHELL $CONFIG_STATUS || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi mawk-1.3.4-20200120/memory.h0000644000175100001440000000227711500456220013545 0ustar tomusers/******************************************** memory.h copyright 2009,2010, Thomas E. Dickey copyright 1991,1993, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: memory.h,v 1.9 2010/12/10 17:00:00 tom Exp $ * @Log: memory.h,v @ * Revision 1.1.1.1 1993/07/03 18:58:17 mike * move source to cvs * * Revision 5.2 1993/01/01 21:30:48 mike * split new_STRING() into new_STRING and new_STRING0 * * Revision 5.1 1991/12/05 07:59:28 brennan * 1.1 pre-release * */ /* memory.h */ #ifndef MAWK_MEMORY_H #define MAWK_MEMORY_H #include "types.h" #include "zmalloc.h" STRING *new_STRING(const char *); STRING *new_STRING0(size_t); STRING *new_STRING1(const char *, size_t); #ifdef DEBUG void DB_free_STRING(STRING *); #define free_STRING(s) DB_free_STRING(s) #else #define free_STRING(sval) \ do { \ if ( -- (sval)->ref_cnt == 0 && \ sval != &null_str ) \ zfree(sval, (sval)->len + STRING_OH) ; \ } while (0) #endif #endif /* MAWK_MEMORY_H */ mawk-1.3.4-20200120/re_cmpl.c0000644000175100001440000002143412773466401013664 0ustar tomusers/******************************************** re_cmpl.c copyright 2008-2014,2016, Thomas E. Dickey copyright 1991-1994,2014, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: re_cmpl.c,v 1.30 2016/09/30 13:47:45 tom Exp $ */ /* re_cmpl.c */ #include "mawk.h" #include "memory.h" #include "scan.h" #include "regexp.h" #include "repl.h" typedef struct re_node { RE_DATA re; /* keep this first, for re_destroy() */ STRING *sval; struct re_node *link; } RE_NODE; /* a list of compiled regular expressions */ static RE_NODE *re_list; static const char efmt[] = "regular expression compile failed (%s)\n%s"; /* compile a STRING to a regular expression machine. Search a list of pre-compiled strings first */ PTR re_compile(STRING * sval) { register RE_NODE *p; RE_NODE *q; char *s; /* search list */ s = sval->str; p = re_list; q = (RE_NODE *) 0; while (p) { if (sval->len == p->sval->len && memcmp(s, p->sval->str, sval->len) == 0) { /* found */ if (!q) /* already at front */ goto _return; else { /* delete from list for move to front */ q->link = p->link; goto found; } } else { q = p; p = p->link; } } /* not found */ p = ZMALLOC(RE_NODE); p->sval = sval; sval->ref_cnt++; p->re.anchored = (*s == '^'); p->re.is_empty = (sval->len == 0); if (!(p->re.compiled = REcompile(s, sval->len))) { ZFREE(p); sval->ref_cnt--; if (mawk_state == EXECUTION) rt_error(efmt, REerror(), s); else { /* compiling */ compile_error(efmt, REerror(), s); return (PTR) 0; } } found: /* insert p at the front of the list */ p->link = re_list; re_list = p; _return: #ifdef DEBUG if (dump_RE) REmprint(p->re.compiled, stderr); #endif return refRE_DATA(p->re); } /* this is only used by da() */ char * re_uncompile(PTR m) { register RE_NODE *p; for (p = re_list; p; p = p->link) if (p->re.compiled == cast_to_re(m)) return p->sval->str; #ifdef DEBUG bozo("non compiled machine"); #else return NULL; #endif } #ifdef NO_LEAKS void re_destroy(PTR m) { RE_NODE *p = (RE_NODE *) m; RE_NODE *q; RE_NODE *r; if (p != 0) { for (q = re_list, r = 0; q != 0; r = q, q = q->link) { if (q == p) { free_STRING(p->sval); REdestroy(p->re.compiled); if (r != 0) r->link = q->link; else re_list = q->link; free(q); break; } } } } #endif /*=================================================*/ /* replacement operations */ /* create a replacement CELL from a STRING * */ /* Here the replacement string gets scanned for & * which calls for using the matched text in the replacement * So to get a literal & in the replacement requires a convention * which is \& is literal & not a matched text &. * Here are the Posix rules which this code supports: \& --> & \\ --> \ \c --> \c & --> matched text */ /* FIXME -- this function doesn't handle embedded nulls split_buff[] and MAX_SPLIT are obsolete, but needed by this function. Putting them here is temporary until the rewrite to handle nulls. */ #define MAX_SPLIT 256 /* handle up to 256 &'s as matched text */ static STRING *split_buff[MAX_SPLIT]; static CELL * REPL_compile(STRING * sval) { VCount count = 0; register char *p = sval->str; register char *q; char *xbuff; CELL *cp; q = xbuff = (char *) zmalloc(sval->len + 1); while (1) { switch (*p) { case 0: *q = 0; goto done; case '\\': if (p[1] == '&' || p[1] == '\\') { *q++ = p[1]; p += 2; continue; } else break; case '&': /* if empty we don't need to make a node */ if (q != xbuff) { *q = 0; split_buff[count++] = new_STRING(xbuff); } /* and a null node for the '&' */ split_buff[count++] = (STRING *) 0; /* reset */ p++; q = xbuff; continue; default: break; } *q++ = *p++; } done: /* if we have one empty string it will get made now */ if (q > xbuff || count == 0) split_buff[count++] = new_STRING(xbuff); /* This will never happen */ if (count > MAX_SPLIT) overflow("replacement pieces", MAX_SPLIT); cp = ZMALLOC(CELL); if (count == 1 && split_buff[0]) { cp->type = C_REPL; cp->ptr = (PTR) split_buff[0]; USED_SPLIT_BUFF(0); } else { STRING **sp = (STRING **) (cp->ptr = zmalloc(sizeof(STRING *) * count)); VCount j = 0; while (j < count) { *sp++ = split_buff[j++]; USED_SPLIT_BUFF(j - 1); } cp->type = C_REPLV; cp->vcnt = count; } zfree(xbuff, sval->len + 1); return cp; } /* free memory used by a replacement CELL */ void repl_destroy(CELL *cp) { register STRING **p; VCount cnt; if (cp->type == C_REPL) { free_STRING(string(cp)); } else if (cp->ptr != 0) { /* an C_REPLV */ p = (STRING **) cp->ptr; for (cnt = cp->vcnt; cnt; cnt--) { if (*p) { free_STRING(*p); } p++; } zfree(cp->ptr, cp->vcnt * sizeof(STRING *)); } } /* copy a C_REPLV cell to another CELL */ CELL * replv_cpy(CELL *target, CELL *source) { STRING **t, **s; VCount cnt; target->type = C_REPLV; cnt = target->vcnt = source->vcnt; target->ptr = (PTR) zmalloc(cnt * sizeof(STRING *)); t = (STRING **) target->ptr; s = (STRING **) source->ptr; while (cnt) { cnt--; if (*s) (*s)->ref_cnt++; *t++ = *s++; } return target; } /* here's our old friend linked linear list with move to the front for compilation of replacement CELLs */ typedef struct repl_node { struct repl_node *link; STRING *sval; /* the input */ CELL *cp; /* the output */ } REPL_NODE; static REPL_NODE *repl_list; /* search the list (with move to the front) for a compiled separator. return a ptr to a CELL (C_REPL or C_REPLV) */ CELL * repl_compile(STRING * sval) { register REPL_NODE *p; REPL_NODE *q; char *s; /* search the list */ s = sval->str; p = repl_list; q = (REPL_NODE *) 0; while (p) { if (strcmp(s, p->sval->str) == 0) /* found */ { if (!q) /* already at front */ return p->cp; else { /* delete from list for move to front */ q->link = p->link; goto found; } } else { q = p; p = p->link; } } /* not found */ p = ZMALLOC(REPL_NODE); p->sval = sval; sval->ref_cnt++; p->cp = REPL_compile(sval); found: /* insert p at the front of the list */ p->link = repl_list; repl_list = p; return p->cp; } /* return the string for a CELL or type REPL or REPLV, this is only used by da() */ char * repl_uncompile(CELL *cp) { register REPL_NODE *p = repl_list; if (cp->type == C_REPL) { while (p) { if (p->cp->type == C_REPL && p->cp->ptr == cp->ptr) return p->sval->str; else p = p->link; } } else { while (p) { if (p->cp->type == C_REPLV && memcmp(cp->ptr, p->cp->ptr, cp->vcnt * sizeof(STRING *)) == 0) return p->sval->str; else p = p->link; } } #ifdef DEBUG bozo("unable to uncompile an repl"); #else return NULL; #endif } /* convert a C_REPLV to C_REPL replacing the &s with sval */ CELL * replv_to_repl(CELL *cp, STRING * sval) { register STRING **p; STRING **sblock = (STRING **) cp->ptr; unsigned cnt, vcnt = cp->vcnt; size_t len; char *target; #ifdef DEBUG if (cp->type != C_REPLV) bozo("not replv"); #endif p = sblock; cnt = vcnt; len = 0; while (cnt--) { if (*p) len += (*p++)->len; else { *p++ = sval; sval->ref_cnt++; len += sval->len; } } cp->type = C_REPL; cp->ptr = (PTR) new_STRING0(len); p = sblock; cnt = vcnt; target = string(cp)->str; while (cnt--) { memcpy(target, (*p)->str, (*p)->len); target += (*p)->len; free_STRING(*p); p++; } zfree(sblock, vcnt * sizeof(STRING *)); return cp; } #ifdef NO_LEAKS typedef struct _all_ptrs { struct _all_ptrs *next; PTR m; } ALL_PTRS; static ALL_PTRS *all_ptrs; /* * Some regular expressions are parsed, and the pointer stored in the byte-code * where we cannot distinguish it from other constants. Keep a list here, to * free on exit for auditing. */ void no_leaks_re_ptr(PTR m) { ALL_PTRS *p = calloc(1, sizeof(ALL_PTRS)); p->next = all_ptrs; p->m = m; all_ptrs = p; } void re_leaks(void) { while (all_ptrs != 0) { ALL_PTRS *next = all_ptrs->next; re_destroy(all_ptrs->m); free(all_ptrs); all_ptrs = next; } while (repl_list != 0) { REPL_NODE *p = repl_list->link; free_STRING(repl_list->sval); free_cell_data(repl_list->cp); ZFREE(repl_list); repl_list = p; } } #endif mawk-1.3.4-20200120/package/0000755000175100001440000000000013611306602013452 5ustar tomusersmawk-1.3.4-20200120/package/mawk.spec0000644000175100001440000000272613611306521015274 0ustar tomusersSummary: mawk - pattern scanning and text processing language %define AppProgram mawk %define AppVersion 1.3.4 %define AppRelease 20200120 # $MawkId: mawk.spec,v 1.69 2020/01/20 11:21:53 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: %{AppRelease} License: GPLv2 Group: Applications/Development URL: ftp://ftp.invisible-island.net/%{AppProgram} Source0: %{AppProgram}-%{AppVersion}-%{AppRelease}.tgz Packager: Thomas Dickey %description mawk is an interpreter for the AWK Programming Language. The AWK language is useful for manipulation of data files, text retrieval and processing, and for prototyping and experimenting with algorithms. %prep %define debug_package %{nil} %setup -q -n %{AppProgram}-%{AppVersion}-%{AppRelease} %build INSTALL_PROGRAM='${INSTALL}' \ %configure \ --target %{_target_platform} \ --prefix=%{_prefix} \ --bindir=%{_bindir} \ --libdir=%{_libdir} \ --mandir=%{_mandir} make %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT strip $RPM_BUILD_ROOT%{_bindir}/%{AppProgram} %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %{_prefix}/bin/%{AppProgram} %{_mandir}/man1/%{AppProgram}.* %changelog # each patch should add its ChangeLog entries here * Mon Jan 06 2020 Thomas Dickey - use hardening flags * Sat Oct 27 2012 Thomas Dickey - cancel any debug-rpm * Sun Jun 20 2010 Thomas Dickey - initial version mawk-1.3.4-20200120/package/debian/0000755000175100001440000000000013611306602014674 5ustar tomusersmawk-1.3.4-20200120/package/debian/postrm0000644000175100001440000000075512370544775016172 0ustar tomusers#! /bin/sh echo "** postrm script for mawk: $*" set -e ALT=mawk PKG=mawk-base ETCDIR=/etc/alternatives BINDIR=/usr/bin MANDIR=/usr/share/man/man1 if [ "x$1" = "xremove" ] then # update-alternatives --config mawk if [ -f $BINDIR/$PKG ] then rm -fv $ETCDIR/$ALT rm -fv $BINDIR/$ALT mv -fv $BINDIR/$PKG $BINDIR/$ALT fi if [ -f $MANDIR/$PKG.1.gz ] then rm -fv $ETCDIR/$ALT.1.gz rm -fv $MANDIR/$ALT.1.gz mv -fv $MANDIR/$PKG.1.gz $MANDIR/$ALT.1.gz fi fi #DEBHELPER# exit 0 mawk-1.3.4-20200120/package/debian/source/0000755000175100001440000000000012370244244016200 5ustar tomusersmawk-1.3.4-20200120/package/debian/source/format0000644000175100001440000000001412370244244017406 0ustar tomusers3.0 (quilt) mawk-1.3.4-20200120/package/debian/postinst0000644000175100001440000000051112370544621016505 0ustar tomusers#! /bin/sh echo "** postinst script for mawk: $*" set -e PRI=50 ALT=mawk PKG=mawk-cur BINDIR=/usr/bin MANDIR=/usr/share/man/man1 if [ $1 != "upgrade" ] then update-alternatives \ --install \ $BINDIR/$ALT $ALT \ $BINDIR/$PKG $PRI \ --slave $MANDIR/$ALT.1.gz $ALT.1.gz \ $MANDIR/$PKG.1.gz fi #DEBHELPER# exit 0 mawk-1.3.4-20200120/package/debian/control0000644000175100001440000000106411422127610016276 0ustar tomusersSource: mawk-cur Maintainer: Thomas E. Dickey Section: interpreters Priority: optional Standards-Version: 3.8.4 Build-Depends: debhelper (>= 5) Homepage: http://invisible-island.net/mawk/ Package: mawk-cur Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: pattern scanning and text processing language mawk is an interpreter for the AWK Programming Language. The AWK language is useful for manipulation of data files, text retrieval and processing, and for prototyping and experimenting with algorithms. mawk-1.3.4-20200120/package/debian/watch0000644000175100001440000000015213423734623015734 0ustar tomusersversion=3 opts=passive ftp://ftp.invisible-island.net/mawk/mawk-(\d.\d.\d)-(\d+)\.tgz \ debian uupdate mawk-1.3.4-20200120/package/debian/prerm0000644000175100001440000000024612370544537015762 0ustar tomusers#! /bin/sh echo "** prerm script for mawk: $*" set -e if [ "x$1" != "xupgrade" ]; then update-alternatives --remove mawk /usr/bin/mawk-cur fi #DEBHELPER# exit 0 mawk-1.3.4-20200120/package/debian/rules0000755000175100001440000000425213171336670015770 0ustar tomusers#!/usr/bin/make -f # MAde with the aid of dh_make, by Craig Small # Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. # Some lines taken from debmake, by Cristoph Lameter. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # These are used for cross-compiling and for saving the configure script # from having to guess our platform (since we know it already) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) CFLAGS = $(shell dpkg-buildflags --get CFLAGS) CXXFLAGS = $(shell dpkg-buildflags --get CXXFLAGS) CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS) LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS) ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif configure: configure-stamp configure-stamp: dh_testdir CFLAGS="$(CFLAGS)" \ CPPFLAGS="$(CPPFLAGS)" \ LDFLAGS="$(LDFLAGS)" ./configure \ --host=$(DEB_HOST_GNU_TYPE) \ --build=$(DEB_BUILD_GNU_TYPE) \ --program-suffix=-cur \ --prefix=/usr \ --mandir=\$${prefix}/share/man \ --sysconfdir=/etc touch configure-stamp build: build-stamp build-stamp: configure-stamp dh_testdir $(MAKE) touch build-stamp clean: dh_testdir dh_testroot [ ! -f Makefile ] || $(MAKE) clean rm -f configure-stamp build-stamp install-stamp \ config.cache config.h config.status config.log makefile rm -f *.o mawk dh_clean install: install-stamp install-stamp: build-stamp dh_testdir dh_testroot dh_clean -k dh_installdirs $(MAKE) install DESTDIR=$(CURDIR)/debian/mawk-cur touch install-stamp # Build architecture-independent files here. binary-indep: build install # No binary-indep target. # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot dh_installdocs dh_installexamples dh_installchangelogs CHANGES dh_strip dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install install-stamp mawk-1.3.4-20200120/package/debian/copyright0000644000175100001440000001177413423733075016652 0ustar tomusersUpstream source http://invisible-island.net/mawk/mawk.html Current maintainer: Thomas Dickey ------------------------------------------------------------------------------- mawk 1.3.4 and updates, Copyright 2008-2019 by Thomas E. Dickey mawk 1.3.4 includes substantial work by others: Copyright 2009-2010 by Jonathan Nieder Copyright 2005 by Aleksey Cheusov mawk 1.3.3 Nov 1996, Copyright (C) Michael D. Brennan Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ------------------------------------------------------------------------------- Files: aclocal.m4 Licence: other-BSD Copyright: 2008-2018,2019 by Thomas E. Dickey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, distribute with modifications, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name(s) of the above copyright holders shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization. Files: install-sh Copyright: 1994 X Consortium Licence: other-BSD Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other deal- ings in this Software without prior written authorization from the X Consor- tium. FSF changes to this file are in the public domain. Calling this script install-sh is preferred over install.sh, to prevent `make' implicit rules from creating a file called install from it when there is no Makefile. This script is compatible with the BSD install script, but was written from scratch. It can only install one file at a time, a restriction shared with many OS's install programs. Files: debian/* Copyright: 2012-2019 Thomas E. Dickey Licence: other-BSD Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. On Debian systems, the complete text of the GNU General Public License can be found in '/usr/share/common-licenses/GPL-2' mawk-1.3.4-20200120/package/debian/compat0000644000175100001440000000000211363402276016100 0ustar tomusers5 mawk-1.3.4-20200120/package/debian/docs0000644000175100001440000000001711410227237015546 0ustar tomusersACKNOWLEDGMENT mawk-1.3.4-20200120/package/debian/changelog0000644000175100001440000001172113611306602016550 0ustar tomusersmawk-cur (1.3.4-20200120) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Sun, 19 Jan 2020 20:39:59 -0500 mawk-cur (1.3.4-20200106) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Mon, 06 Jan 2020 04:38:20 -0500 mawk-cur (1.3.4-20191231) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Tue, 31 Dec 2019 13:58:22 -0500 mawk-cur (1.3.4-20190203) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Sun, 03 Feb 2019 17:12:28 -0400 mawk-cur (1.3.4-20190128) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Mon, 28 Jan 2019 21:06:36 -0500 mawk-cur (1.3.4-20181114) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Wed, 14 Nov 2018 19:35:11 -0500 mawk-cur (1.3.4-20171017) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Mon, 16 Oct 2017 20:39:56 -0400 mawk-cur (1.3.4-20161120) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Sun, 20 Nov 2016 19:24:02 -0500 mawk-cur (1.3.4-20161107) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Mon, 07 Nov 2016 16:36:53 -0500 mawk-cur (1.3.4-20160930) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Fri, 30 Sep 2016 13:10:38 -0400 mawk-cur (1.3.4-20160927) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Mon, 26 Sep 2016 21:00:51 -0400 mawk-cur (1.3.4-20160918) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Sun, 18 Sep 2016 11:50:44 -0400 mawk-cur (1.3.4-20160905) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Mon, 05 Sep 2016 09:36:11 -0400 mawk-cur (1.3.4-20160615) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Sun, 31 Jul 2016 20:41:40 -0400 mawk-cur (1.3.4-20160313) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Sun, 13 Mar 2016 10:23:10 -0400 mawk-cur (1.3.4-20160226) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Fri, 26 Feb 2016 16:34:13 -0500 mawk-cur (1.3.4-20150503) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Sat, 02 May 2015 07:49:51 -0400 mawk-cur (1.3.4-20141206) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Sat, 06 Dec 2014 19:32:21 -0500 mawk-cur (1.3.4-20141027) unstable; urgency=high * fix regression in gsub -- Thomas E. Dickey Mon, 27 Oct 2014 04:24:49 -0400 mawk-cur (1.3.4-20140914) unstable; urgency=low * improve gsub performance * improve field- and buffer-limits * configure-script updates * minor fixes -- Thomas E. Dickey Thu, 05 Jun 2014 19:03:20 -0400 mawk-cur (1.3.4-20131226) unstable; urgency=low * configure-script updates -- Thomas E. Dickey Thu, 26 Dec 2013 18:04:43 -0500 mawk-cur (1.3.4-20130803) unstable; urgency=low * miscellaneous bug-fixes -- Thomas E. Dickey Sat, 03 Aug 2013 09:29:37 -0400 mawk-cur (1.3.4-20130220) unstable; urgency=low * miscellaneous bug-fixes -- Thomas E. Dickey Tue, 19 Feb 2013 06:45:33 -0500 mawk-cur (1.3.4-20121209) unstable; urgency=low * fix regression with LC_NUMERIC feature -- Thomas E. Dickey Thu, 06 Dec 2012 05:23:52 -0500 mawk-cur (1.3.4-20121129) unstable; urgency=low * implement length(array) * make srand/rand more configurable * add strftime and related functions * fix bug in "/dev/stdin" change * improved configure script -- Thomas E. Dickey Fri, 26 Oct 2012 20:06:08 -0400 mawk-cur (1.3.4-20120901) unstable; urgency=low * add icons for webpage -- Thomas E. Dickey Sat, 01 Sep 2012 09:49:14 -0400 mawk-cur (1.3.4-20120627) unstable; urgency=low * implement 'nextfile' -- Thomas E. Dickey Wed, 27 Jun 2012 09:37:01 -0400 mawk-cur (1.3.4-20101210) unstable; urgency=low * update copyright notices -- Thomas E. Dickey Fri, 12 Dec 2010 04:37:19 -0400 mawk-cur (1.3.4-20101207) unstable; urgency=low * bug-fixes -- Thomas E. Dickey Sun, 18 Jul 2010 05:26:54 -0400 mawk-cur (1.3.4-20100625) unstable; urgency=low * Add package scripts to upstream source, for test-builds. -- Thomas E. Dickey Tue, 22 Jun 2010 04:27:28 -0400 mawk-1.3.4-20200120/package/debian/preinst0000644000175100001440000000064712370544563016325 0ustar tomusers#! /bin/sh echo "** preinst script for mawk: $*" set -e PRI=10 ALT=mawk PKG=mawk-base BINDIR=/usr/bin MANDIR=/usr/share/man/man1 if [ ! -f /usr/bin/mawk-base ] then mv -fv $BINDIR/$ALT $BINDIR/$PKG mv -fv $MANDIR/$ALT.1.gz $MANDIR/$PKG.1.gz fi update-alternatives \ --install \ $BINDIR/$ALT $ALT \ $BINDIR/$PKG $PRI \ --slave $MANDIR/$ALT.1.gz $ALT.1.gz \ $MANDIR/$PKG.1.gz #DEBHELPER# exit 0 mawk-1.3.4-20200120/execute.c0000644000175100001440000007247613373144701013712 0ustar tomusers/******************************************** execute.c copyright 2008-2017,2018, Thomas E. Dickey copyright 1991-1995,1996, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: execute.c,v 1.44 2018/11/15 01:20:01 tom Exp $ */ #include "mawk.h" #include "files.h" #include "code.h" #include "memory.h" #include "symtype.h" #include "field.h" #include "bi_funct.h" #include "bi_vars.h" #include "regexp.h" #include "repl.h" #include "fin.h" #include static int compare(CELL *); static UInt d_to_index(double); #ifdef NOINFO_SIGFPE static char dz_msg[] = "division by zero"; #define CHECK_DIVZERO(x) do { if ((x) == 0.0 ) rt_error(dz_msg); } while (0) #endif #define inc_sp() if ( ++sp == stack_danger) eval_overflow() #define dec_sp() if ( sp-- == (stack_base - 1)) eval_underflow() #define SAFETY 16 #define DANGER (EVAL_STACK_SIZE-SAFETY) /* The stack machine that executes the code */ CELL eval_stack[EVAL_STACK_SIZE]; /* these can move for deep recursion */ static CELL *stack_base = eval_stack; static CELL *stack_danger = eval_stack + DANGER; static void eval_overflow(void) { overflow("eval stack", EVAL_STACK_SIZE); } static void eval_underflow(void) { bozo("eval stack underflow"); } /* holds info for array loops (on a stack) */ typedef struct aloop_state { struct aloop_state *link; CELL *var; /* for(var in A) */ STRING **base; STRING **ptr; STRING **limit; } ALOOP_STATE; /* clean up aloop stack on next, return, exit */ #define CLEAR_ALOOP_STACK() \ do { \ if (aloop_state) { \ clear_aloop_stack(aloop_state); \ aloop_state = (ALOOP_STATE *) 0; \ } \ } while (0) static void clear_aloop_stack(ALOOP_STATE * top) { ALOOP_STATE *q; do { while (top->ptr < top->limit) { free_STRING(*top->ptr); top->ptr++; } if (top->base < top->limit) { zfree(top->base, (unsigned) (top->limit - top->base) * sizeof(STRING *)); } q = top; top = q->link; ZFREE(q); } while (top); } static INST *restart_label; /* control flow labels */ INST *next_label; static CELL tc; /*useful temp */ void execute(INST * cdp, /* code ptr, start execution here */ CELL *sp, /* eval_stack pointer */ CELL *fp) /* frame ptr into eval_stack for user defined functions */ { /* some useful temporaries */ CELL *cp; int t; unsigned tu; /* save state for array loops via a stack */ ALOOP_STATE *aloop_state = (ALOOP_STATE *) 0; /* for moving the eval stack on deep recursion */ CELL *old_stack_base = 0; CELL *old_sp = 0; #ifdef DEBUG CELL *entry_sp = sp; #endif if (fp) { /* we are a function call, check for deep recursion */ if (sp > stack_danger) { /* change stacks */ old_stack_base = stack_base; old_sp = sp; stack_base = (CELL *) zmalloc(sizeof(CELL) * EVAL_STACK_SIZE); stack_danger = stack_base + DANGER; sp = stack_base; /* waste 1 slot for ANSI, actually large model msdos breaks in RET if we don't */ #ifdef DEBUG entry_sp = sp; #endif } else old_stack_base = (CELL *) 0; } while (1) { TRACE(("execute %s sp(%ld:%s)\n", da_op_name(cdp), (long) (sp - stack_base), da_type_name(sp))); switch ((cdp++)->op) { /* HALT only used by the disassemble now ; this remains so compilers don't offset the jump table */ case _HALT: case _STOP: /* only for range patterns */ #ifdef DEBUG if (sp != entry_sp + 1) bozo("stop0"); #endif return; case _PUSHC: inc_sp(); cellcpy(sp, (cdp++)->ptr); break; case _PUSHD: inc_sp(); sp->type = C_DOUBLE; sp->dval = *(double *) (cdp++)->ptr; break; case _PUSHS: inc_sp(); sp->type = C_STRING; sp->ptr = (cdp++)->ptr; string(sp)->ref_cnt++; break; case F_PUSHA: cp = (CELL *) cdp->ptr; if (cp != field) { if (nf < 0) split_field0(); if (!(cp >= NF && cp <= LAST_PFIELD)) { /* it is a real field $1, $2 ... If it is greater than $NF, we have to make sure it is set to "" so that (++|--) and g?sub() work right */ t = field_addr_to_index(cp); if (t > nf) { cp->type = C_STRING; cp->ptr = (PTR) & null_str; null_str.ref_cnt++; } } } /* FALLTHRU */ case _PUSHA: case A_PUSHA: inc_sp(); sp->ptr = (cdp++)->ptr; break; case _PUSHI: /* put contents of next address on stack */ inc_sp(); cellcpy(sp, (cdp++)->ptr); break; case L_PUSHI: /* put the contents of a local var on stack, cdp->op holds the offset from the frame pointer */ inc_sp(); cellcpy(sp, fp + (cdp++)->op); break; case L_PUSHA: /* put a local address on eval stack */ inc_sp(); sp->ptr = (PTR) (fp + (cdp++)->op); break; case F_PUSHI: /* push contents of $i cdp[0] holds & $i , cdp[1] holds i */ inc_sp(); if (nf < 0) split_field0(); cp = (CELL *) cdp->ptr; t = (cdp + 1)->op; cdp += 2; if (t <= nf) cellcpy(sp, cp); else { /* an unset field */ sp->type = C_STRING; sp->ptr = (PTR) & null_str; null_str.ref_cnt++; } break; case NF_PUSHI: inc_sp(); if (nf < 0) split_field0(); cellcpy(sp, NF); break; case FE_PUSHA: if (sp->type != C_DOUBLE) cast1_to_d(sp); tu = d_to_index(sp->dval); if (tu && nf < 0) split_field0(); sp->ptr = (PTR) field_ptr((int) tu); if ((int) tu > nf) { /* make sure it is set to "" */ cp = (CELL *) sp->ptr; cell_destroy(cp); cp->type = C_STRING; cp->ptr = (PTR) & null_str; null_str.ref_cnt++; } break; case FE_PUSHI: if (sp->type != C_DOUBLE) cast1_to_d(sp); tu = d_to_index(sp->dval); if (nf < 0) split_field0(); if ((int) tu <= nf) { cellcpy(sp, field_ptr((int) tu)); } else { sp->type = C_STRING; sp->ptr = (PTR) & null_str; null_str.ref_cnt++; } break; case AE_PUSHA: /* top of stack has an expr, cdp->ptr points at an array, replace the expr with the cell address inside the array */ cp = array_find((ARRAY) (cdp++)->ptr, sp, CREATE); cell_destroy(sp); sp->ptr = (PTR) cp; break; case AE_PUSHI: /* top of stack has an expr, cdp->ptr points at an array, replace the expr with the contents of the cell inside the array */ cp = array_find((ARRAY) (cdp++)->ptr, sp, CREATE); cell_destroy(sp); cellcpy(sp, cp); break; case LAE_PUSHI: /* sp[0] is an expression cdp->op is offset from frame pointer of a CELL which has an ARRAY in the ptr field, replace expr with array[expr] */ if (fp != 0) { cp = array_find((ARRAY) fp[(cdp++)->op].ptr, sp, CREATE); cell_destroy(sp); cellcpy(sp, cp); } break; case LAE_PUSHA: /* sp[0] is an expression cdp->op is offset from frame pointer of a CELL which has an ARRAY in the ptr field, replace expr with & array[expr] */ if (fp != 0) { cp = array_find((ARRAY) fp[(cdp++)->op].ptr, sp, CREATE); cell_destroy(sp); sp->ptr = (PTR) cp; } break; case LA_PUSHA: /* cdp->op is offset from frame pointer of a CELL which has an ARRAY in the ptr field. Push this ARRAY on the eval stack */ if (fp != 0) { inc_sp(); sp->ptr = fp[(cdp++)->op].ptr; } break; case SET_ALOOP: { ALOOP_STATE *ap = ZMALLOC(ALOOP_STATE); size_t vector_size; ap->var = (CELL *) sp[-1].ptr; ap->base = ap->ptr = array_loop_vector((ARRAY) sp->ptr, &vector_size); ap->limit = ap->base + vector_size; sp -= 2; /* push onto aloop stack */ ap->link = aloop_state; aloop_state = ap; cdp += cdp->op; } break; case ALOOP: { ALOOP_STATE *ap = aloop_state; if (ap != 0 && (ap->ptr < ap->limit)) { cell_destroy(ap->var); ap->var->type = C_STRING; ap->var->ptr = (PTR) * ap->ptr++; cdp += cdp->op; } else { cdp++; } } break; case POP_AL: { /* finish up an array loop */ ALOOP_STATE *ap = aloop_state; if (ap != 0) { aloop_state = ap->link; while (ap->ptr < ap->limit) { free_STRING(*ap->ptr); ap->ptr++; } if (ap->base < ap->limit) { zfree(ap->base, ((unsigned) (ap->limit - ap->base) * sizeof(STRING *))); } ZFREE(ap); } } break; case _POP: cell_destroy(sp); dec_sp(); break; case _ASSIGN: /* top of stack has an expr, next down is an address, put the expression in *address and replace the address with the expression */ /* don't propagate type C_MBSTRN */ if (sp->type == C_MBSTRN) check_strnum(sp); dec_sp(); cell_destroy(((CELL *) sp->ptr)); cellcpy(sp, cellcpy(sp->ptr, sp + 1)); cell_destroy(sp + 1); break; case F_ASSIGN: /* assign to a field */ if (sp->type == C_MBSTRN) check_strnum(sp); dec_sp(); field_assign((CELL *) sp->ptr, sp + 1); cell_destroy(sp + 1); cellcpy(sp, (CELL *) sp->ptr); break; case _ADD_ASG: if (sp->type != C_DOUBLE) cast1_to_d(sp); cp = (CELL *) (sp - 1)->ptr; if (cp->type != C_DOUBLE) cast1_to_d(cp); #ifdef SW_FP_CHECK /* specific to V7 and XNX23A */ clrerr(); #endif cp->dval += sp->dval; dec_sp(); #ifdef SW_FP_CHECK fpcheck(); #endif sp->type = C_DOUBLE; sp->dval = cp->dval; break; case _SUB_ASG: if (sp->type != C_DOUBLE) cast1_to_d(sp); cp = (CELL *) (sp - 1)->ptr; if (cp->type != C_DOUBLE) cast1_to_d(cp); #ifdef SW_FP_CHECK clrerr(); #endif cp->dval -= sp->dval; dec_sp(); #ifdef SW_FP_CHECK fpcheck(); #endif sp->type = C_DOUBLE; sp->dval = cp->dval; break; case _MUL_ASG: if (sp->type != C_DOUBLE) cast1_to_d(sp); cp = (CELL *) (sp - 1)->ptr; if (cp->type != C_DOUBLE) cast1_to_d(cp); #ifdef SW_FP_CHECK clrerr(); #endif cp->dval *= sp->dval; dec_sp(); #ifdef SW_FP_CHECK fpcheck(); #endif sp->type = C_DOUBLE; sp->dval = cp->dval; break; case _DIV_ASG: if (sp->type != C_DOUBLE) cast1_to_d(sp); cp = (CELL *) (sp - 1)->ptr; if (cp->type != C_DOUBLE) cast1_to_d(cp); #ifdef NOINFO_SIGFPE CHECK_DIVZERO(sp->dval); #endif #ifdef SW_FP_CHECK clrerr(); #endif cp->dval /= sp->dval; dec_sp(); #ifdef SW_FP_CHECK fpcheck(); #endif sp->type = C_DOUBLE; sp->dval = cp->dval; break; case _MOD_ASG: if (sp->type != C_DOUBLE) cast1_to_d(sp); cp = (CELL *) (sp - 1)->ptr; if (cp->type != C_DOUBLE) cast1_to_d(cp); #ifdef NOINFO_SIGFPE CHECK_DIVZERO(sp->dval); #endif cp->dval = fmod(cp->dval, sp->dval); dec_sp(); sp->type = C_DOUBLE; sp->dval = cp->dval; break; case _POW_ASG: if (sp->type != C_DOUBLE) cast1_to_d(sp); cp = (CELL *) (sp - 1)->ptr; if (cp->type != C_DOUBLE) cast1_to_d(cp); cp->dval = pow(cp->dval, sp->dval); dec_sp(); sp->type = C_DOUBLE; sp->dval = cp->dval; break; /* will anyone ever use these ? */ case F_ADD_ASG: if (sp->type != C_DOUBLE) cast1_to_d(sp); cp = (CELL *) (sp - 1)->ptr; cast1_to_d(cellcpy(&tc, cp)); #ifdef SW_FP_CHECK clrerr(); #endif tc.dval += sp->dval; dec_sp(); #ifdef SW_FP_CHECK fpcheck(); #endif sp->type = C_DOUBLE; sp->dval = tc.dval; field_assign(cp, &tc); break; case F_SUB_ASG: if (sp->type != C_DOUBLE) cast1_to_d(sp); cp = (CELL *) (sp - 1)->ptr; cast1_to_d(cellcpy(&tc, cp)); #ifdef SW_FP_CHECK clrerr(); #endif tc.dval -= sp->dval; dec_sp(); #ifdef SW_FP_CHECK fpcheck(); #endif sp->type = C_DOUBLE; sp->dval = tc.dval; field_assign(cp, &tc); break; case F_MUL_ASG: if (sp->type != C_DOUBLE) cast1_to_d(sp); cp = (CELL *) (sp - 1)->ptr; cast1_to_d(cellcpy(&tc, cp)); #ifdef SW_FP_CHECK clrerr(); #endif tc.dval *= sp->dval; dec_sp(); #ifdef SW_FP_CHECK fpcheck(); #endif sp->type = C_DOUBLE; sp->dval = tc.dval; field_assign(cp, &tc); break; case F_DIV_ASG: if (sp->type != C_DOUBLE) cast1_to_d(sp); cp = (CELL *) (sp - 1)->ptr; cast1_to_d(cellcpy(&tc, cp)); #ifdef NOINFO_SIGFPE CHECK_DIVZERO(sp->dval); #endif #ifdef SW_FP_CHECK clrerr(); #endif tc.dval /= sp->dval; dec_sp(); #ifdef SW_FP_CHECK fpcheck(); #endif sp->type = C_DOUBLE; sp->dval = tc.dval; field_assign(cp, &tc); break; case F_MOD_ASG: if (sp->type != C_DOUBLE) cast1_to_d(sp); cp = (CELL *) (sp - 1)->ptr; cast1_to_d(cellcpy(&tc, cp)); #ifdef NOINFO_SIGFPE CHECK_DIVZERO(sp->dval); #endif tc.dval = fmod(tc.dval, sp->dval); dec_sp(); sp->type = C_DOUBLE; sp->dval = tc.dval; field_assign(cp, &tc); break; case F_POW_ASG: if (sp->type != C_DOUBLE) cast1_to_d(sp); cp = (CELL *) (sp - 1)->ptr; cast1_to_d(cellcpy(&tc, cp)); tc.dval = pow(tc.dval, sp->dval); dec_sp(); sp->type = C_DOUBLE; sp->dval = tc.dval; field_assign(cp, &tc); break; case _ADD: dec_sp(); if (TEST2(sp) != TWO_DOUBLES) cast2_to_d(sp); #ifdef SW_FP_CHECK clrerr(); #endif sp[0].dval += sp[1].dval; #ifdef SW_FP_CHECK fpcheck(); #endif break; case _SUB: dec_sp(); if (TEST2(sp) != TWO_DOUBLES) cast2_to_d(sp); #ifdef SW_FP_CHECK clrerr(); #endif sp[0].dval -= sp[1].dval; #ifdef SW_FP_CHECK fpcheck(); #endif break; case _MUL: dec_sp(); if (TEST2(sp) != TWO_DOUBLES) cast2_to_d(sp); #ifdef SW_FP_CHECK clrerr(); #endif sp[0].dval *= sp[1].dval; #ifdef SW_FP_CHECK fpcheck(); #endif break; case _DIV: dec_sp(); if (TEST2(sp) != TWO_DOUBLES) cast2_to_d(sp); #ifdef NOINFO_SIGFPE CHECK_DIVZERO(sp[1].dval); #endif #ifdef SW_FP_CHECK clrerr(); #endif sp[0].dval /= sp[1].dval; #ifdef SW_FP_CHECK fpcheck(); #endif break; case _MOD: dec_sp(); if (TEST2(sp) != TWO_DOUBLES) cast2_to_d(sp); #ifdef NOINFO_SIGFPE CHECK_DIVZERO(sp[1].dval); #endif sp[0].dval = fmod(sp[0].dval, sp[1].dval); break; case _POW: dec_sp(); if (TEST2(sp) != TWO_DOUBLES) cast2_to_d(sp); sp[0].dval = pow(sp[0].dval, sp[1].dval); break; case _NOT: /* evaluates to 0.0 or 1.0 */ reswitch_1: switch (sp->type) { case C_NOINIT: sp->dval = 1.0; break; case C_DOUBLE: sp->dval = sp->dval != 0.0 ? 0.0 : 1.0; break; case C_STRING: sp->dval = string(sp)->len ? 0.0 : 1.0; free_STRING(string(sp)); break; case C_STRNUM: /* test as a number */ sp->dval = sp->dval != 0.0 ? 0.0 : 1.0; free_STRING(string(sp)); break; case C_MBSTRN: check_strnum(sp); goto reswitch_1; default: bozo("bad type on eval stack"); } sp->type = C_DOUBLE; break; case _TEST: /* evaluates to 0.0 or 1.0 */ reswitch_2: switch (sp->type) { case C_NOINIT: sp->dval = 0.0; break; case C_DOUBLE: sp->dval = sp->dval != 0.0 ? 1.0 : 0.0; break; case C_STRING: sp->dval = string(sp)->len ? 1.0 : 0.0; free_STRING(string(sp)); break; case C_STRNUM: /* test as a number */ sp->dval = sp->dval != 0.0 ? 1.0 : 0.0; free_STRING(string(sp)); break; case C_MBSTRN: check_strnum(sp); goto reswitch_2; default: bozo("bad type on eval stack"); } sp->type = C_DOUBLE; break; case _UMINUS: if (sp->type != C_DOUBLE) cast1_to_d(sp); sp->dval = -sp->dval; break; case _UPLUS: if (sp->type != C_DOUBLE) cast1_to_d(sp); break; case _CAT: { size_t len1, len2; char *str1, *str2; STRING *b; dec_sp(); if (TEST2(sp) != TWO_STRINGS) cast2_to_s(sp); str1 = string(sp)->str; len1 = string(sp)->len; str2 = string(sp + 1)->str; len2 = string(sp + 1)->len; b = new_STRING0(len1 + len2); memcpy(b->str, str1, len1); memcpy(b->str + len1, str2, len2); free_STRING(string(sp)); free_STRING(string(sp + 1)); sp->ptr = (PTR) b; break; } case _PUSHINT: inc_sp(); sp->type = (short) (cdp++)->op; break; case _BUILTIN: case _PRINT: sp = (*(PF_CP) (cdp++)->ptr) (sp); break; case _POST_INC: cp = (CELL *) sp->ptr; if (cp->type != C_DOUBLE) cast1_to_d(cp); sp->type = C_DOUBLE; sp->dval = cp->dval; cp->dval += 1.0; break; case _POST_DEC: cp = (CELL *) sp->ptr; if (cp->type != C_DOUBLE) cast1_to_d(cp); sp->type = C_DOUBLE; sp->dval = cp->dval; cp->dval -= 1.0; break; case _PRE_INC: cp = (CELL *) sp->ptr; if (cp->type != C_DOUBLE) cast1_to_d(cp); sp->dval = cp->dval += 1.0; sp->type = C_DOUBLE; break; case _PRE_DEC: cp = (CELL *) sp->ptr; if (cp->type != C_DOUBLE) cast1_to_d(cp); sp->dval = cp->dval -= 1.0; sp->type = C_DOUBLE; break; case F_POST_INC: cp = (CELL *) sp->ptr; cellcpy(&tc, cp); cast1_to_d(&tc); sp->type = C_DOUBLE; sp->dval = tc.dval; tc.dval += 1.0; field_assign(cp, &tc); break; case F_POST_DEC: cp = (CELL *) sp->ptr; cellcpy(&tc, cp); cast1_to_d(&tc); sp->type = C_DOUBLE; sp->dval = tc.dval; tc.dval -= 1.0; field_assign(cp, &tc); break; case F_PRE_INC: cp = (CELL *) sp->ptr; cast1_to_d(cellcpy(sp, cp)); sp->dval += 1.0; field_assign(cp, sp); break; case F_PRE_DEC: cp = (CELL *) sp->ptr; cast1_to_d(cellcpy(sp, cp)); sp->dval -= 1.0; field_assign(cp, sp); break; case _JMP: cdp += cdp->op; break; case _JNZ: /* jmp if top of stack is non-zero and pop stack */ if (test(sp)) cdp += cdp->op; else cdp++; cell_destroy(sp); dec_sp(); break; case _JZ: /* jmp if top of stack is zero and pop stack */ if (!test(sp)) cdp += cdp->op; else cdp++; cell_destroy(sp); dec_sp(); break; case _LJZ: /* special jump for logical and */ /* this is always preceded by _TEST */ if (sp->dval == 0.0) { /* take jump, but don't pop stack */ cdp += cdp->op; } else { /* pop and don't jump */ dec_sp(); cdp++; } break; case _LJNZ: /* special jump for logical or */ /* this is always preceded by _TEST */ if (sp->dval != 0.0) { /* take jump, but don't pop stack */ cdp += cdp->op; } else { /* pop and don't jump */ dec_sp(); cdp++; } break; /* the relation operations */ /* compare() makes sure string ref counts are OK */ case _EQ: dec_sp(); t = compare(sp); sp->type = C_DOUBLE; sp->dval = t == 0 ? 1.0 : 0.0; break; case _NEQ: dec_sp(); t = compare(sp); sp->type = C_DOUBLE; sp->dval = t ? 1.0 : 0.0; break; case _LT: dec_sp(); t = compare(sp); sp->type = C_DOUBLE; sp->dval = t < 0 ? 1.0 : 0.0; break; case _LTE: dec_sp(); t = compare(sp); sp->type = C_DOUBLE; sp->dval = t <= 0 ? 1.0 : 0.0; break; case _GT: dec_sp(); t = compare(sp); sp->type = C_DOUBLE; sp->dval = t > 0 ? 1.0 : 0.0; break; case _GTE: dec_sp(); t = compare(sp); sp->type = C_DOUBLE; sp->dval = t >= 0 ? 1.0 : 0.0; break; case _MATCH0: /* does $0 match, the RE at cdp? */ inc_sp(); if (field->type >= C_STRING) { sp->type = C_DOUBLE; sp->dval = (REtest(string(field)->str, string(field)->len, cast_to_re((cdp++)->ptr)) ? 1.0 : 0.0); break /* the case */ ; } cellcpy(sp, field); /* FALLTHRU */ case _MATCH1: /* does expr at sp[0] match RE at cdp */ if (sp->type < C_STRING) cast1_to_s(sp); t = REtest(string(sp)->str, string(sp)->len, cast_to_re((cdp++)->ptr)); free_STRING(string(sp)); sp->type = C_DOUBLE; sp->dval = t ? 1.0 : 0.0; break; case _MATCH2: /* does sp[-1] match sp[0] as re */ cast_to_RE(sp); dec_sp(); if (sp->type < C_STRING) cast1_to_s(sp); t = REtest(string(sp)->str, string(sp)->len, cast_to_re((sp + 1)->ptr)); free_STRING(string(sp)); no_leaks_re_ptr((sp + 1)->ptr); sp->type = C_DOUBLE; sp->dval = t ? 1.0 : 0.0; break; case A_LENGTH: dec_sp(); sp->type = C_DOUBLE; sp->dval = (double) (((ARRAY) ((sp + 0)->ptr))->size); break; case A_TEST: /* entry : sp[0].ptr-> an array sp[-1] is an expression we compute (expression in array) */ dec_sp(); cp = array_find((sp + 1)->ptr, sp, NO_CREATE); cell_destroy(sp); sp->type = C_DOUBLE; sp->dval = (cp != (CELL *) 0) ? 1.0 : 0.0; break; case A_DEL: /* sp[0].ptr -> array sp[-1] is an expr delete array[expr] */ array_delete(sp->ptr, sp - 1); cell_destroy(sp - 1); sp -= 2; break; case DEL_A: /* free all the array at once */ array_clear(sp->ptr); dec_sp(); break; /* form a multiple array index */ case A_CAT: sp = array_cat(sp, (cdp++)->op); break; case _EXIT: if (sp->type != C_DOUBLE) cast1_to_d(sp); exit_code = d_to_i(sp->dval); dec_sp(); /* FALLTHRU */ case _EXIT0: if (!end_start) mawk_exit(exit_code); cdp = end_start; end_start = (INST *) 0; /* makes sure next exit exits */ if (begin_start) { free_codes("BEGIN", begin_start, begin_size); begin_start = 0; begin_size = 0; } if (main_start) { free_codes("MAIN", main_start, main_size); main_start = 0; main_size = 0; } sp = eval_stack - 1; /* might be in user function */ CLEAR_ALOOP_STACK(); /* ditto */ break; case _JMAIN: /* go from BEGIN code to MAIN code */ free_codes("BEGIN", begin_start, begin_size); begin_start = 0; begin_size = 0; cdp = main_start; break; case _OMAIN: if (!main_fin) open_main(); restart_label = cdp; cdp = next_label; break; case _NEXT: /* next might be inside an aloop -- clear stack */ CLEAR_ALOOP_STACK(); cdp = next_label; break; case _NEXTFILE: /* nextfile might be inside an aloop -- clear stack */ CLEAR_ALOOP_STACK(); FINsemi_close(main_fin); cdp = next_label; break; case OL_GL: { char *p; size_t len; if (!(p = FINgets(main_fin, &len))) { if (!end_start) mawk_exit(0); cdp = end_start; zfree(main_start, main_size); main_start = end_start = (INST *) 0; } else { set_field0(p, len); cdp = restart_label; rt_nr++; rt_fnr++; } } break; /* two kinds of OL_GL is a historical stupidity from working on a machine with very slow floating point emulation */ case OL_GL_NR: { char *p; size_t len; if (!(p = FINgets(main_fin, &len))) { if (!end_start) mawk_exit(0); cdp = end_start; zfree(main_start, main_size); main_start = end_start = (INST *) 0; } else { set_field0(p, len); cdp = restart_label; if (TEST2(NR) != TWO_DOUBLES) cast2_to_d(NR); NR->dval += 1.0; rt_nr++; FNR->dval += 1.0; rt_fnr++; } } break; case _RANGE: /* test a range pattern: pat1, pat2 { action } entry : cdp[0].op -- a flag, test pat1 if on else pat2 cdp[1].op -- offset of pat2 code from cdp cdp[2].op -- offset of action code from cdp cdp[3].op -- offset of code after the action from cdp cdp[4] -- start of pat1 code */ #define FLAG cdp[0].op #define PAT2 cdp[1].op #define ACTION cdp[2].op #define FOLLOW cdp[3].op #define PAT1 4 if (FLAG) /* test against pat1 */ { execute(cdp + PAT1, sp, fp); t = test(sp + 1); cell_destroy(sp + 1); if (t) FLAG = 0; else { cdp += FOLLOW; break; /* break the switch */ } } /* test against pat2 and then perform the action */ execute(cdp + PAT2, sp, fp); FLAG = test(sp + 1); cell_destroy(sp + 1); cdp += ACTION; break; /* function calls */ case _RET0: inc_sp(); sp->type = C_NOINIT; /* FALLTHRU */ case _RET: #ifdef DEBUG if (sp != entry_sp + 1) bozo("ret"); #endif if (old_stack_base) /* reset stack */ { /* move the return value */ cellcpy(old_sp + 1, sp); cell_destroy(sp); zfree(stack_base, sizeof(CELL) * EVAL_STACK_SIZE); stack_base = old_stack_base; stack_danger = old_stack_base + DANGER; } /* return might be inside an aloop -- clear stack */ CLEAR_ALOOP_STACK(); return; case _CALL: /* cdp[0] holds ptr to "function block" cdp[1] holds number of input arguments */ { FBLOCK *fbp = (FBLOCK *) (cdp++)->ptr; int a_args = (cdp++)->op; /* actual number of args */ CELL *nfp = sp - a_args + 1; /* new fp for callee */ CELL *local_p = sp + 1; /* first local argument on stack */ char *type_p = 0; /* pts to type of an argument */ if (fbp->nargs) type_p = fbp->typev + a_args - 1; /* create space for locals */ t = fbp->nargs - a_args; /* t is number of locals */ while (t > 0) { t--; inc_sp(); type_p++; sp->type = C_NOINIT; if ((type_p) != 0 && (*type_p == ST_LOCAL_ARRAY)) sp->ptr = (PTR) new_ARRAY(); } execute(fbp->code, sp, nfp); /* cleanup the callee's arguments */ /* putting return value at top of eval stack */ if ((type_p != 0) && (sp >= nfp)) { cp = sp + 1; /* cp -> the function return */ do { if (*type_p == ST_LOCAL_ARRAY) { if (sp >= local_p) { array_clear(sp->ptr); ZFREE((ARRAY) sp->ptr); } } else { cell_destroy(sp); } type_p--; dec_sp(); } while (sp >= nfp); inc_sp(); cellcpy(sp, cp); cell_destroy(cp); } else { inc_sp(); /* no arguments passed */ } } break; default: bozo("bad opcode"); } } } /* return 0 if a numeric is zero else return non-zero return 0 if a string is "" else return non-zero */ int test(CELL *cp) { reswitch: switch (cp->type) { case C_NOINIT: return 0; case C_STRNUM: /* test as a number */ case C_DOUBLE: return cp->dval != 0.0; case C_STRING: return (string(cp)->len != 0); case C_MBSTRN: check_strnum(cp); goto reswitch; default: bozo("bad cell type in call to test"); } return 0; /*can't get here: shutup */ } /* compare cells at cp and cp+1 and frees STRINGs at those cells */ static int compare(CELL *cp) { int result; size_t len; reswitch: result = 0; switch (TEST2(cp)) { case TWO_NOINITS: break; case TWO_DOUBLES: two_d: result = ((cp->dval > (cp + 1)->dval) ? 1 : ((cp->dval < (cp + 1)->dval) ? -1 : 0)); break; case TWO_STRINGS: case STRING_AND_STRNUM: two_s: len = string(cp)->len; if (len > string(cp + 1)->len) len = string(cp + 1)->len; result = memcmp(string(cp)->str, string(cp + 1)->str, len); if (result == 0) { if (len != string(cp)->len) { result = 1; } else if (len != string(cp + 1)->len) { result = -1; } } free_STRING(string(cp)); free_STRING(string(cp + 1)); break; case NOINIT_AND_DOUBLE: case NOINIT_AND_STRNUM: case DOUBLE_AND_STRNUM: case TWO_STRNUMS: cast2_to_d(cp); goto two_d; case NOINIT_AND_STRING: case DOUBLE_AND_STRING: cast2_to_s(cp); goto two_s; case TWO_MBSTRNS: check_strnum(cp); check_strnum(cp + 1); goto reswitch; case NOINIT_AND_MBSTRN: case DOUBLE_AND_MBSTRN: case STRING_AND_MBSTRN: case STRNUM_AND_MBSTRN: check_strnum(cp->type == C_MBSTRN ? cp : cp + 1); goto reswitch; default: /* there are no default cases */ bozo("bad cell type passed to compare"); break; } return result; } /* does not assume target was a cell, if so then caller should have made a previous call to cell_destroy */ CELL * cellcpy(CELL *target, CELL *source) { switch (target->type = source->type) { case C_NOINIT: case C_SPACE: case C_SNULL: break; case C_DOUBLE: target->dval = source->dval; break; case C_STRNUM: target->dval = source->dval; /* FALLTHRU */ case C_REPL: case C_MBSTRN: case C_STRING: string(source)->ref_cnt++; /* FALLTHRU */ case C_RE: target->ptr = source->ptr; break; case C_REPLV: replv_cpy(target, source); break; default: bozo("bad cell passed to cellcpy()"); break; } return target; } #ifdef DEBUG void DB_cell_destroy(CELL *cp) { switch (cp->type) { case C_NOINIT: case C_DOUBLE: break; case C_MBSTRN: case C_STRING: case C_STRNUM: free_STRING(string(cp)); break; case C_RE: bozo("cell destroy called on RE cell"); default: bozo("cell destroy called on bad cell type"); } } #endif /* * convert a double d to a field index $d -> $i * * Note: this used to return (unsigned) d_to_I(d), but is done inline to * aid static analysis. */ static UInt d_to_index(double d) { if (d >= Max_Int) { return (UInt) Max_Int; } else if (d >= 0.0) { return (UInt) (Int) (d); } else { /* might include nan */ rt_error("negative field index $%.6g", d); return 0; /* shutup */ } } mawk-1.3.4-20200120/field.c0000644000175100001440000003673613611311516013325 0ustar tomusers/******************************************** field.c copyright 2008-2016,2020 Thomas E. Dickey copyright 1991-1995,2014 Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: field.c,v 1.36 2020/01/20 11:47:26 tom Exp $ */ /* field.c */ #include "mawk.h" #include "split.h" #include "field.h" #include "init.h" #include "memory.h" #include "scan.h" #include "bi_vars.h" #include "repl.h" #include "regexp.h" /* initial fields and pseudo fields, most programs only need these */ CELL field[FBANK_SZ + NUM_PFIELDS]; /* hold banks of more fields if needed */ CELL **fbankv; /* fbankv grows in chunks */ #define FBANKV_CHUNK_SIZE 1024 static size_t fbankv_num_chunks; /* make fbankv big enough to hold field CELL $i is called with i==0 during initialization This does not create field CELL $i, it just makes fbankv big enough to hold the fbank that will hold $i */ static void allocate_fbankv(int i) { if (i == 0) { size_t sz = FBANKV_CHUNK_SIZE * sizeof(CELL *); fbankv_num_chunks = 1; fbankv = (CELL **) zmalloc(sz); memset(fbankv, 0, sz); fbankv[0] = field; } else { size_t u = (size_t) i + 1; size_t chunks = (u / (FBANK_SZ * FBANKV_CHUNK_SIZE)) + 1; if (chunks > fbankv_num_chunks) { size_t old_size = fbankv_num_chunks * FBANKV_CHUNK_SIZE; size_t new_size = chunks * FBANKV_CHUNK_SIZE; fbankv = zrealloc(fbankv, old_size * sizeof(CELL *), new_size * sizeof(CELL *)); memset(&fbankv[old_size], 0, (new_size - old_size) * sizeof(CELL *)); fbankv_num_chunks = chunks; } } } /* max_field created i.e. $max_field exists as new fields are created max_field grows */ static int max_field = FBANK_SZ - 1; /* The fields $0, $1, ... $max_field are always valid, the value of nf (below) does not affect validity of the allocated fields. When a new $0 is read, nf is set to -1 to indicate $0 has not been split, field[1], field[2] ... field[3] (actually fbankv[i/1024][i%1024]) are unchanged. So any time a field is assigned or changed, it has to be cell_destroyed first and this is the only way a field gets cell_destroyed. */ static void build_field0(void); /* a description of how to split based on RS. If RS is changed, so is rs_shadow */ SEPARATOR rs_shadow = { SEP_CHAR, '\n', NULL }; /* a splitting CELL version of FS */ CELL fs_shadow = { C_SPACE, 0, 0, 0.0 }; int nf; /* nf holds the true value of NF. If nf < 0 , then NF has not been computed, i.e., $0 has not been split */ static void set_rs_shadow(void) { CELL c; STRING *sval; char *s; SLen len; if (posix_space_flag && mawk_state == EXECUTION) scan_code['\n'] = SC_UNEXPECTED; if (rs_shadow.type == SEP_STR) { free_STRING((STRING *) rs_shadow.ptr); } cast_for_split(cellcpy(&c, RS)); switch (c.type) { case C_RE: if ((s = is_string_split(c.ptr, &len))) { if (len == 1) { rs_shadow.type = SEP_CHAR; rs_shadow.c = s[0]; } else { rs_shadow.type = SEP_STR; rs_shadow.ptr = (PTR) new_STRING(s); } } else { rs_shadow.type = SEP_RE; rs_shadow.ptr = c.ptr; } break; case C_SPACE: rs_shadow.type = SEP_CHAR; rs_shadow.c = ' '; break; case C_SNULL: /* RS becomes one or more blank lines */ if (mawk_state == EXECUTION) scan_code['\n'] = SC_SPACE; rs_shadow.type = SEP_MLR; sval = new_STRING("\n\n+"); rs_shadow.ptr = re_compile(sval); free_STRING(sval); break; case C_STRING: /* * Check for special case where we retained the cell as a string, * bypassing regular-expression compiling. */ if (string(&c)->len == 1) { rs_shadow.type = SEP_CHAR; rs_shadow.c = string(&c)->str[0]; break; } /* FALLTHRU */ default: bozo("bad cell in set_rs_shadow"); } } static void load_pfield(const char *name, CELL *cp) { SYMTAB *stp; stp = insert(name); stp->type = ST_FIELD; stp->stval.cp = cp; } /* initialize $0 and the pseudo fields */ void field_init(void) { allocate_fbankv(0); field[0].type = C_STRING; field[0].ptr = (PTR) & null_str; null_str.ref_cnt++; load_pfield("NF", NF); NF->type = C_DOUBLE; NF->dval = 0.0; load_pfield("RS", RS); RS->type = C_STRING; RS->ptr = (PTR) new_STRING("\n"); /* rs_shadow already set */ load_pfield("FS", FS); FS->type = C_STRING; FS->ptr = (PTR) new_STRING(" "); /* fs_shadow is already set */ load_pfield("OFMT", OFMT); OFMT->type = C_STRING; OFMT->ptr = (PTR) new_STRING("%.6g"); load_pfield("CONVFMT", CONVFMT); CONVFMT->type = C_STRING; CONVFMT->ptr = OFMT->ptr; string(OFMT)->ref_cnt++; } void set_field0(char *s, size_t len) { cell_destroy(&field[0]); nf = -1; if (len) { field[0].type = C_MBSTRN; field[0].ptr = (PTR) new_STRING0(len); memcpy(string(&field[0])->str, s, len); } else { field[0].type = C_STRING; field[0].ptr = (PTR) & null_str; null_str.ref_cnt++; } } /* split field[0] into $1, $2 ... and set NF * * Note the current values are valid CELLS and * have to be destroyed when the new values are loaded. */ void split_field0(void) { CELL *cp0; size_t cnt = 0; CELL hold0; /* copy field[0] here if not string */ if (field[0].type < C_STRING) { cast1_to_s(cellcpy(&hold0, field + 0)); cp0 = &hold0; } else { cp0 = &field[0]; } if (string(cp0)->len > 0) { switch (fs_shadow.type) { case C_SNULL: /* FS == "" */ cnt = null_split(string(cp0)->str, string(cp0)->len); break; case C_SPACE: cnt = space_split(string(cp0)->str, string(cp0)->len); break; default: cnt = re_split(string(cp0)->str, string(cp0)->len, fs_shadow.ptr); break; } } /* the above xxx_split() function put the fields in an anonyous * buffer that will be pulled into the fields with a transfer call */ /* we are done with cp0 */ if (cp0 == &hold0) free_STRING(string(cp0)); nf = (int) cnt; cell_destroy(NF); NF->type = C_DOUBLE; NF->dval = (double) nf; if (nf > max_field) slow_field_ptr(nf); /* fields 1 .. nf are created and valid */ /* retrieves the result of xxx_split() */ if (cnt > 0) { transfer_to_fields(cnt); } } static void invalid_format(CELL *fp) { const char *what = (fp == CONVFMT) ? "CONVFMT" : "OFMT"; const char *format = string(fp)->str; rt_error("illegal format assigned to %s: %s", what, format); } /* * We expect only one field, using the same format choices as in do_printf(). */ static int valid_format(CELL *fp) { int result = 1; char *format = string(fp)->str; char *q = format; int args = 0; while (*q != '\0') { if (*q++ == '%') { int l_flag = 0; int h_flag = 0; if (++args > 1) invalid_format(fp); while (*q == '-' || *q == '+' || *q == ' ' || *q == '#' || *q == '0' || *q == '\'') { q++; } if (*q == '*') { invalid_format(fp); } else { while (scan_code[*(unsigned char *) q] == SC_DIGIT) { q++; } } if (*q == '.') { /* have precision */ q++; if (*q == '*') { invalid_format(fp); } else { while (scan_code[*(unsigned char *) q] == SC_DIGIT) { q++; } } } if (*q == 'l') { q++; } else if (*q == 'h') { q++; } switch (*q++) { case 's': if (l_flag + h_flag) invalid_format(fp); break; case 'c': if (l_flag + h_flag) invalid_format(fp); break; case 'd': case 'i': break; case 'o': case 'x': case 'X': case 'u': break; case 'e': case 'g': case 'f': case 'E': case 'G': if (h_flag + l_flag) invalid_format(fp); break; default: invalid_format(fp); } } } return result; } /* assign CELL *cp to field or pseudo field and take care of all side effects */ void field_assign(CELL *fp, CELL *cp) { CELL c; int i, j; /* the most common case first */ if (fp == field) { cell_destroy(field); cellcpy(fp, cp); nf = -1; return; } /* its not important to do any of this fast */ if (nf < 0) split_field0(); switch (i = (int) (fp - field)) { case NF_field: cell_destroy(NF); cellcpy(NF, cellcpy(&c, cp)); if (c.type != C_DOUBLE) cast1_to_d(&c); if ((j = d_to_i(c.dval)) < 0) rt_error("negative value assigned to NF"); if (j > nf) for (i = nf + 1; i <= j; i++) { cp = field_ptr(i); cell_destroy(cp); cp->type = C_STRING; cp->ptr = (PTR) & null_str; null_str.ref_cnt++; } nf = j; build_field0(); break; case RS_field: cell_destroy(RS); cellcpy(RS, cp); set_rs_shadow(); break; case FS_field: cell_destroy(FS); cast_for_split(cellcpy(&fs_shadow, cellcpy(FS, cp))); break; case OFMT_field: case CONVFMT_field: /* If the user does something stupid with OFMT or CONVFMT, we could crash. We'll make an attempt to protect ourselves here. This is why OFMT and CONVFMT are pseudo fields. The ptrs of OFMT and CONVFMT always have a valid STRING, even if assigned a DOUBLE or NOINIT */ free_STRING(string(fp)); cellcpy(fp, cp); if (fp->type < C_STRING) { /* !! */ fp->ptr = (PTR) new_STRING("%.6g"); } else if (valid_format(fp)) { if (fp == CONVFMT) { /* It's a string, but if it's really goofy and CONVFMT, it could still damage us. Test it . */ char xbuff[512]; xbuff[256] = 0; sprintf(xbuff, string(fp)->str, 3.1459); if (xbuff[256]) rt_error("CONVFMT assigned unusable value"); } } break; #ifdef MSDOS lm_dos_label: #endif default: /* $1 or $2 or ... */ cell_destroy(fp); cellcpy(fp, cp); if (i < 0 || i >= FBANK_SZ) { /* field assigned to was not in field[0..FBANK_SZ-1] * or a pseudo field, so compute actual field index */ i = field_addr_to_index(fp); } if (i > nf) { for (j = nf + 1; j < i; j++) { cp = field_ptr(j); cell_destroy(cp); cp->type = C_STRING; cp->ptr = (PTR) & null_str; null_str.ref_cnt++; } nf = i; cell_destroy(NF); NF->type = C_DOUBLE; NF->dval = (double) i; } build_field0(); } } /* construct field[0] from the other fields */ static void build_field0(void) { #ifdef DEBUG if (nf < 0) bozo("nf <0 in build_field0"); #endif cell_destroy(field + 0); if (nf == 0) { field[0].type = C_STRING; field[0].ptr = (PTR) & null_str; null_str.ref_cnt++; } else if (nf == 1) { cellcpy(field, field + 1); } else { CELL c; STRING *ofs, *tail; size_t len; register CELL *cp; register char *p, *q; int cnt; CELL **fbp, *cp_limit; cast1_to_s(cellcpy(&c, OFS)); ofs = (STRING *) c.ptr; cast1_to_s(cellcpy(&c, field_ptr(nf))); tail = (STRING *) c.ptr; cnt = nf - 1; len = ((size_t) cnt) * ofs->len + tail->len; fbp = fbankv; cp_limit = field + FBANK_SZ; cp = field + 1; while (cnt-- > 0) { if (cp->type < C_STRING) { /* use the string field temporarily */ if (cp->type == C_NOINIT) { cp->ptr = (PTR) & null_str; null_str.ref_cnt++; } else { /* its a double */ Int ival; char xbuff[260]; ival = d_to_I(cp->dval); if (ival == cp->dval) sprintf(xbuff, INT_FMT, ival); else sprintf(xbuff, string(CONVFMT)->str, cp->dval); cp->ptr = (PTR) new_STRING(xbuff); } } len += string(cp)->len; if (++cp == cp_limit) { cp = *++fbp; cp_limit = cp + FBANK_SZ; } } field[0].type = C_STRING; field[0].ptr = (PTR) new_STRING0(len); p = string(field)->str; /* walk it again , putting things together */ cnt = nf - 1; fbp = fbankv; cp = field + 1; cp_limit = field + FBANK_SZ; while (cnt-- > 0) { memcpy(p, string(cp)->str, string(cp)->len); p += string(cp)->len; /* if not really string, free temp use of ptr */ if (cp->type < C_STRING) { free_STRING(string(cp)); } if (++cp == cp_limit) { cp = *++fbp; cp_limit = cp + FBANK_SZ; } /* add the separator */ q = ofs->str; while (*q) *p++ = *q++; } /* tack tail on the end */ memcpy(p, tail->str, tail->len); /* cleanup */ if (tail == ofs) { free_STRING(tail); } else { free_STRING(tail); free_STRING(ofs); } } } /* We are assigning to a CELL and we aren't sure if its a field */ void slow_cell_assign(CELL *target, CELL *source) { if (field <= target && target <= LAST_PFIELD) { field_assign(target, source); } else { size_t i; for (i = 1; i < fbankv_num_chunks * FBANKV_CHUNK_SIZE; i++) { CELL *bank_start = fbankv[i]; CELL *bank_end = bank_start + FBANK_SZ; if (bank_start == 0) break; if (bank_start <= target && target < bank_end) { /* it is a field */ field_assign(target, source); return; } } /* its not a field */ cell_destroy(target); cellcpy(target, source); } } int field_addr_to_index(CELL *cp) { CELL **p = fbankv; while (cp < *p || cp >= *p + FBANK_SZ) p++; return (int) (((p - fbankv) << FB_SHIFT) + (cp - *p)); } /*------- more than 1 fbank needed ------------*/ /* compute the address of a field $i if CELL $i doesn't exist, because it is bigger than max_field, then it gets created and max_field grows. */ CELL * slow_field_ptr(int i) { if (i > max_field) { /* need to allocate more field memory */ int j; allocate_fbankv(i); j = (max_field >> FB_SHIFT) + 1; assert(j > 0 && fbankv[j - 1] != 0 && fbankv[j] == 0); do { fbankv[j] = (CELL *) zmalloc(sizeof(CELL) * FBANK_SZ); memset(fbankv[j], 0, sizeof(CELL) * FBANK_SZ); j++; max_field += FBANK_SZ; } while (i > max_field); } return &fbankv[i >> FB_SHIFT][i & (FBANK_SZ - 1)]; } #if USE_BINMODE /* read current value of BINMODE */ int binmode(void) { CELL c; cast1_to_d(cellcpy(&c, BINMODE)); return d_to_i(c.dval); } /* set BINMODE and RS and ORS from environment or -W binmode= */ void set_binmode(int x) { CELL c; int change = ((x & 4) == 0); /* set RS */ c.type = C_STRING; c.ptr = (PTR) new_STRING((change && (x & 1)) ? "\r\n" : "\n"); field_assign(RS, &c); free_STRING(string(&c)); /* set ORS */ cell_destroy(ORS); ORS->type = C_STRING; ORS->ptr = (PTR) new_STRING((change && (x & 2)) ? "\r\n" : "\n"); cell_destroy(BINMODE); BINMODE->type = C_DOUBLE; BINMODE->dval = (double) x; } #endif /* USE_BINMODE */ #ifdef NO_LEAKS static void fbank_free(CELL *const fb) { CELL *end = fb + FBANK_SZ; CELL *cp; for (cp = fb; cp < end; cp++) { cell_destroy(cp); } zfree(fb, FBANK_SZ * sizeof(CELL)); } static void fbankv_free(void) { unsigned i = 1; const size_t cnt = FBANKV_CHUNK_SIZE * fbankv_num_chunks; while (i < cnt && fbankv[i] != 0) { fbank_free(fbankv[i]); i++; } for (; i < cnt; i++) { if (fbankv[i] != 0) { bozo("unexpected pointer in fbankv[]"); } } zfree(fbankv, cnt * sizeof(CELL *)); } void field_leaks(void) { int n; /* everything in field[] */ for (n = 0; n < FBANK_SZ + NUM_PFIELDS; n++) { cell_destroy(&field[n]); } /* fbankv[0] == field this call does all the rest of the fields */ fbankv_free(); switch (fs_shadow.type) { case C_RE: re_destroy(fs_shadow.ptr); break; case C_STRING: case C_STRNUM: case C_MBSTRN: cell_destroy(&fs_shadow); break; default: break; } switch (rs_shadow.type) { case SEP_STR: free_STRING(((STRING *) (&rs_shadow.ptr))); break; case SEP_RE: re_destroy(rs_shadow.ptr); break; } } #endif mawk-1.3.4-20200120/bi_vars.h0000644000175100001440000000250011500456220013647 0ustar tomusers/******************************************** bi_vars.h copyright 2010, Thomas E. Dickey copyright 1993, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: bi_vars.h,v 1.8 2010/12/10 17:00:00 tom Exp $ * @Log: bi_vars.h,v @ * Revision 1.1.1.1 1993/07/03 18:58:09 mike * move source to cvs * * Revision 5.2 1992/07/10 16:17:10 brennan * MsDOS: remove NO_BINMODE macro * * Revision 5.1 1991/12/05 07:59:05 brennan * 1.1 pre-release * */ /* bi_vars.h */ #ifndef BI_VARS_H #define BI_VARS_H 1 #include "types.h" /* builtin variables NF, RS, FS, OFMT are stored internally in field[], so side effects of assignment can be handled */ /* NR and FNR must be next to each other */ #define NR bi_vars #define FNR (bi_vars+1) #define ARGC (bi_vars+2) #define FILENAME (bi_vars+3) #define OFS (bi_vars+4) #define ORS (bi_vars+5) #define RLENGTH (bi_vars+6) #define RSTART (bi_vars+7) #define SUBSEP (bi_vars+8) #if USE_BINMODE #define BINMODE (bi_vars+9) #define NUM_BI_VAR 10 #else #define NUM_BI_VAR 9 #endif extern CELL bi_vars[NUM_BI_VAR]; #endif mawk-1.3.4-20200120/fin.c0000644000175100001440000003173513611204316013007 0ustar tomusers/******************************************** fin.c copyright 2008-2018,2020. Thomas E. Dickey copyright 1991-1995,1996. Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: fin.c,v 1.47 2020/01/20 01:56:30 tom Exp $ */ /* fin.c */ #include "mawk.h" #include "fin.h" #include "memory.h" #include "bi_vars.h" #include "field.h" #include "symtype.h" #include "scan.h" #ifdef HAVE_FCNTL_H #include #endif /* This file handles input files. Opening, closing, buffering and (most important) splitting files into records, FINgets(). */ static FIN *next_main(int); static char *enlarge_fin_buffer(FIN *); int is_cmdline_assign(char *); /* also used by init */ /* this is how we mark EOF on main_fin */ static char dead_buff = 0; static FIN dead_main = {0, (FILE *) 0, &dead_buff, &dead_buff, &dead_buff, 1, EOF_FLAG}; static void free_fin_data(FIN * fin) { if (fin != &dead_main) { zfree(fin->buff, (size_t) (fin->nbuffs * BUFFSZ + 1)); ZFREE(fin); } } /* convert file-descriptor to FIN*. It's the main stream if main_flag is set */ FIN * FINdopen(int fd, int main_flag) { FIN *fin = ZMALLOC(FIN); fin->fd = fd; fin->flags = main_flag ? (MAIN_FLAG | START_FLAG) : START_FLAG; fin->buffp = fin->buff = (char *) zmalloc((size_t) BUFFSZ + 1); fin->limit = fin->buffp; fin->nbuffs = 1; fin->buff[0] = 0; if ((isatty(fd) && rs_shadow.type == SEP_CHAR && rs_shadow.c == '\n') || interactive_flag) { /* interactive, i.e., line buffer this file */ if (fd == 0) { fin->fp = stdin; } else if (!(fin->fp = fdopen(fd, "r"))) { errmsg(errno, "fdopen failed"); free_fin_data(fin); mawk_exit(2); } } else { fin->fp = (FILE *) 0; } return fin; } /* open a FIN* by filename. It's the main stream if main_flag is set. Recognizes "-" as stdin. */ FIN * FINopen(char *filename, int main_flag) { FIN *result = 0; int fd; int oflag = O_RDONLY; #if USE_BINMODE int bm = binmode() & 1; if (bm) oflag |= O_BINARY; #endif TRACE(("FINopen(%s)\n", filename)); if ((filename[0] == '-' && filename[1] == 0) || (filename[0] == '/' && !strcmp(filename, "/dev/stdin"))) { #if USE_BINMODE if (bm) setmode(0, O_BINARY); #endif result = FINdopen(0, main_flag); } else if ((fd = open(filename, oflag, 0)) != -1) { result = FINdopen(fd, main_flag); } return result; } /* frees the buffer and fd, but leaves FIN structure until the user calls close() */ void FINsemi_close(FIN * fin) { static char dead = 0; if (fin->buff != &dead) { zfree(fin->buff, (size_t) (fin->nbuffs * BUFFSZ + 1)); if (fin->fd) { if (fin->fp) fclose(fin->fp); else close(fin->fd); } fin->flags |= EOF_FLAG; fin->limit = fin->buff = fin->buffp = &dead; /* marks it semi_closed */ } /* else was already semi_closed */ } /* user called close() on input file */ void FINclose(FIN * fin) { FINsemi_close(fin); ZFREE(fin); } /* return one input record as determined by RS, from input file (FIN) fin */ char * FINgets(FIN * fin, size_t *len_p) { char *p; char *q = 0; size_t match_len; size_t r; restart: if ((p = fin->buffp) >= fin->limit) { /* need a refill */ if (fin->flags & EOF_FLAG) { if (fin->flags & MAIN_FLAG) { fin = next_main(0); goto restart; } else { *len_p = 0; return (char *) 0; } } if (fin->fp) { int have_nl = 0; int got_any = 0; char *my_buff = fin->buff; do { /* line buffering */ if (!fgets(my_buff, BUFFSZ + 1, fin->fp)) { if (got_any) { /* no newline, but we have data -- okay */ break; } fin->flags |= EOF_FLAG; fin->buff[0] = 0; fin->buffp = fin->buff; fin->limit = fin->buffp; goto restart; /* might be main_fin */ } else { /* return this line */ /* * Using fgets, we cannot detect embedded nulls in the * input. Assume that a null is the one added by fgets * after reading data. If we have a newline, that is * better, since fgets has the complete line. */ p = my_buff; while (*p != '\n' && *p != 0) p++; if (*p == '\n') { have_nl = 1; *p = 0; } else { /* * Increase the buffer size to allow reading more data, * and point 'my_buff' to the beginning of the extra * space. Doing it this way assumes very-long lines * are rare. */ size_t old_size = (size_t) (fin->nbuffs++ * BUFFSZ + 1); size_t new_size = old_size + BUFFSZ; char *new_buff = (char *) zmalloc(new_size); size_t my_size = (size_t) (p - fin->buff); if (new_buff != fin->buff) { memcpy(new_buff, fin->buff, my_size); zfree(fin->buff, old_size); fin->buff = new_buff; } my_buff = my_size + fin->buff; p = my_buff; got_any = 1; } } } while (!have_nl); /* * At this point, 'p' points to the terminating null for the * input line. Fill in the FIN structure details. */ *len_p = (size_t) (p - fin->buff); fin->buffp = p; fin->limit = fin->buffp + strlen(fin->buffp); return fin->buff; } else { /* block buffering */ r = fillbuff(fin->fd, fin->buff, (size_t) (fin->nbuffs * BUFFSZ)); if (r == 0) { fin->flags |= EOF_FLAG; fin->buffp = fin->buff; fin->limit = fin->buffp; goto restart; /* might be main */ } else if (r < fin->nbuffs * BUFFSZ) { fin->flags |= EOF_FLAG; } fin->limit = fin->buff + r; p = fin->buffp = fin->buff; if (fin->flags & START_FLAG) { fin->flags &= ~START_FLAG; if (rs_shadow.type == SEP_MLR) { /* trim blank lines from front of file */ while (*p == '\n') p++; fin->buffp = p; if (p >= fin->limit) goto restart; } } } } retry: switch (rs_shadow.type) { case SEP_CHAR: q = memchr(p, rs_shadow.c, (size_t) (fin->limit - p)); match_len = 1; break; case SEP_STR: q = str_str(p, (size_t) (fin->limit - p), ((STRING *) rs_shadow.ptr)->str, match_len = ((STRING *) rs_shadow.ptr)->len); break; case SEP_MLR: case SEP_RE: q = re_pos_match(p, (size_t) (fin->limit - p), rs_shadow.ptr, &match_len, (p != fin->buff) || (fin->flags & FIN_FLAG)); /* if the match is at the end, there might still be more to match in the file */ if (q && q[match_len] == 0 && !(fin->flags & EOF_FLAG)) { TRACE(("re_pos_match cancelled\n")); q = (char *) 0; } break; default: bozo("type of rs_shadow"); } if (q) { /* the easy and normal case */ *q = 0; *len_p = (unsigned) (q - p); fin->buffp = q + match_len; return p; } if (fin->flags & EOF_FLAG) { /* last line without a record terminator */ *len_p = r = (unsigned) (fin->limit - p); fin->buffp = p + r; if (rs_shadow.type == SEP_MLR && fin->buffp[-1] == '\n' && r != 0) { (*len_p)--; *--fin->buffp = 0; fin->limit--; } return p; } if (p == fin->buff) { /* current record is too big for the input buffer, grow buffer */ p = enlarge_fin_buffer(fin); } else { /* move a partial line to front of buffer and try again */ size_t rr; size_t amount = (size_t) (fin->limit - p); size_t blocks = fin->nbuffs * BUFFSZ; fin->flags |= FIN_FLAG; r = amount; if (blocks < r) { fin->flags |= EOF_FLAG; return 0; } p = (char *) memmove(fin->buff, p, r); q = p + r; rr = blocks - r; if ((r = fillbuff(fin->fd, q, rr)) < rr) { fin->flags |= EOF_FLAG; fin->limit = fin->buff + amount + r; } } goto retry; } static char * enlarge_fin_buffer(FIN * fin) { size_t r; size_t oldsize = fin->nbuffs * BUFFSZ + 1; size_t limit = (size_t) (fin->limit - fin->buff); #ifdef MSDOS /* I'm not sure this can really happen: avoid "16bit wrap" */ if (fin->nbuffs == MAX_BUFFS) { errmsg(0, "out of input buffer space"); mawk_exit(2); } #endif fin->buffp = fin->buff = (char *) zrealloc(fin->buff, oldsize, oldsize + BUFFSZ); fin->nbuffs++; r = fillbuff(fin->fd, fin->buff + (oldsize - 1), (size_t) BUFFSZ); if (r < BUFFSZ) fin->flags |= EOF_FLAG; fin->limit = fin->buff + limit + r; return fin->buff; } /*-------- target is big enough to hold size + 1 chars on exit the back of the target is zero terminated *--------------*/ size_t fillbuff(int fd, char *target, size_t size) { register int r; size_t entry_size = size; while (size) switch (r = (int) read(fd, target, size)) { case -1: errmsg(errno, "read error"); mawk_exit(2); case 0: goto out; default: target += r; size -= (unsigned) r; break; } out: *target = 0; return (size_t) (entry_size - size); } /* main_fin is a handle to the main input stream == 0 never been opened */ FIN *main_fin; ARRAY Argv; /* to the user this is ARGV */ static double argi = 1.0; /* index of next ARGV[argi] to try to open */ static void set_main_to_stdin(void) { cell_destroy(FILENAME); FILENAME->type = C_STRING; FILENAME->ptr = (PTR) new_STRING("-"); cell_destroy(FNR); FNR->type = C_DOUBLE; FNR->dval = 0.0; rt_fnr = 0; main_fin = FINdopen(0, 1); } /* this gets called once to get the input stream going. It is called after the execution of the BEGIN block unless there is a getline inside BEGIN {} */ void open_main(void) { CELL argc; #if USE_BINMODE int k = binmode(); if (k & 1) setmode(0, O_BINARY); if (k & 2) { setmode(1, O_BINARY); setmode(2, O_BINARY); } #endif cellcpy(&argc, ARGC); if (argc.type != C_DOUBLE) cast1_to_d(&argc); if (argc.dval == 1.0) set_main_to_stdin(); else next_main(1); } /* get the next command line file open */ static FIN * next_main(int open_flag) /* called by open_main() if on */ { register CELL *cp; CELL argc; /* copy of ARGC */ CELL c_argi; /* cell copy of argi */ CELL argval; /* copy of ARGV[c_argi] */ int failed = 1; argval.type = C_NOINIT; c_argi.type = C_DOUBLE; if (main_fin) { FINclose(main_fin); main_fin = 0; } /* FILENAME and FNR don't change unless we really open a new file */ /* make a copy of ARGC to avoid side effect */ if (cellcpy(&argc, ARGC)->type != C_DOUBLE) cast1_to_d(&argc); while (argi < argc.dval) { c_argi.dval = argi; argi += 1.0; if (!(cp = array_find(Argv, &c_argi, NO_CREATE))) continue; /* its deleted */ /* make a copy so we can cast w/o side effect */ cell_destroy(&argval); cp = cellcpy(&argval, cp); if (cp->type < C_STRING) cast1_to_s(cp); if (string(cp)->len == 0) { /* file argument is "" */ cell_destroy(cp); continue; } /* it might be a command line assignment */ if (is_cmdline_assign(string(cp)->str)) { continue; } /* try to open it -- we used to continue on failure, but posix says we should quit */ if (!(main_fin = FINopen(string(cp)->str, 1))) { errmsg(errno, "cannot open %s", string(cp)->str); mawk_exit(2); } /* success -- set FILENAME and FNR */ cell_destroy(FILENAME); cellcpy(FILENAME, cp); cell_destroy(cp); cell_destroy(FNR); FNR->type = C_DOUBLE; FNR->dval = 0.0; rt_fnr = 0; failed = 0; break; } if (failed) { cell_destroy(&argval); if (open_flag) { /* all arguments were null or assignment */ set_main_to_stdin(); } else { main_fin = &dead_main; /* since MAIN_FLAG is not set, FINgets won't call next_main() */ } } return main_fin; } int is_cmdline_assign(char *s) { register char *p; int c; SYMTAB *stp; CELL *cp = 0; size_t len; CELL cell; /* used if command line assign to pseudo field */ CELL *fp = (CELL *) 0; /* ditto */ size_t length; if (scan_code[*(unsigned char *) s] != SC_IDCHAR) return 0; p = s + 1; while ((c = scan_code[*(unsigned char *) p]) == SC_IDCHAR || c == SC_DIGIT) p++; if (*p != '=') return 0; *p = 0; stp = find(s); switch (stp->type) { case ST_NONE: stp->type = ST_VAR; stp->stval.cp = cp = ZMALLOC(CELL); break; case ST_VAR: case ST_NR: /* !! no one will do this */ cp = stp->stval.cp; cell_destroy(cp); break; case ST_FIELD: /* must be pseudo field */ fp = stp->stval.cp; cp = &cell; break; default: rt_error( "cannot command line assign to %s\n\ttype clash or keyword" ,s); } /* we need to keep ARGV[i] intact */ *p++ = '='; len = strlen(p) + 1; /* posix says escape sequences are on from command line */ p = rm_escape(strcpy((char *) zmalloc(len), p), &length); cp->ptr = (PTR) new_STRING1(p, length); zfree(p, len); check_strnum(cp); /* sets cp->type */ if (fp) /* move it from cell to pfield[] */ { field_assign(fp, cp); free_STRING(string(cp)); } return 1; } #ifdef NO_LEAKS void fin_leaks(void) { TRACE(("fin_leaks\n")); if (main_fin) { free_fin_data(main_fin); main_fin = 0; } } #endif mawk-1.3.4-20200120/zmalloc.c0000644000175100001440000001603513424177032013676 0ustar tomusers/******************************************** zmalloc.c copyright 2008-2013,2019, Thomas E. Dickey copyright 1991-1993,1995, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: zmalloc.c,v 1.31 2019/01/30 01:30:02 tom Exp $ */ /* zmalloc.c */ #include "mawk.h" #include "zmalloc.h" #if defined(NO_LEAKS) && defined(HAVE_TSEARCH) #define USE_TSEARCH 1 #endif #ifdef USE_TSEARCH #include #endif #define ZSHIFT 3 #define ZBLOCKSZ BlocksToBytes(1) #define BytesToBlocks(size) ((((unsigned)size) + ZBLOCKSZ - 1) >> ZSHIFT) #define BlocksToBytes(size) ((size) << ZSHIFT) /* zmalloc() gets mem from malloc() in CHUNKS of 2048 bytes and cuts these blocks into smaller pieces that are multiples of eight bytes. When a piece is returned via zfree(), it goes on a linked linear list indexed by its size. The lists are an array, pool[]. E.g., if you ask for 22 bytes with p = zmalloc(22), you actually get a piece of size 24. When you free it with zfree(p,22) , it is added to the list at pool[2]. */ #define POOLSZ 16 #define CHUNK 256 /* number of blocks to get from malloc */ /*****************************************************************************/ /* * zmalloc() implements a scheme which makes it hard to use memory-checking * tools such as valgrind to audit the program to find where there are leaks. * That is due to its maintaining (for speed...) pools of memory chunks. * * Define DEBUG_ZMALLOC to build mawk with a simpler interface to the system * malloc, which verifies whether the size-parameter passed to zfree() is * consistent with the zmalloc() parameter. * * The NO_LEAKS code relies upon this simpler interface. */ #if !defined(DEBUG_ZMALLOC) && defined(NO_LEAKS) #define DEBUG_ZMALLOC 1 #endif #ifdef DEBUG_ZMALLOC #define IsPoolable(blocks) 0 #define Malloc(n) calloc(1,n) #else #define IsPoolable(blocks) ((blocks) <= POOLSZ) #define Malloc(n) malloc(n) #endif #ifdef USE_TSEARCH typedef struct { PTR ptr; size_t size; } PTR_DATA; static void *ptr_data; #if 0 static void show_tsearch(const void *nodep, const VISIT which, const int depth) { const PTR_DATA *p = *(PTR_DATA * const *) nodep; if (which == postorder || which == leaf) { TRACE(("show_data %d:%p ->%p %lu\n", depth, p, p->ptr, p->size)); } } static void show_ptr_data(void) { twalk(ptr_data, show_tsearch); } #define ShowPtrData() show_ptr_data() #else #define ShowPtrData() /* nothing */ #endif static void free_ptr_data(void *a) { TRACE(("free_ptr_data %p -> %p\n", a, ((PTR_DATA *) (a))->ptr)); free(a); } static int compare_ptr_data(const void *a, const void *b) { const PTR_DATA *p = (const PTR_DATA *) a; const PTR_DATA *q = (const PTR_DATA *) b; int result; TRACE2(("compare %p->%p %p->%p\n", p, p->ptr, q, q->ptr)); if (p->ptr > q->ptr) { result = 1; } else if (p->ptr < q->ptr) { result = -1; } else { result = 0; } return result; } static void record_ptr(PTR ptr, size_t size) { PTR_DATA *item; PTR_DATA **result; item = malloc(sizeof(PTR_DATA)); item->ptr = ptr; item->size = size; TRACE(("record_ptr %p -> %p %lu\n", (void *) item, ptr, (unsigned long) size)); result = tsearch(item, &ptr_data, compare_ptr_data); assert(result != 0); assert(*result != 0); TRACE2(("->%p (%p %lu)\n", (*result), (*result)->ptr, (unsigned long) (*result)->size)); ShowPtrData(); } static void finish_ptr(PTR ptr, size_t size) { PTR_DATA dummy; PTR_DATA *later; PTR_DATA **item; void *check; dummy.ptr = ptr; dummy.size = size; TRACE2(("finish_ptr (%p) -> %p %lu\n", &dummy, ptr, (unsigned long) size)); item = tfind(&dummy, &ptr_data, compare_ptr_data); assert(item != 0); assert(*item != 0); TRACE(("finish_ptr %p -> %p %lu\n", (void *) (*item), (*item)->ptr, (unsigned long) (*item)->size)); later = *item; check = tdelete(&dummy, &ptr_data, compare_ptr_data); if (check) { free(later); } ShowPtrData(); } #define FinishPtr(ptr,size) finish_ptr(ptr,size) #define RecordPtr(ptr,size) record_ptr(ptr,size) #else #define FinishPtr(ptr,size) /* nothing */ #define RecordPtr(ptr,size) /* nothing */ #endif /*****************************************************************************/ static void out_of_mem(void) { static char out[] = "out of memory"; if (mawk_state == EXECUTION) { rt_error("%s", out); } else { /* I don't think this will ever happen */ compile_error("%s", out); mawk_exit(2); } } typedef union zblock { char dummy[ZBLOCKSZ]; union zblock *link; } ZBLOCK; /* ZBLOCKS of sizes 1, 2, ... 16 which is bytes of sizes 8, 16, ... , 128 are stored on the linked linear lists in pool[0], pool[1], ... , pool[15] */ static ZBLOCK *pool[POOLSZ]; PTR zmalloc(size_t size) { unsigned blocks = BytesToBlocks(size); size_t bytes = (size_t) BlocksToBytes(blocks); register ZBLOCK *p; static unsigned amt_avail; static ZBLOCK *avail; if (!IsPoolable(blocks)) { p = (ZBLOCK *) Malloc(bytes); if (!p) out_of_mem(); RecordPtr(p, size); } else { if ((p = pool[blocks - 1]) != 0) { pool[blocks - 1] = p->link; } else { if (blocks > amt_avail) { if (amt_avail != 0) /* free avail */ { avail->link = pool[--amt_avail]; pool[amt_avail] = avail; } if (!(avail = (ZBLOCK *) Malloc((size_t) (CHUNK * ZBLOCKSZ)))) { /* if we get here, almost out of memory */ amt_avail = 0; p = (ZBLOCK *) Malloc(bytes); if (!p) out_of_mem(); RecordPtr(p, bytes); return (PTR) p; } else { RecordPtr(avail, CHUNK * ZBLOCKSZ); amt_avail = CHUNK; } } /* get p from the avail pile */ p = avail; avail += blocks; amt_avail -= blocks; } } return (PTR) p; } void zfree(PTR p, size_t size) { unsigned blocks = BytesToBlocks(size); if (!IsPoolable(blocks)) { FinishPtr(p, size); free(p); } else { ((ZBLOCK *) p)->link = pool[--blocks]; pool[blocks] = (ZBLOCK *) p; } } PTR zrealloc(PTR p, size_t old_size, size_t new_size) { register PTR q; TRACE(("zrealloc %p %lu ->%lu\n", p, old_size, new_size)); if (new_size > (BlocksToBytes(POOLSZ)) && old_size > (BlocksToBytes(POOLSZ))) { if (!(q = realloc(p, new_size))) { out_of_mem(); } FinishPtr(p, old_size); RecordPtr(q, new_size); #ifdef DEBUG_ZMALLOC if (new_size > old_size) { memset((char *) q + old_size, 0, new_size - old_size); } #endif } else { q = zmalloc(new_size); memcpy(q, p, old_size < new_size ? old_size : new_size); zfree(p, old_size); } return q; } #ifdef NO_LEAKS void zmalloc_leaks(void) { #ifdef USE_TSEARCH TRACE(("zmalloc_leaks\n")); while (ptr_data != 0) { PTR_DATA *data = *(PTR_DATA **) ptr_data; tdelete(data, &ptr_data, compare_ptr_data); free_ptr_data(data); } #endif } #endif mawk-1.3.4-20200120/rexp.h0000644000175100001440000001224512773533261013225 0ustar tomusers/******************************************** rexp.h copyright 2008-2014,2016, Thomas E. Dickey copyright 2010, Jonathan Nieder copyright 1991,2014, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: rexp.h,v 1.28 2016/09/30 19:02:09 tom Exp $ */ #ifndef REXP_H #define REXP_H #include "nstd.h" #include "types.h" #include #include extern PTR RE_malloc(size_t); extern PTR RE_realloc(void *, size_t); #ifdef NO_LEAKS extern void RE_free(void *); #else #define RE_free(p) free(p) #endif /* finite machine state types */ #define M_STR 0 /* matching a literal string */ #define M_CLASS 1 /* character class */ #define M_ANY 2 /* arbitrary character (.) */ #define M_START 3 /* start of string (^) */ #define M_END 4 /* end of string ($) */ #define M_U 5 /* arbitrary string (.*) */ #define M_1J 6 /* mandatory jump */ #define M_2JA 7 /* optional (undesirable) jump */ #define M_2JB 8 /* optional (desirable) jump */ #define M_SAVE_POS 9 /* push position onto stack */ #define M_2JC 10 /* pop pos'n, optional jump if advanced */ #define M_ACCEPT 11 /* end of match */ #define U_ON 12 #define U_OFF 0 #define END_OFF 0 #define END_ON (2*U_ON) typedef UChar BV[32]; /* bit vector */ typedef struct { SType s_type; SLen s_len; /* used for M_STR */ union { char *str; /* string */ BV *bvp; /* class */ int jump; } s_data; } STATE; #define STATESZ (sizeof(STATE)) typedef struct { STATE *start, *stop; } MACHINE; /* tokens */ #define T_NONE 0 /* no token */ #define T_OR 1 /* | */ #define T_CAT 2 /* binary operator */ #define T_STAR 3 /* * */ #define T_PLUS 4 /* + */ #define T_Q 5 /* ? */ #define T_LP 6 /* ( */ #define T_RP 7 /* ) */ #define T_START 8 /* ^ */ #define T_END 9 /* $ */ #define T_ANY 10 /* . */ #define T_CLASS 11 /* starts with [ */ #define T_SLASH 12 /* \ */ #define T_CHAR 13 /* all the rest */ #define T_STR 14 /* string built of other tokens */ #define T_U 15 /* precedences and error codes */ #define L 0 #define EQ 1 #define G 2 #define E1 (-1) #define E2 (-2) #define E3 (-3) #define E4 (-4) #define E5 (-5) #define E6 (-6) #define E7 (-7) #define MEMORY_FAILURE 5 #define ison(b,x) ((b)[((UChar)(x)) >> 3] & (1 << ((x) & 7))) /* struct for the run time stack */ typedef struct { STATE *m; /* save the machine ptr */ int u; /* save the u_flag */ char *s; /* save the active string ptr */ int sp; /* size of position stack */ int tp; /* offset to top entry of position stack */ char *ss; /* save the match start -- only used by REmatch */ } RT_STATE; /* run time state */ /* entry for the position stack */ typedef struct { /* if we have not advanced beyond this character, * do not bother trying another round. */ const char *pos; /* run time stack frame responsible for removing this node */ int owner; /* previous node is this - this->prev_offset. See RE_pos_pop() */ int prev_offset; } RT_POS_ENTRY; /* error trap */ extern int REerrno; void RE_error_trap(int); #ifndef GCC_NORETURN #define GCC_NORETURN /* nothing */ #endif extern MACHINE RE_u(void); extern MACHINE RE_start(void); extern MACHINE RE_end(void); extern MACHINE RE_any(void); extern MACHINE RE_str(char *, size_t); extern MACHINE RE_class(BV *); extern void RE_cat(MACHINE *, MACHINE *); extern void RE_or(MACHINE *, MACHINE *); extern void RE_close(MACHINE *); extern void RE_poscl(MACHINE *); extern void RE_01(MACHINE *); extern void RE_panic(const char *) GCC_NORETURN; #ifndef MAWK_H extern char *str_str(char *, size_t, char *, size_t); #endif extern void RE_lex_init(char *, size_t); extern int RE_lex(MACHINE *); extern void RE_run_stack_init(void); extern void RE_pos_stack_init(void); extern RT_STATE *RE_new_run_stack(void); extern RT_POS_ENTRY *RE_new_pos_stack(void); extern RT_STATE *RE_run_stack_base; extern RT_STATE *RE_run_stack_limit; extern RT_STATE *RE_run_stack_empty; extern RT_POS_ENTRY *RE_pos_stack_base; extern RT_POS_ENTRY *RE_pos_stack_limit; extern RT_POS_ENTRY *RE_pos_stack_empty; #ifdef LOCAL_REGEXP static /* inline */ RT_POS_ENTRY * RE_pos_push(RT_POS_ENTRY * head, const RT_STATE * owner, const char *s) { head->pos = s; head->owner = (int) (owner - RE_run_stack_base); if (++head == RE_pos_stack_limit) { head = RE_new_pos_stack(); } head->prev_offset = 1; return head; } static /* inline */ const char * RE_pos_pop(RT_POS_ENTRY ** head, const RT_STATE * current) { RT_POS_ENTRY *prev = *head - (*head)->prev_offset; if (prev->owner == current - RE_run_stack_base) { /* likely */ /* no need to preserve intervening nodes */ *head = prev; } else if (*head == prev) { RE_panic("unbalanced M_SAVE_POS and M_2JC"); } else { (*head)->prev_offset += prev->prev_offset; } return prev->pos; } #endif /* LOCAL_REGEXP */ #endif /* REXP_H */ mawk-1.3.4-20200120/parse.c0000644000175100001440000030377213611312041013343 0ustar tomusers/* original parser id follows */ /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 #define YYPATCH 20191125 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) #define yyerrok (yyerrflag = 0) #define YYRECOVERING() (yyerrflag != 0) #define YYENOMEM (-2) #define YYEOF 0 #define YYPREFIX "yy" #define YYPURE 0 #line 18 "parse.y" #include #include "mawk.h" #include "symtype.h" #include "code.h" #include "memory.h" #include "bi_funct.h" #include "bi_vars.h" #include "jmp.h" #include "field.h" #include "files.h" #define YYMAXDEPTH 200 extern void eat_nl(void); static SYMTAB *save_arglist(const char *); static int init_arglist(void); static void RE_as_arg(void); static void check_array(SYMTAB *); static void check_var(SYMTAB *); static void code_array(SYMTAB *); static void code_call_id(CA_REC *, SYMTAB *); static void field_A2I(void); static void free_arglist(void); static void improve_arglist(const char *); static void resize_fblock(FBLOCK *); static void switch_code_to_main(void); static int scope; static FBLOCK *active_funct; static CA_REC *active_arglist; /* when scope is SCOPE_FUNCT */ #define code_address(x) if( is_local(x) ) \ code2op(L_PUSHA, (x)->offset) ;\ else code2(_PUSHA, (x)->stval.cp) #define CDP(x) (code_base+(x)) /* WARNING: These CDP() calculations become invalid after calls that might change code_base. Which are: code2(), code2op(), code_jmp() and code_pop(). */ /* this nonsense caters to MSDOS large model */ #define CODE_FE_PUSHA() code_ptr->ptr = (PTR) 0 ; code1(FE_PUSHA) #ifdef YYSTYPE #undef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #endif #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #line 66 "parse.y" typedef union{ CELL *cp ; SYMTAB *stp ; int start ; /* code starting address as offset from code_base */ PF_CP fp ; /* ptr to a (print/printf) or (sub/gsub) function */ const BI_REC *bip ; /* ptr to info about a builtin */ FBLOCK *fbp ; /* ptr to a function block */ ARG2_REC *arg2p ; CA_REC *ca_p ; int ival ; PTR ptr ; } YYSTYPE; #endif /* !YYSTYPE_IS_DECLARED */ #line 88 "parse.c" /* compatibility with bison */ #ifdef YYPARSE_PARAM /* compatibility with FreeBSD */ # ifdef YYPARSE_PARAM_TYPE # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) # else # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) # endif #else # define YYPARSE_DECL() yyparse(void) #endif /* Parameters sent to lex. */ #ifdef YYLEX_PARAM # define YYLEX_DECL() yylex(void *YYLEX_PARAM) # define YYLEX yylex(YYLEX_PARAM) #else # define YYLEX_DECL() yylex(void) # define YYLEX yylex() #endif #if !(defined(yylex) || defined(YYSTATE)) int YYLEX_DECL(); #endif /* Parameters sent to yyerror. */ #ifndef YYERROR_DECL #define YYERROR_DECL() yyerror(const char *s) #endif #ifndef YYERROR_CALL #define YYERROR_CALL(msg) yyerror(msg) #endif extern int YYPARSE_DECL(); #define UNEXPECTED 257 #define BAD_DECIMAL 258 #define NL 259 #define SEMI_COLON 260 #define LBRACE 261 #define RBRACE 262 #define LBOX 263 #define RBOX 264 #define COMMA 265 #define IO_OUT 266 #define ASSIGN 267 #define ADD_ASG 268 #define SUB_ASG 269 #define MUL_ASG 270 #define DIV_ASG 271 #define MOD_ASG 272 #define POW_ASG 273 #define QMARK 274 #define COLON 275 #define OR 276 #define AND 277 #define IN 278 #define MATCH 279 #define EQ 280 #define NEQ 281 #define LT 282 #define LTE 283 #define GT 284 #define GTE 285 #define CAT 286 #define GETLINE 287 #define PLUS 288 #define MINUS 289 #define MUL 290 #define DIV 291 #define MOD 292 #define NOT 293 #define UMINUS 294 #define IO_IN 295 #define PIPE 296 #define POW 297 #define INC_or_DEC 298 #define DOLLAR 299 #define FIELD 300 #define LPAREN 301 #define RPAREN 302 #define DOUBLE 303 #define STRING_ 304 #define RE 305 #define ID 306 #define D_ID 307 #define FUNCT_ID 308 #define BUILTIN 309 #define LENGTH 310 #define PRINT 311 #define PRINTF 312 #define SPLIT 313 #define MATCH_FUNC 314 #define SUB 315 #define GSUB 316 #define DO 317 #define WHILE 318 #define FOR 319 #define BREAK 320 #define CONTINUE 321 #define IF 322 #define ELSE 323 #define DELETE 324 #define BEGIN 325 #define END 326 #define EXIT 327 #define NEXT 328 #define NEXTFILE 329 #define RETURN 330 #define FUNCTION 331 #define YYERRCODE 256 typedef short YYINT; static const YYINT yylhs[] = { -1, 0, 0, 36, 36, 36, 37, 40, 37, 41, 37, 42, 37, 43, 44, 37, 1, 1, 2, 2, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 45, 45, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 46, 13, 47, 13, 48, 49, 13, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 10, 25, 25, 26, 26, 8, 8, 8, 5, 4, 27, 27, 6, 6, 6, 7, 7, 50, 50, 17, 4, 51, 4, 52, 4, 16, 4, 4, 18, 18, 19, 19, 53, 53, 13, 13, 10, 15, 15, 4, 4, 20, 4, 11, 11, 11, 11, 11, 15, 13, 13, 13, 13, 13, 13, 13, 15, 22, 54, 54, 15, 23, 4, 4, 21, 21, 15, 15, 15, 15, 15, 55, 12, 12, 9, 9, 15, 28, 28, 24, 24, 38, 29, 30, 30, 34, 34, 35, 35, 39, 15, 31, 31, 32, 32, 32, 33, 33, }; static const YYINT yylen[] = { 2, 1, 2, 1, 1, 2, 1, 0, 3, 0, 3, 0, 3, 0, 0, 6, 3, 3, 1, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 4, 0, 4, 0, 0, 7, 1, 2, 1, 1, 1, 3, 1, 3, 3, 3, 3, 3, 3, 2, 2, 2, 1, 2, 2, 2, 2, 1, 0, 1, 1, 3, 5, 5, 1, 0, 5, 1, 1, 1, 3, 2, 3, 3, 0, 2, 4, 2, 1, 4, 1, 7, 4, 2, 4, 3, 4, 1, 2, 1, 2, 3, 5, 5, 5, 6, 7, 3, 6, 2, 1, 2, 6, 2, 3, 1, 3, 3, 3, 3, 3, 3, 3, 2, 5, 1, 3, 6, 1, 2, 3, 2, 3, 1, 2, 2, 3, 4, 1, 1, 1, 2, 3, 6, 1, 1, 1, 3, 2, 4, 2, 2, 0, 1, 1, 3, 1, 3, 2, 2, 1, 3, 3, 2, 2, }; static const YYINT yydefred[] = { 0, 165, 0, 147, 0, 0, 0, 0, 0, 119, 0, 57, 58, 61, 0, 84, 84, 83, 0, 0, 153, 154, 7, 9, 0, 0, 6, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 4, 0, 0, 0, 31, 32, 86, 87, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 20, 0, 0, 0, 0, 0, 28, 84, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 75, 0, 122, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 159, 160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, 13, 52, 48, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 132, 0, 157, 0, 5, 150, 148, 149, 0, 17, 25, 0, 0, 26, 27, 0, 0, 0, 138, 29, 30, 0, 140, 0, 16, 21, 23, 102, 0, 106, 0, 0, 118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 123, 0, 60, 0, 0, 166, 0, 0, 0, 0, 8, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 110, 0, 41, 42, 43, 44, 45, 46, 18, 12, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 163, 0, 0, 151, 0, 104, 0, 0, 0, 0, 116, 139, 141, 97, 0, 107, 108, 0, 0, 0, 0, 0, 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 167, 0, 0, 168, 0, 0, 0, 0, 0, 0, 0, 0, 146, 135, 0, 158, 0, 101, 0, 105, 95, 0, 98, 109, 103, 90, 0, 0, 0, 0, 0, 0, 0, 0, 111, 0, 171, 173, 170, 172, 81, 82, 133, 0, 0, 53, 0, 164, 0, 0, 0, 0, 85, 0, 0, 0, 112, 121, 114, 136, 15, 0, 0, 155, 152, 117, 0, 0, 0, 0, 115, 100, 156, }; static const YYINT yydgoto[] = { 25, 59, 217, 60, 61, 87, 249, 83, 27, 28, 29, 30, 144, 62, 32, 33, 63, 64, 65, 167, 66, 67, 34, 228, 325, 251, 252, 68, 35, 36, 37, 183, 184, 264, 230, 231, 38, 39, 40, 41, 92, 93, 125, 204, 305, 69, 206, 207, 205, 322, 289, 243, 70, 247, 136, 42, }; static const YYINT yysindex[] = { -73, 0, 203, 0, 2293, 2293, 2293, -88, 2203, 0, 2323, 0, 0, 0, -286, 0, 0, 0, -276, -273, 0, 0, 0, 0, -291, -73, 0, 0, 2293, 2576, 62, 2627, 2293, 263, -263, -243, -192, -226, 0, 0, 0, -192, -22, -123, 0, 0, 0, 0, 0, -208, -137, -178, -178, -125, -128, 1656, -178, -178, 1656, 0, 53, 0, 2579, 278, 278, 1747, 278, 0, 0, 0, 278, 2323, -286, -111, -200, -200, -200, -110, 0, 0, 0, 0, 0, -257, 2197, 2144, 0, -79, -109, -107, 2323, 2323, -192, -192, 0, 0, 0, -87, 2323, 2323, 2323, 2323, 2323, 2323, 2323, 2323, 2323, 2323, 2323, 2323, 2323, 2323, 0, 0, 0, 0, 0, -82, 2323, 2323, 2323, 2323, 2323, 2323, 2323, 2, 263, 2293, 2293, 2293, 2293, 2293, -68, 2293, 2323, 0, 0, 2323, 0, -77, 0, 0, 0, 0, -56, 0, 0, 2323, 1777, 0, 0, 2323, -178, 2579, 0, 0, 0, 2579, 0, -178, 0, 0, 0, 0, -89, 0, 2591, 2233, 0, 2353, -70, 2486, -9, -42, -4, 5, 2323, -14, 0, 2323, 0, 2323, -12, 0, 2383, 2413, 2648, 2669, 0, 0, 2693, 2693, 2693, 2693, 2693, 2693, 2693, 2693, 2693, 2693, 2693, 2693, 2693, 2693, 2323, 2323, 2323, 2323, 0, -127, 0, 0, 0, 0, 0, 0, 0, 0, 0, -46, -46, -200, -200, -200, -88, -87, 2498, 2693, 23, 0, -5, 28, 0, 2513, 0, -210, 2606, 2525, 42, 0, 0, 0, 0, 278, 0, 0, 2540, 278, 2263, 40, 2693, 0, 33, 16, 2323, 2323, 2323, 2693, 12, 2693, -120, 0, -247, 2171, 0, -215, 18, 13, 2323, 2693, 2681, 2702, 2159, 0, 0, 2323, 0, 19, 0, 30, 0, 0, 2323, 0, 0, 0, 0, -241, 2323, -178, 2323, 2323, -114, -66, -61, 0, 9, 0, 0, 0, 0, 0, 0, 0, 36, 2, 0, 2198, 0, 37, -43, -14, 2693, 0, 2693, 2552, 9, 0, 0, 0, 0, 0, 2323, -88, 0, 0, 0, -178, -178, 2693, 41, 0, 0, 0, }; static const YYINT yyrindex[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1510, 26, 1989, 1568, 0, 0, 0, 0, 0, 0, 0, 0, 1336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 466, 582, 814, 872, 930, 0, 350, 0, 0, 408, 0, 0, 1931, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 988, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1626, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 640, 0, 0, 0, 0, 0, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, -237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2443, 0, 0, 46, 0, 0, 0, 0, -212, 35, 283, 2017, 2029, 2037, 2049, 2057, 2069, 2077, 2089, 2097, 2109, 2117, 0, 0, 0, 0, 0, 133, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1394, 1452, 1046, 1104, 1162, 1278, 698, 0, -235, 0, 0, 0, 74, 0, 0, 0, 1713, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -118, -93, 0, -216, 0, 0, 0, 0, -231, 0, -171, 0, 0, 1885, 0, 0, 1831, 0, 0, 0, 43, 0, 6, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -126, 15, 0, -64, 0, 756, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2129, 0, 0, 0, 0, }; static const YYINT yygindex[] = { 0, 21, 39, 0, -50, 17, 0, 76, 0, 0, -7, -1, -205, 1, 0, 32, 0, 0, 0, 0, 0, 0, 0, 60, 0, 160, -139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 330, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; #define YYTABLESIZE 2987 static const YYINT yytable[] = { 79, 31, 134, 73, 73, 73, 80, 73, 176, 84, 161, 85, 86, 163, 164, 94, 168, 95, 297, 273, 170, 26, 77, 77, 176, 90, 31, 73, 91, 77, 137, 73, 88, 89, 92, 142, 74, 75, 76, 135, 82, 143, 260, 78, 78, 177, 26, 34, 34, 34, 78, 86, 34, 34, 34, 298, 153, 138, 137, 157, 97, 311, 140, 34, 126, 146, 166, 137, 279, 2, 84, 92, 171, 149, 150, 139, 173, 154, 155, 156, 158, 44, 45, 86, 162, 169, 78, 301, 86, 172, 34, 186, 187, 147, 91, 174, 132, 133, 175, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 188, 189, 292, 293, 294, 330, 209, 210, 211, 212, 213, 214, 215, 73, 73, 73, 73, 73, 91, 73, 89, 89, 226, 44, 45, 227, 145, 89, 93, 93, 310, 296, 290, 216, 218, 233, 236, 316, 290, 237, 119, 120, 121, 122, 123, 124, 219, 220, 221, 222, 223, 148, 225, 79, 79, 246, 238, 250, 79, 79, 79, 239, 240, 151, 257, 152, 241, 259, 146, 250, 1, 181, 263, 250, 112, 2, 8, 9, 77, 182, 283, 185, 80, 80, 285, 317, 290, 80, 80, 80, 318, 290, 269, 270, 271, 272, 79, 133, 8, 9, 77, 3, 4, 5, 142, 78, 224, 6, 327, 290, 143, 208, 7, 8, 9, 10, 229, 11, 12, 13, 14, 242, 15, 16, 17, 80, 232, 18, 19, 20, 21, 129, 130, 131, 84, 253, 85, 132, 133, 22, 23, 254, 250, 250, 250, 24, 255, 178, 44, 45, 2, 258, 49, 49, 49, 256, 227, 49, 49, 49, 141, 94, 94, 307, 8, 9, 77, 49, 49, 49, 250, 78, 11, 11, 11, 275, 312, 261, 314, 315, 277, 35, 35, 35, 276, 290, 35, 35, 35, 14, 14, 14, 282, 288, 319, 49, 159, 35, 313, 44, 45, 2, 160, 142, 291, 295, 303, 302, 84, 143, 329, 287, 308, 216, 218, 304, 105, 106, 107, 108, 109, 110, 111, 309, 35, 320, 326, 3, 4, 5, 333, 321, 266, 6, 161, 77, 331, 332, 7, 8, 9, 10, 96, 11, 12, 13, 14, 112, 15, 16, 17, 46, 47, 18, 19, 20, 21, 48, 49, 50, 51, 52, 53, 162, 54, 0, 0, 55, 56, 57, 58, 96, 0, 0, 96, 96, 96, 96, 0, 47, 47, 47, 0, 0, 47, 47, 47, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 0, 0, 96, 96, 96, 0, 0, 0, 96, 0, 0, 0, 0, 96, 96, 96, 96, 0, 96, 96, 96, 96, 47, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 0, 96, 0, 0, 96, 96, 96, 96, 43, 0, 0, 44, 45, 2, 0, 0, 51, 51, 51, 0, 0, 51, 51, 51, 0, 0, 0, 0, 0, 0, 0, 51, 51, 51, 51, 0, 0, 0, 0, 3, 4, 5, 0, 0, 0, 6, 0, 0, 0, 0, 7, 8, 9, 10, 0, 11, 12, 13, 14, 51, 15, 16, 17, 46, 47, 18, 19, 20, 21, 48, 49, 50, 51, 52, 53, 0, 54, 0, 0, 55, 56, 57, 58, 159, 0, 0, 44, 45, 2, 0, 0, 36, 36, 36, 0, 0, 36, 36, 36, 0, 127, 128, 129, 130, 131, 0, 0, 36, 132, 133, 0, 0, 0, 0, 3, 4, 5, 0, 0, 0, 6, 0, 0, 0, 0, 7, 8, 9, 10, 0, 11, 12, 13, 14, 36, 15, 16, 17, 46, 47, 18, 19, 20, 21, 48, 49, 50, 51, 52, 53, 0, 54, 0, 0, 55, 56, 57, 58, 76, 76, 76, 0, 84, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 0, 76, 76, 76, 76, 76, 76, 76, 0, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 0, 76, 76, 76, 0, 0, 76, 76, 76, 76, 120, 120, 120, 0, 84, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 0, 120, 120, 120, 120, 120, 120, 120, 0, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 0, 120, 120, 120, 0, 0, 120, 120, 120, 120, 59, 59, 59, 0, 84, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 0, 59, 59, 59, 59, 59, 59, 59, 0, 59, 59, 59, 0, 59, 59, 59, 59, 59, 59, 59, 59, 0, 59, 59, 59, 0, 0, 59, 59, 59, 59, 59, 59, 59, 0, 84, 59, 59, 59, 76, 76, 76, 76, 76, 76, 76, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 0, 59, 59, 59, 59, 59, 59, 59, 0, 0, 59, 59, 0, 59, 59, 59, 59, 59, 59, 59, 59, 0, 59, 59, 59, 0, 0, 59, 59, 59, 59, 124, 124, 124, 0, 0, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 0, 124, 124, 124, 124, 124, 124, 124, 0, 124, 124, 124, 0, 124, 124, 124, 124, 124, 124, 124, 124, 0, 124, 124, 124, 0, 0, 124, 124, 124, 124, 143, 143, 143, 0, 0, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 0, 143, 143, 143, 143, 143, 143, 143, 0, 0, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 0, 143, 143, 143, 0, 0, 143, 143, 143, 143, 67, 67, 67, 0, 0, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, 67, 67, 67, 67, 67, 67, 67, 0, 67, 67, 0, 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, 67, 67, 67, 0, 0, 67, 67, 67, 67, 113, 113, 113, 0, 0, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 0, 113, 113, 113, 113, 113, 113, 113, 0, 113, 113, 113, 0, 113, 113, 113, 113, 113, 113, 113, 113, 0, 113, 113, 113, 0, 0, 113, 113, 113, 113, 69, 69, 69, 0, 0, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 0, 69, 69, 69, 69, 69, 69, 69, 0, 69, 0, 0, 69, 69, 69, 69, 69, 69, 69, 69, 69, 0, 69, 69, 69, 0, 0, 69, 69, 69, 69, 70, 70, 70, 0, 0, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 0, 70, 70, 70, 70, 70, 70, 70, 0, 70, 0, 0, 70, 70, 70, 70, 70, 70, 70, 70, 70, 0, 70, 70, 70, 0, 0, 70, 70, 70, 70, 68, 68, 68, 0, 0, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 0, 68, 68, 68, 68, 68, 68, 68, 0, 68, 0, 0, 68, 68, 68, 68, 68, 68, 68, 68, 68, 0, 68, 68, 68, 0, 0, 68, 68, 68, 68, 144, 144, 144, 0, 0, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 0, 144, 144, 144, 144, 144, 144, 144, 0, 144, 0, 0, 144, 144, 144, 144, 144, 144, 144, 144, 144, 0, 144, 144, 144, 0, 0, 144, 144, 144, 144, 64, 64, 64, 0, 0, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 0, 64, 64, 64, 64, 64, 64, 64, 0, 64, 0, 0, 64, 64, 64, 64, 64, 64, 64, 64, 64, 0, 64, 64, 64, 0, 0, 64, 64, 64, 64, 65, 65, 65, 0, 0, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 0, 65, 65, 65, 65, 65, 65, 65, 0, 65, 0, 0, 65, 65, 65, 65, 65, 65, 65, 65, 65, 0, 65, 65, 65, 0, 0, 65, 65, 65, 65, 66, 66, 66, 0, 0, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 0, 66, 66, 66, 66, 66, 66, 66, 0, 66, 0, 0, 66, 66, 66, 66, 66, 66, 66, 66, 66, 0, 66, 66, 66, 0, 0, 66, 66, 66, 66, 113, 113, 113, 0, 0, 113, 113, 113, 112, 112, 112, 112, 112, 112, 112, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 0, 113, 113, 113, 113, 113, 113, 113, 0, 0, 113, 113, 0, 113, 113, 113, 113, 113, 113, 113, 113, 0, 113, 113, 113, 0, 0, 113, 113, 113, 113, 145, 145, 145, 0, 0, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 0, 145, 145, 145, 145, 145, 145, 145, 0, 145, 145, 145, 145, 0, 0, 0, 145, 145, 145, 145, 0, 0, 145, 145, 145, 0, 0, 145, 145, 145, 145, 142, 142, 142, 0, 0, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 0, 142, 142, 142, 142, 142, 142, 142, 0, 0, 142, 142, 142, 0, 0, 0, 142, 142, 142, 142, 0, 0, 142, 142, 142, 0, 0, 142, 142, 142, 142, 62, 62, 62, 0, 0, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 0, 62, 62, 62, 0, 0, 0, 62, 0, 62, 0, 0, 62, 62, 62, 62, 62, 62, 62, 62, 62, 0, 62, 62, 62, 0, 0, 62, 62, 62, 62, 63, 63, 63, 0, 0, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 0, 63, 63, 63, 0, 0, 0, 63, 0, 63, 0, 0, 63, 63, 63, 63, 63, 63, 63, 63, 63, 0, 63, 63, 63, 0, 0, 63, 63, 63, 63, 124, 124, 124, 0, 0, 124, 124, 124, 0, 0, 0, 0, 0, 0, 0, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 0, 124, 124, 124, 124, 124, 124, 124, 0, 0, 124, 124, 0, 124, 124, 124, 124, 124, 124, 124, 124, 0, 124, 124, 124, 0, 0, 124, 124, 124, 124, 55, 55, 55, 0, 0, 55, 55, 55, 0, 0, 0, 0, 0, 0, 0, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 0, 55, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 55, 55, 55, 55, 55, 55, 55, 55, 55, 0, 55, 55, 55, 0, 0, 55, 55, 55, 55, 56, 56, 56, 0, 0, 56, 56, 56, 0, 0, 0, 0, 0, 0, 0, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 0, 56, 0, 44, 45, 0, 0, 56, 0, 0, 0, 0, 56, 56, 56, 56, 56, 56, 56, 56, 56, 0, 56, 56, 56, 0, 0, 56, 56, 56, 56, 3, 4, 5, 0, 0, 0, 6, 0, 0, 0, 0, 7, 8, 9, 10, 0, 11, 12, 13, 14, 0, 15, 16, 17, 0, 0, 18, 19, 20, 21, 59, 0, 0, 84, 0, 0, 0, 76, 76, 76, 76, 76, 76, 76, 59, 0, 59, 59, 0, 59, 59, 59, 59, 59, 59, 59, 0, 59, 59, 59, 59, 59, 59, 59, 165, 0, 59, 59, 0, 59, 59, 59, 0, 59, 59, 59, 59, 0, 59, 59, 59, 0, 0, 59, 59, 59, 59, 0, 0, 0, 0, 3, 4, 5, 234, 0, 0, 6, 0, 0, 0, 0, 7, 8, 9, 10, 0, 11, 12, 13, 14, 0, 15, 16, 17, 0, 0, 18, 19, 20, 21, 3, 4, 5, 0, 0, 0, 6, 0, 0, 0, 0, 7, 8, 9, 10, 0, 11, 12, 13, 235, 0, 15, 16, 17, 0, 0, 18, 19, 20, 21, 84, 0, 59, 0, 76, 76, 76, 76, 76, 76, 76, 59, 0, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 0, 59, 59, 59, 59, 59, 59, 59, 0, 0, 59, 59, 0, 59, 59, 59, 0, 59, 59, 59, 59, 0, 59, 59, 59, 0, 0, 59, 59, 59, 59, 84, 0, 0, 0, 76, 76, 76, 76, 76, 76, 76, 59, 0, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 0, 59, 59, 59, 59, 59, 59, 59, 0, 0, 59, 59, 0, 59, 59, 59, 0, 59, 59, 59, 59, 0, 59, 59, 59, 124, 0, 59, 59, 59, 59, 0, 0, 0, 124, 0, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 0, 124, 124, 124, 124, 124, 124, 124, 0, 0, 124, 124, 0, 124, 124, 124, 0, 124, 124, 124, 124, 0, 124, 124, 124, 0, 0, 124, 124, 124, 124, 33, 33, 33, 0, 0, 33, 33, 33, 0, 0, 0, 0, 0, 0, 0, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 0, 37, 37, 37, 0, 0, 37, 37, 37, 0, 0, 0, 0, 38, 38, 38, 33, 37, 38, 38, 38, 39, 39, 39, 0, 0, 39, 39, 39, 38, 0, 0, 0, 40, 40, 40, 0, 39, 40, 40, 40, 125, 125, 125, 37, 0, 125, 125, 125, 40, 0, 0, 0, 126, 126, 126, 38, 125, 126, 126, 126, 127, 127, 127, 39, 0, 127, 127, 127, 126, 0, 0, 0, 128, 128, 128, 40, 127, 128, 128, 128, 129, 129, 129, 125, 0, 129, 129, 129, 128, 0, 0, 0, 130, 130, 130, 126, 129, 130, 130, 130, 131, 131, 131, 127, 0, 131, 131, 131, 130, 0, 0, 0, 54, 54, 54, 128, 131, 54, 54, 54, 0, 0, 0, 129, 0, 0, 0, 0, 54, 0, 0, 0, 0, 179, 0, 130, 0, 0, 0, 0, 0, 0, 114, 131, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 0, 54, 0, 0, 0, 0, 299, 117, 118, 119, 120, 121, 122, 123, 124, 114, 180, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 0, 0, 0, 0, 0, 0, 323, 105, 106, 107, 108, 109, 110, 111, 0, 114, 300, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 0, 0, 0, 0, 0, 0, 3, 4, 5, 0, 0, 112, 6, 0, 0, 178, 324, 7, 8, 9, 71, 0, 11, 12, 13, 72, 81, 15, 16, 17, 0, 0, 18, 19, 20, 21, 3, 4, 5, 0, 0, 0, 6, 0, 0, 0, 0, 7, 8, 9, 10, 245, 11, 12, 13, 14, 0, 15, 16, 17, 0, 0, 18, 19, 20, 21, 3, 4, 5, 0, 0, 0, 6, 0, 0, 0, 0, 7, 8, 9, 10, 286, 11, 12, 13, 14, 0, 15, 16, 17, 0, 0, 18, 19, 20, 21, 3, 4, 5, 0, 0, 0, 6, 0, 0, 0, 0, 7, 8, 9, 71, 0, 11, 12, 13, 72, 0, 15, 16, 17, 0, 0, 18, 19, 20, 21, 3, 4, 5, 0, 0, 0, 6, 0, 0, 0, 0, 7, 8, 9, 10, 0, 11, 12, 13, 14, 0, 15, 16, 17, 0, 0, 18, 19, 20, 21, 3, 4, 5, 0, 0, 0, 6, 0, 0, 0, 0, 7, 8, 9, 248, 0, 11, 12, 13, 14, 0, 15, 16, 17, 0, 0, 18, 19, 20, 21, 3, 4, 5, 0, 0, 0, 6, 0, 0, 0, 0, 7, 8, 9, 10, 0, 11, 12, 13, 262, 0, 15, 16, 17, 0, 0, 18, 19, 20, 21, 3, 4, 5, 0, 0, 0, 6, 0, 0, 0, 0, 7, 8, 9, 10, 0, 11, 12, 13, 265, 0, 15, 16, 17, 0, 0, 18, 19, 20, 21, 169, 169, 169, 0, 0, 0, 169, 0, 0, 0, 0, 169, 169, 169, 169, 0, 169, 169, 169, 169, 0, 169, 169, 169, 0, 0, 169, 169, 169, 169, 114, 0, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 114, 0, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 0, 0, 0, 114, 180, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 114, 274, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 0, 0, 0, 114, 278, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 114, 281, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 44, 45, 0, 0, 284, 98, 99, 100, 101, 102, 103, 104, 0, 244, 0, 114, 328, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 114, 280, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 0, 0, 0, 114, 0, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 113, 0, 0, 0, 0, 0, 0, 0, 0, 114, 0, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 267, 0, 0, 0, 0, 0, 0, 0, 0, 114, 0, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 268, 0, 0, 0, 0, 0, 0, 0, 0, 114, 0, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 114, 306, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 114, 0, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 116, 117, 118, 119, 120, 121, 122, 123, 124, }; static const YYINT yycheck[] = { 7, 0, 265, 4, 5, 6, 7, 8, 265, 10, 60, 10, 298, 63, 64, 306, 66, 308, 265, 224, 70, 0, 259, 260, 265, 301, 25, 28, 301, 266, 265, 32, 15, 16, 265, 42, 4, 5, 6, 302, 8, 42, 181, 259, 260, 302, 25, 259, 260, 261, 266, 298, 264, 265, 266, 302, 55, 36, 301, 58, 28, 302, 41, 275, 32, 43, 65, 302, 278, 261, 71, 302, 71, 51, 52, 301, 77, 55, 56, 57, 58, 259, 260, 298, 62, 68, 302, 302, 298, 72, 302, 90, 91, 301, 265, 78, 296, 297, 81, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 92, 93, 254, 255, 256, 323, 118, 119, 120, 121, 122, 123, 124, 127, 128, 129, 130, 131, 302, 133, 259, 260, 134, 259, 260, 137, 262, 266, 259, 260, 282, 264, 265, 125, 125, 147, 148, 264, 265, 151, 280, 281, 282, 283, 284, 285, 127, 128, 129, 130, 131, 301, 133, 259, 260, 167, 152, 169, 264, 265, 266, 152, 153, 301, 176, 306, 157, 179, 159, 181, 256, 263, 184, 185, 298, 261, 299, 300, 301, 301, 243, 301, 259, 260, 247, 264, 265, 264, 265, 266, 264, 265, 204, 205, 206, 207, 302, 297, 299, 300, 301, 287, 288, 289, 224, 306, 287, 293, 264, 265, 224, 306, 298, 299, 300, 301, 306, 303, 304, 305, 306, 323, 308, 309, 310, 302, 295, 313, 314, 315, 316, 290, 291, 292, 248, 318, 248, 296, 297, 325, 326, 263, 254, 255, 256, 331, 263, 302, 259, 260, 261, 278, 259, 260, 261, 263, 268, 264, 265, 266, 295, 259, 260, 275, 299, 300, 301, 274, 275, 276, 282, 306, 259, 260, 261, 265, 288, 302, 290, 291, 265, 259, 260, 261, 302, 265, 264, 265, 266, 259, 260, 261, 263, 266, 298, 302, 256, 275, 289, 259, 260, 261, 262, 323, 301, 306, 306, 302, 263, 323, 322, 248, 306, 305, 305, 268, 267, 268, 269, 270, 271, 272, 273, 306, 302, 302, 302, 287, 288, 289, 302, 305, 185, 293, 302, 302, 327, 328, 298, 299, 300, 301, 25, 303, 304, 305, 306, 298, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 302, 324, -1, -1, 327, 328, 329, 330, 256, -1, -1, 259, 260, 261, 262, -1, 259, 260, 261, -1, -1, 264, 265, 266, -1, -1, -1, -1, -1, -1, -1, 274, 275, 276, 277, 278, 279, -1, -1, 287, 288, 289, -1, -1, -1, 293, -1, -1, -1, -1, 298, 299, 300, 301, -1, 303, 304, 305, 306, 302, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, -1, 324, -1, -1, 327, 328, 329, 330, 256, -1, -1, 259, 260, 261, -1, -1, 259, 260, 261, -1, -1, 264, 265, 266, -1, -1, -1, -1, -1, -1, -1, 274, 275, 276, 277, -1, -1, -1, -1, 287, 288, 289, -1, -1, -1, 293, -1, -1, -1, -1, 298, 299, 300, 301, -1, 303, 304, 305, 306, 302, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, -1, 324, -1, -1, 327, 328, 329, 330, 256, -1, -1, 259, 260, 261, -1, -1, 259, 260, 261, -1, -1, 264, 265, 266, -1, 288, 289, 290, 291, 292, -1, -1, 275, 296, 297, -1, -1, -1, -1, 287, 288, 289, -1, -1, -1, 293, -1, -1, -1, -1, 298, 299, 300, 301, -1, 303, 304, 305, 306, 302, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, -1, 324, -1, -1, 327, 328, 329, 330, 259, 260, 261, -1, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, 290, 291, 292, 293, -1, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 259, 260, 261, -1, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, 290, 291, 292, 293, -1, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 259, 260, 261, -1, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, 290, 291, 292, 293, -1, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 259, 260, 261, -1, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, 290, 291, 292, 293, -1, -1, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 259, 260, 261, -1, -1, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, 290, 291, 292, 293, -1, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 259, 260, 261, -1, -1, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, 290, 291, 292, 293, -1, -1, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 259, 260, 261, -1, -1, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, 290, 291, 292, 293, -1, 295, 296, -1, 298, 299, 300, 301, 302, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 259, 260, 261, -1, -1, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, 290, 291, 292, 293, -1, 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 259, 260, 261, -1, -1, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, 290, 291, 292, 293, -1, 295, -1, -1, 298, 299, 300, 301, 302, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 259, 260, 261, -1, -1, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, 290, 291, 292, 293, -1, 295, -1, -1, 298, 299, 300, 301, 302, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 259, 260, 261, -1, -1, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, 290, 291, 292, 293, -1, 295, -1, -1, 298, 299, 300, 301, 302, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 259, 260, 261, -1, -1, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, 290, 291, 292, 293, -1, 295, -1, -1, 298, 299, 300, 301, 302, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 259, 260, 261, -1, -1, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, 290, 291, 292, 293, -1, 295, -1, -1, 298, 299, 300, 301, 302, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 259, 260, 261, -1, -1, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, 290, 291, 292, 293, -1, 295, -1, -1, 298, 299, 300, 301, 302, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 259, 260, 261, -1, -1, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, 290, 291, 292, 293, -1, 295, -1, -1, 298, 299, 300, 301, 302, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 259, 260, 261, -1, -1, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, 290, 291, 292, 293, -1, -1, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 259, 260, 261, -1, -1, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, 290, 291, 292, 293, -1, 295, 296, 297, 298, -1, -1, -1, 302, 303, 304, 305, -1, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 259, 260, 261, -1, -1, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, 290, 291, 292, 293, -1, -1, 296, 297, 298, -1, -1, -1, 302, 303, 304, 305, -1, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 259, 260, 261, -1, -1, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, -1, -1, -1, 293, -1, 295, -1, -1, 298, 299, 300, 301, 302, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 259, 260, 261, -1, -1, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, -1, -1, -1, 293, -1, 295, -1, -1, 298, 299, 300, 301, 302, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 259, 260, 261, -1, -1, 264, 265, 266, -1, -1, -1, -1, -1, -1, -1, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, 290, 291, 292, 293, -1, -1, 296, 297, -1, 299, 300, 301, 302, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 259, 260, 261, -1, -1, 264, 265, 266, -1, -1, -1, -1, -1, -1, -1, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, -1, -1, -1, -1, -1, 293, -1, -1, -1, -1, 298, 299, 300, 301, 302, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 259, 260, 261, -1, -1, 264, 265, 266, -1, -1, -1, -1, -1, -1, -1, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, -1, 259, 260, -1, -1, 293, -1, -1, -1, -1, 298, 299, 300, 301, 302, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 287, 288, 289, -1, -1, -1, 293, -1, -1, -1, -1, 298, 299, 300, 301, -1, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 260, -1, -1, 263, -1, -1, -1, 267, 268, 269, 270, 271, 272, 273, 274, -1, 276, 277, -1, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, 290, 291, 292, 293, 260, -1, 296, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, -1, -1, -1, -1, 287, 288, 289, 260, -1, -1, 293, -1, -1, -1, -1, 298, 299, 300, 301, -1, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 287, 288, 289, -1, -1, -1, 293, -1, -1, -1, -1, 298, 299, 300, 301, -1, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 263, -1, 265, -1, 267, 268, 269, 270, 271, 272, 273, 274, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, 290, 291, 292, 293, -1, -1, 296, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 263, -1, -1, -1, 267, 268, 269, 270, 271, 272, 273, 274, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, 290, 291, 292, 293, -1, -1, 296, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, -1, 308, 309, 310, 265, -1, 313, 314, 315, 316, -1, -1, -1, 274, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, 289, 290, 291, 292, 293, -1, -1, 296, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 259, 260, 261, -1, -1, 264, 265, 266, -1, -1, -1, -1, -1, -1, -1, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 259, 260, 261, -1, -1, 264, 265, 266, -1, -1, -1, -1, 259, 260, 261, 302, 275, 264, 265, 266, 259, 260, 261, -1, -1, 264, 265, 266, 275, -1, -1, -1, 259, 260, 261, -1, 275, 264, 265, 266, 259, 260, 261, 302, -1, 264, 265, 266, 275, -1, -1, -1, 259, 260, 261, 302, 275, 264, 265, 266, 259, 260, 261, 302, -1, 264, 265, 266, 275, -1, -1, -1, 259, 260, 261, 302, 275, 264, 265, 266, 259, 260, 261, 302, -1, 264, 265, 266, 275, -1, -1, -1, 259, 260, 261, 302, 275, 264, 265, 266, 259, 260, 261, 302, -1, 264, 265, 266, 275, -1, -1, -1, 259, 260, 261, 302, 275, 264, 265, 266, -1, -1, -1, 302, -1, -1, -1, -1, 275, -1, -1, -1, -1, 265, -1, 302, -1, -1, -1, -1, -1, -1, 274, 302, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, 302, -1, -1, -1, -1, 265, 278, 279, 280, 281, 282, 283, 284, 285, 274, 302, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, -1, -1, -1, -1, -1, 265, 267, 268, 269, 270, 271, 272, 273, -1, 274, 302, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, -1, -1, -1, -1, -1, 287, 288, 289, -1, -1, 298, 293, -1, -1, 302, 302, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, -1, -1, 313, 314, 315, 316, 287, 288, 289, -1, -1, -1, 293, -1, -1, -1, -1, 298, 299, 300, 301, 302, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 287, 288, 289, -1, -1, -1, 293, -1, -1, -1, -1, 298, 299, 300, 301, 302, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 287, 288, 289, -1, -1, -1, 293, -1, -1, -1, -1, 298, 299, 300, 301, -1, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 287, 288, 289, -1, -1, -1, 293, -1, -1, -1, -1, 298, 299, 300, 301, -1, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 287, 288, 289, -1, -1, -1, 293, -1, -1, -1, -1, 298, 299, 300, 301, -1, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 287, 288, 289, -1, -1, -1, 293, -1, -1, -1, -1, 298, 299, 300, 301, -1, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 287, 288, 289, -1, -1, -1, 293, -1, -1, -1, -1, 298, 299, 300, 301, -1, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 287, 288, 289, -1, -1, -1, 293, -1, -1, -1, -1, 298, 299, 300, 301, -1, 303, 304, 305, 306, -1, 308, 309, 310, -1, -1, 313, 314, 315, 316, 274, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 274, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, -1, -1, 274, 302, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 274, 302, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, -1, -1, 274, 302, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 274, 302, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 259, 260, -1, -1, 302, 267, 268, 269, 270, 271, 272, 273, -1, 260, -1, 274, 302, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 274, 260, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, -1, -1, 274, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 265, -1, -1, -1, -1, -1, -1, -1, -1, 274, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 265, -1, -1, -1, -1, -1, -1, -1, -1, 274, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 265, -1, -1, -1, -1, -1, -1, -1, -1, 274, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 274, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 277, 278, 279, 280, 281, 282, 283, 284, 285, }; #define YYFINAL 25 #ifndef YYDEBUG #define YYDEBUG 0 #endif #define YYMAXTOKEN 331 #define YYUNDFTOKEN 389 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a)) #if YYDEBUG static const char *const yyname[] = { "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"UNEXPECTED","BAD_DECIMAL","NL", "SEMI_COLON","LBRACE","RBRACE","LBOX","RBOX","COMMA","IO_OUT","ASSIGN", "ADD_ASG","SUB_ASG","MUL_ASG","DIV_ASG","MOD_ASG","POW_ASG","QMARK","COLON", "OR","AND","IN","MATCH","EQ","NEQ","LT","LTE","GT","GTE","CAT","GETLINE","PLUS", "MINUS","MUL","DIV","MOD","NOT","UMINUS","IO_IN","PIPE","POW","INC_or_DEC", "DOLLAR","FIELD","LPAREN","RPAREN","DOUBLE","STRING_","RE","ID","D_ID", "FUNCT_ID","BUILTIN","LENGTH","PRINT","PRINTF","SPLIT","MATCH_FUNC","SUB", "GSUB","DO","WHILE","FOR","BREAK","CONTINUE","IF","ELSE","DELETE","BEGIN","END", "EXIT","NEXT","NEXTFILE","RETURN","FUNCTION",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, "illegal-symbol", }; static const char *const yyrule[] = { "$accept : program", "program : program_block", "program : program program_block", "program_block : PA_block", "program_block : function_def", "program_block : outside_error block", "PA_block : block", "$$1 :", "PA_block : BEGIN $$1 block", "$$2 :", "PA_block : END $$2 block", "$$3 :", "PA_block : expr $$3 block_or_separator", "$$4 :", "$$5 :", "PA_block : expr COMMA $$4 expr $$5 block_or_separator", "block : LBRACE statement_list RBRACE", "block : LBRACE error RBRACE", "block_or_separator : block", "block_or_separator : separator", "statement_list : statement", "statement_list : statement_list statement", "statement : block", "statement : expr separator", "statement : separator", "statement : error separator", "statement : BREAK separator", "statement : CONTINUE separator", "statement : return_statement", "statement : NEXT separator", "statement : NEXTFILE separator", "separator : NL", "separator : SEMI_COLON", "expr : cat_expr", "expr : lvalue ASSIGN expr", "expr : lvalue ADD_ASG expr", "expr : lvalue SUB_ASG expr", "expr : lvalue MUL_ASG expr", "expr : lvalue DIV_ASG expr", "expr : lvalue MOD_ASG expr", "expr : lvalue POW_ASG expr", "expr : expr EQ expr", "expr : expr NEQ expr", "expr : expr LT expr", "expr : expr LTE expr", "expr : expr GT expr", "expr : expr GTE expr", "expr : expr MATCH expr", "$$6 :", "expr : expr OR $$6 expr", "$$7 :", "expr : expr AND $$7 expr", "$$8 :", "$$9 :", "expr : expr QMARK $$8 expr COLON $$9 expr", "cat_expr : p_expr", "cat_expr : cat_expr p_expr", "p_expr : DOUBLE", "p_expr : STRING_", "p_expr : ID", "p_expr : LPAREN expr RPAREN", "p_expr : RE", "p_expr : p_expr PLUS p_expr", "p_expr : p_expr MINUS p_expr", "p_expr : p_expr MUL p_expr", "p_expr : p_expr DIV p_expr", "p_expr : p_expr MOD p_expr", "p_expr : p_expr POW p_expr", "p_expr : NOT p_expr", "p_expr : PLUS p_expr", "p_expr : MINUS p_expr", "p_expr : builtin", "p_expr : ID INC_or_DEC", "p_expr : INC_or_DEC lvalue", "p_expr : field INC_or_DEC", "p_expr : INC_or_DEC field", "lvalue : ID", "arglist :", "arglist : args", "args : expr", "args : args COMMA expr", "builtin : BUILTIN mark LPAREN ID RPAREN", "builtin : BUILTIN mark LPAREN arglist RPAREN", "builtin : LENGTH", "mark :", "statement : print mark pr_args pr_direction separator", "print : PRINT", "print : PRINTF", "pr_args : arglist", "pr_args : LPAREN arg2 RPAREN", "pr_args : LPAREN RPAREN", "arg2 : expr COMMA expr", "arg2 : arg2 COMMA expr", "pr_direction :", "pr_direction : IO_OUT expr", "if_front : IF LPAREN expr RPAREN", "statement : if_front statement", "else : ELSE", "statement : if_front statement else statement", "do : DO", "statement : do statement WHILE LPAREN expr RPAREN separator", "while_front : WHILE LPAREN expr RPAREN", "statement : while_front statement", "statement : for1 for2 for3 statement", "for1 : FOR LPAREN SEMI_COLON", "for1 : FOR LPAREN expr SEMI_COLON", "for2 : SEMI_COLON", "for2 : expr SEMI_COLON", "for3 : RPAREN", "for3 : expr RPAREN", "expr : expr IN ID", "expr : LPAREN arg2 RPAREN IN ID", "lvalue : ID mark LBOX args RBOX", "p_expr : ID mark LBOX args RBOX", "p_expr : ID mark LBOX args RBOX INC_or_DEC", "statement : DELETE ID mark LBOX args RBOX separator", "statement : DELETE ID separator", "array_loop_front : FOR LPAREN ID IN ID RPAREN", "statement : array_loop_front statement", "field : FIELD", "field : DOLLAR D_ID", "field : DOLLAR D_ID mark LBOX args RBOX", "field : DOLLAR p_expr", "field : LPAREN field RPAREN", "p_expr : field", "expr : field ASSIGN expr", "expr : field ADD_ASG expr", "expr : field SUB_ASG expr", "expr : field MUL_ASG expr", "expr : field DIV_ASG expr", "expr : field MOD_ASG expr", "expr : field POW_ASG expr", "p_expr : split_front split_back", "split_front : SPLIT LPAREN expr COMMA ID", "split_back : RPAREN", "split_back : COMMA expr RPAREN", "p_expr : MATCH_FUNC LPAREN expr COMMA re_arg RPAREN", "re_arg : expr", "statement : EXIT separator", "statement : EXIT expr separator", "return_statement : RETURN separator", "return_statement : RETURN expr separator", "p_expr : getline", "p_expr : getline fvalue", "p_expr : getline_file p_expr", "p_expr : p_expr PIPE GETLINE", "p_expr : p_expr PIPE GETLINE fvalue", "getline : GETLINE", "fvalue : lvalue", "fvalue : field", "getline_file : getline IO_IN", "getline_file : getline fvalue IO_IN", "p_expr : sub_or_gsub LPAREN re_arg COMMA expr sub_back", "sub_or_gsub : SUB", "sub_or_gsub : GSUB", "sub_back : RPAREN", "sub_back : COMMA fvalue RPAREN", "function_def : funct_start block", "funct_start : funct_head LPAREN f_arglist RPAREN", "funct_head : FUNCTION ID", "funct_head : FUNCTION FUNCT_ID", "f_arglist :", "f_arglist : f_args", "f_args : ID", "f_args : f_args COMMA ID", "outside_error : error", "p_expr : FUNCT_ID mark call_args", "call_args : LPAREN RPAREN", "call_args : ca_front ca_back", "ca_front : LPAREN", "ca_front : ca_front expr COMMA", "ca_front : ca_front ID COMMA", "ca_back : expr RPAREN", "ca_back : ID RPAREN", }; #endif #if YYDEBUG int yydebug; #endif int yyerrflag; int yychar; YYSTYPE yyval; YYSTYPE yylval; int yynerrs; /* define the initial stack-sizes */ #ifdef YYSTACKSIZE #undef YYMAXDEPTH #define YYMAXDEPTH YYSTACKSIZE #else #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else #define YYSTACKSIZE 10000 #define YYMAXDEPTH 10000 #endif #endif #define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; YYINT *s_base; YYINT *s_mark; YYINT *s_last; YYSTYPE *l_base; YYSTYPE *l_mark; } YYSTACKDATA; /* variables for the parser stack */ static YYSTACKDATA yystack; #line 1129 "parse.y" /* * Check for special case where there is a forward reference to a newly * declared function using an array parameter. Because the parameter * mechanism for arrays uses a different byte code, we would like to know * if this is the case so that the function's contents can handle the array * type. */ static void improve_arglist(const char *name) { CA_REC *p, *p2; FCALL_REC *q; for (p = active_arglist; p != 0; p = p->link) { if (p->type == ST_LOCAL_NONE) { for (q = resolve_list; q != 0; q = q->link) { if (!strcmp(q->callee->name, name)) { for (p2 = q->arg_list; p2 != 0; p2 = p2->link) { if (p2->arg_num == p->arg_num) { switch (p2->type) { case ST_NONE: case ST_LOCAL_NONE: break; default: p->type = p2->type; p->sym_p->type = (char) p2->type; TRACE(("...set argument %d of %s to %s\n", p->arg_num, name, type_to_str(p->type))); break; } } } if (p->type != ST_LOCAL_NONE) break; } } if (p->type != ST_LOCAL_NONE) break; } } } /* maintain data for f_arglist to make it visible in funct_start */ static int init_arglist(void) { free_arglist(); return 0; } static SYMTAB * save_arglist(const char *s) { SYMTAB *result = save_id(s); CA_REC *saveit = ZMALLOC(CA_REC); CA_REC *p, *q; if (saveit != 0) { int arg_num = 0; for (p = active_arglist, q = 0; p != 0; q = p, p = p->link) { ++arg_num; } saveit->link = 0; saveit->type = ST_LOCAL_NONE; saveit->arg_num = (short) arg_num; saveit->call_lineno = token_lineno; saveit->sym_p = result; if (q != 0) { q->link = saveit; } else { active_arglist = saveit; } } return result; } static void free_arglist(void) { while (active_arglist != 0) { CA_REC *next = active_arglist->link; ZFREE(active_arglist); active_arglist = next; } } /* resize the code for a user function */ static void resize_fblock(FBLOCK * fbp) { CODEBLOCK *p = ZMALLOC(CODEBLOCK); code2op(_RET0, _HALT); /* make sure there is always a return */ *p = active_code; fbp->code = code_shrink(p, &fbp->size); /* code_shrink() zfrees p */ if (dump_code_flag) add_to_fdump_list(fbp); } /* convert FE_PUSHA to FE_PUSHI or F_PUSH to F_PUSHI */ static void field_A2I(void) { CELL *cp; if (code_ptr[-1].op == FE_PUSHA && code_ptr[-1].ptr == (PTR) 0) { /* On most architectures, the two tests are the same; a good compiler might eliminate one. On LM_DOS, and possibly other segmented architectures, they are not */ code_ptr[-1].op = FE_PUSHI; } else { cp = (CELL *) code_ptr[-1].ptr; if ((cp == field) || ((cp > NF) && (cp <= LAST_PFIELD))) { code_ptr[-2].op = _PUSHI; } else if (cp == NF) { code_ptr[-2].op = NF_PUSHI; code_ptr--; } else { code_ptr[-2].op = F_PUSHI; code_ptr->op = field_addr_to_index(code_ptr[-1].ptr); code_ptr++; } } } /* we've seen an ID in a context where it should be a VAR, check that's consistent with previous usage */ static void check_var(SYMTAB * p) { switch (p->type) { case ST_NONE: /* new id */ p->type = ST_VAR; p->stval.cp = ZMALLOC(CELL); p->stval.cp->type = C_NOINIT; break; case ST_LOCAL_NONE: p->type = ST_LOCAL_VAR; active_funct->typev[p->offset] = ST_LOCAL_VAR; break; case ST_VAR: case ST_LOCAL_VAR: break; default: type_error(p); break; } } /* we've seen an ID in a context where it should be an ARRAY, check that's consistent with previous usage */ static void check_array(SYMTAB * p) { switch (p->type) { case ST_NONE: /* a new array */ p->type = ST_ARRAY; p->stval.array = new_ARRAY(); no_leaks_array(p->stval.array); break; case ST_ARRAY: case ST_LOCAL_ARRAY: break; case ST_LOCAL_NONE: p->type = ST_LOCAL_ARRAY; active_funct->typev[p->offset] = ST_LOCAL_ARRAY; break; default: type_error(p); break; } } static void code_array(SYMTAB * p) { if (is_local(p)) code2op(LA_PUSHA, p->offset); else code2(A_PUSHA, p->stval.array); } /* we've seen an ID as an argument to a user defined function */ static void code_call_id(CA_REC * p, SYMTAB * ip) { static CELL dummy; p->call_offset = code_offset; /* This always gets set now. So that fcall:relocate_arglist works. */ switch (ip->type) { case ST_VAR: p->type = CA_EXPR; code2(_PUSHI, ip->stval.cp); break; case ST_LOCAL_VAR: p->type = CA_EXPR; code2op(L_PUSHI, ip->offset); break; case ST_ARRAY: p->type = CA_ARRAY; code2(A_PUSHA, ip->stval.array); break; case ST_LOCAL_ARRAY: p->type = CA_ARRAY; code2op(LA_PUSHA, ip->offset); break; /* not enough info to code it now; it will have to be patched later */ case ST_NONE: p->type = ST_NONE; p->sym_p = ip; code2(_PUSHI, &dummy); break; case ST_LOCAL_NONE: p->type = ST_LOCAL_NONE; p->type_p = &active_funct->typev[ip->offset]; code2op(L_PUSHI, ip->offset); break; #ifdef DEBUG default: bozo("code_call_id"); #endif } } /* an RE by itself was coded as _MATCH0 , change to push as an expression */ static void RE_as_arg(void) { CELL *cp = ZMALLOC(CELL); code_ptr -= 2; cp->type = C_RE; cp->ptr = code_ptr[1].ptr; code2(_PUSHC, cp); no_leaks_cell_ptr(cp); } /* reset the active_code back to the MAIN block */ static void switch_code_to_main(void) { switch (scope) { case SCOPE_BEGIN: *begin_code_p = active_code; active_code = *main_code_p; break; case SCOPE_END: *end_code_p = active_code; active_code = *main_code_p; break; case SCOPE_FUNCT: active_code = *main_code_p; break; case SCOPE_MAIN: break; } active_funct = (FBLOCK *) 0; scope = SCOPE_MAIN; } void parse(void) { if (yyparse() || compile_error_count != 0) mawk_exit(2); scan_cleanup(); set_code(); /* code must be set before call to resolve_fcalls() */ if (resolve_list) resolve_fcalls(); if (compile_error_count != 0) mawk_exit(2); if (dump_code_flag) { dump_code(); mawk_exit(0); } } #line 1530 "parse.c" #if YYDEBUG #include /* needed for printf */ #endif #include /* needed for malloc, etc */ #include /* needed for memset */ /* allocate initial stack or double stack size, up to YYMAXDEPTH */ static int yygrowstack(YYSTACKDATA *data) { int i; unsigned newsize; YYINT *newss; YYSTYPE *newvs; if ((newsize = data->stacksize) == 0) newsize = YYINITSTACKSIZE; else if (newsize >= YYMAXDEPTH) return YYENOMEM; else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); if (newvs == 0) return YYENOMEM; data->l_base = newvs; data->l_mark = newvs + i; data->stacksize = newsize; data->s_last = data->s_base + newsize - 1; return 0; } #if YYPURE || defined(YY_NO_LEAKS) static void yyfreestack(YYSTACKDATA *data) { free(data->s_base); free(data->l_base); memset(data, 0, sizeof(*data)); } #else #define yyfreestack(data) /* nothing */ #endif #define YYABORT goto yyabort #define YYREJECT goto yyabort #define YYACCEPT goto yyaccept #define YYERROR goto yyerrlab int YYPARSE_DECL() { int yym, yyn, yystate; #if YYDEBUG const char *yys; if ((yys = getenv("YYDEBUG")) != 0) { yyn = *yys; if (yyn >= '0' && yyn <= '9') yydebug = yyn - '0'; } #endif yym = 0; yyn = 0; yynerrs = 0; yyerrflag = 0; yychar = YYEMPTY; yystate = 0; #if YYPURE memset(&yystack, 0, sizeof(yystack)); #endif if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; yystack.s_mark = yystack.s_base; yystack.l_mark = yystack.l_base; yystate = 0; *yystack.s_mark = 0; yyloop: if ((yyn = yydefred[yystate]) != 0) goto yyreduce; if (yychar < 0) { yychar = YYLEX; if (yychar < 0) yychar = YYEOF; #if YYDEBUG if (yydebug) { if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } #endif } if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) { #if YYDEBUG if (yydebug) printf("%sdebug: state %d, shifting to state %d\n", YYPREFIX, yystate, yytable[yyn]); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; yystate = yytable[yyn]; *++yystack.s_mark = yytable[yyn]; *++yystack.l_mark = yylval; yychar = YYEMPTY; if (yyerrflag > 0) --yyerrflag; goto yyloop; } if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) { yyn = yytable[yyn]; goto yyreduce; } if (yyerrflag != 0) goto yyinrecovery; YYERROR_CALL("syntax error"); goto yyerrlab; /* redundant goto avoids 'unused label' warning */ yyerrlab: ++yynerrs; yyinrecovery: if (yyerrflag < 3) { yyerrflag = 3; for (;;) { if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE) { #if YYDEBUG if (yydebug) printf("%sdebug: state %d, error recovery shifting\ to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; yystate = yytable[yyn]; *++yystack.s_mark = yytable[yyn]; *++yystack.l_mark = yylval; goto yyloop; } else { #if YYDEBUG if (yydebug) printf("%sdebug: error recovery discarding state %d\n", YYPREFIX, *yystack.s_mark); #endif if (yystack.s_mark <= yystack.s_base) goto yyabort; --yystack.s_mark; --yystack.l_mark; } } } else { if (yychar == YYEOF) goto yyabort; #if YYDEBUG if (yydebug) { if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } #endif yychar = YYEMPTY; goto yyloop; } yyreduce: #if YYDEBUG if (yydebug) printf("%sdebug: state %d, reducing by rule %d (%s)\n", YYPREFIX, yystate, yyn, yyrule[yyn]); #endif yym = yylen[yyn]; if (yym > 0) yyval = yystack.l_mark[1-yym]; else memset(&yyval, 0, sizeof yyval); switch (yyn) { case 6: #line 152 "parse.y" { /* this do nothing action removes a vacuous warning from Bison */ } break; case 7: #line 157 "parse.y" { be_setup(scope = SCOPE_BEGIN) ; } break; case 8: #line 160 "parse.y" { switch_code_to_main() ; } break; case 9: #line 163 "parse.y" { be_setup(scope = SCOPE_END) ; } break; case 10: #line 166 "parse.y" { switch_code_to_main() ; } break; case 11: #line 169 "parse.y" { code_jmp(_JZ, (INST*)0) ; } break; case 12: #line 172 "parse.y" { patch_jmp( code_ptr ) ; } break; case 13: #line 176 "parse.y" { INST *p1 = CDP(yystack.l_mark[-1].start) ; int len ; code_push(p1, (unsigned) CodeOffset(p1), scope, active_funct) ; code_ptr = p1 ; code2op(_RANGE, 1) ; code_ptr += 3 ; len = (int) code_pop(code_ptr) ; code_ptr += len ; code1(_STOP) ; p1 = CDP(yystack.l_mark[-1].start) ; p1[2].op = CodeOffset(p1 + 1) ; } break; case 14: #line 192 "parse.y" { code1(_STOP) ; } break; case 15: #line 195 "parse.y" { INST *p1 = CDP(yystack.l_mark[-5].start) ; p1[3].op = (int) (CDP(yystack.l_mark[0].start) - (p1 + 1)) ; p1[4].op = CodeOffset(p1 + 1) ; } break; case 16: #line 206 "parse.y" { yyval.start = yystack.l_mark[-1].start ; } break; case 17: #line 208 "parse.y" { yyval.start = code_offset ; /* does nothing won't be executed */ print_flag = getline_flag = paren_cnt = 0 ; yyerrok ; } break; case 19: #line 215 "parse.y" { yyval.start = code_offset ; code1(_PUSHINT) ; code1(0) ; code2(_PRINT, bi_print) ; } break; case 23: #line 228 "parse.y" { code1(_POP) ; } break; case 24: #line 230 "parse.y" { yyval.start = code_offset ; } break; case 25: #line 232 "parse.y" { yyval.start = code_offset ; print_flag = getline_flag = 0 ; paren_cnt = 0 ; yyerrok ; } break; case 26: #line 238 "parse.y" { yyval.start = code_offset ; BC_insert('B', code_ptr+1) ; code2(_JMP, 0) /* don't use code_jmp ! */ ; } break; case 27: #line 241 "parse.y" { yyval.start = code_offset ; BC_insert('C', code_ptr+1) ; code2(_JMP, 0) ; } break; case 28: #line 244 "parse.y" { if ( scope != SCOPE_FUNCT ) compile_error("return outside function body") ; } break; case 29: #line 248 "parse.y" { if ( scope != SCOPE_MAIN ) compile_error( "improper use of next" ) ; yyval.start = code_offset ; code1(_NEXT) ; } break; case 30: #line 254 "parse.y" { if ( scope != SCOPE_MAIN ) compile_error( "improper use of nextfile" ) ; yyval.start = code_offset ; code1(_NEXTFILE) ; } break; case 34: #line 265 "parse.y" { code1(_ASSIGN) ; } break; case 35: #line 266 "parse.y" { code1(_ADD_ASG) ; } break; case 36: #line 267 "parse.y" { code1(_SUB_ASG) ; } break; case 37: #line 268 "parse.y" { code1(_MUL_ASG) ; } break; case 38: #line 269 "parse.y" { code1(_DIV_ASG) ; } break; case 39: #line 270 "parse.y" { code1(_MOD_ASG) ; } break; case 40: #line 271 "parse.y" { code1(_POW_ASG) ; } break; case 41: #line 272 "parse.y" { code1(_EQ) ; } break; case 42: #line 273 "parse.y" { code1(_NEQ) ; } break; case 43: #line 274 "parse.y" { code1(_LT) ; } break; case 44: #line 275 "parse.y" { code1(_LTE) ; } break; case 45: #line 276 "parse.y" { code1(_GT) ; } break; case 46: #line 277 "parse.y" { code1(_GTE) ; } break; case 47: #line 280 "parse.y" { INST *p3 = CDP(yystack.l_mark[0].start) ; if ( p3 == code_ptr - 2 ) { if ( p3->op == _MATCH0 ) p3->op = _MATCH1 ; else /* check for string */ if ( p3->op == _PUSHS ) { CELL *cp = ZMALLOC(CELL) ; cp->type = C_STRING ; cp->ptr = p3[1].ptr ; cast_to_RE(cp) ; no_leaks_re_ptr(cp->ptr) ; code_ptr -= 2 ; code2(_MATCH1, cp->ptr) ; ZFREE(cp) ; } else code1(_MATCH2) ; } else code1(_MATCH2) ; if ( !yystack.l_mark[-1].ival ) code1(_NOT) ; } break; case 48: #line 308 "parse.y" { code1(_TEST) ; code_jmp(_LJNZ, (INST*)0) ; } break; case 49: #line 312 "parse.y" { code1(_TEST) ; patch_jmp(code_ptr) ; } break; case 50: #line 315 "parse.y" { code1(_TEST) ; code_jmp(_LJZ, (INST*)0) ; } break; case 51: #line 319 "parse.y" { code1(_TEST) ; patch_jmp(code_ptr) ; } break; case 52: #line 321 "parse.y" { code_jmp(_JZ, (INST*)0) ; } break; case 53: #line 322 "parse.y" { code_jmp(_JMP, (INST*)0) ; } break; case 54: #line 324 "parse.y" { patch_jmp(code_ptr) ; patch_jmp(CDP(yystack.l_mark[0].start)) ; } break; case 56: #line 329 "parse.y" { code1(_CAT) ; } break; case 57: #line 333 "parse.y" { yyval.start = code_offset ; code2(_PUSHD, yystack.l_mark[0].ptr) ; } break; case 58: #line 335 "parse.y" { yyval.start = code_offset ; code2(_PUSHS, yystack.l_mark[0].ptr) ; } break; case 59: #line 337 "parse.y" { check_var(yystack.l_mark[0].stp) ; yyval.start = code_offset ; if ( is_local(yystack.l_mark[0].stp) ) { code2op(L_PUSHI, yystack.l_mark[0].stp->offset) ; } else code2(_PUSHI, yystack.l_mark[0].stp->stval.cp) ; } break; case 60: #line 345 "parse.y" { yyval.start = yystack.l_mark[-1].start ; } break; case 61: #line 349 "parse.y" { yyval.start = code_offset ; code2(_MATCH0, yystack.l_mark[0].ptr) ; no_leaks_re_ptr(yystack.l_mark[0].ptr); } break; case 62: #line 355 "parse.y" { code1(_ADD) ; } break; case 63: #line 356 "parse.y" { code1(_SUB) ; } break; case 64: #line 357 "parse.y" { code1(_MUL) ; } break; case 65: #line 358 "parse.y" { code1(_DIV) ; } break; case 66: #line 359 "parse.y" { code1(_MOD) ; } break; case 67: #line 360 "parse.y" { code1(_POW) ; } break; case 68: #line 362 "parse.y" { yyval.start = yystack.l_mark[0].start ; code1(_NOT) ; } break; case 69: #line 364 "parse.y" { yyval.start = yystack.l_mark[0].start ; code1(_UPLUS) ; } break; case 70: #line 366 "parse.y" { yyval.start = yystack.l_mark[0].start ; code1(_UMINUS) ; } break; case 72: #line 371 "parse.y" { check_var(yystack.l_mark[-1].stp) ; yyval.start = code_offset ; code_address(yystack.l_mark[-1].stp) ; if ( yystack.l_mark[0].ival == '+' ) code1(_POST_INC) ; else code1(_POST_DEC) ; } break; case 73: #line 379 "parse.y" { yyval.start = yystack.l_mark[0].start ; if ( yystack.l_mark[-1].ival == '+' ) code1(_PRE_INC) ; else code1(_PRE_DEC) ; } break; case 74: #line 386 "parse.y" { if (yystack.l_mark[0].ival == '+' ) code1(F_POST_INC ) ; else code1(F_POST_DEC) ; } break; case 75: #line 390 "parse.y" { yyval.start = yystack.l_mark[0].start ; if ( yystack.l_mark[-1].ival == '+' ) code1(F_PRE_INC) ; else code1( F_PRE_DEC) ; } break; case 76: #line 397 "parse.y" { yyval.start = code_offset ; check_var(yystack.l_mark[0].stp) ; code_address(yystack.l_mark[0].stp) ; } break; case 77: #line 405 "parse.y" { yyval.ival = 0 ; } break; case 79: #line 410 "parse.y" { yyval.ival = 1 ; } break; case 80: #line 412 "parse.y" { yyval.ival = yystack.l_mark[-2].ival + 1 ; } break; case 81: #line 417 "parse.y" { const BI_REC *p = yystack.l_mark[-4].bip ; yyval.start = yystack.l_mark[-3].start ; if ( (int)p->min_args > 1 || (int)p->max_args < 1 ) compile_error( "wrong number of arguments in call to %s" , p->name ) ; /* if we have length(array), emit a different code */ if ( p->fp == bi_length && is_array(yystack.l_mark[-1].stp) ) { check_array(yystack.l_mark[-1].stp) ; code_array(yystack.l_mark[-1].stp) ; { code1(_PUSHINT) ; code1(1) ; } code1(A_LENGTH) ; } else { check_var(yystack.l_mark[-1].stp); if ( is_local(yystack.l_mark[-1].stp) ) { code1(L_PUSHI); code1(yystack.l_mark[-1].stp->offset) ; } else { code2(_PUSHI, yystack.l_mark[-1].stp->stval.cp) ; } if ( p->min_args != p->max_args ) /* variable args */ { code1(_PUSHINT) ; code1(1) ; } code2(_BUILTIN, p->fp) ; } } break; case 82: #line 440 "parse.y" { const BI_REC *p = yystack.l_mark[-4].bip ; yyval.start = yystack.l_mark[-3].start ; if ( (int)p->min_args > yystack.l_mark[-1].ival || (int)p->max_args < yystack.l_mark[-1].ival ) compile_error( "wrong number of arguments in call to %s" , p->name ) ; if ( p->min_args != p->max_args ) /* variable args */ { code1(_PUSHINT) ; code1(yystack.l_mark[-1].ival) ; } code2(_BUILTIN , p->fp) ; } break; case 83: #line 451 "parse.y" { yyval.start = code_offset ; code1(_PUSHINT) ; code1(0) ; code2(_BUILTIN, yystack.l_mark[0].bip->fp) ; } break; case 84: #line 460 "parse.y" { yyval.start = code_offset ; } break; case 85: #line 465 "parse.y" { code2(_PRINT, yystack.l_mark[-4].fp) ; if ( yystack.l_mark[-4].fp == bi_printf && yystack.l_mark[-2].ival == 0 ) compile_error("no arguments in call to printf") ; print_flag = 0 ; yyval.start = yystack.l_mark[-3].start ; } break; case 86: #line 473 "parse.y" { yyval.fp = bi_print ; print_flag = 1 ;} break; case 87: #line 474 "parse.y" { yyval.fp = bi_printf ; print_flag = 1 ; } break; case 88: #line 477 "parse.y" { code2op(_PUSHINT, yystack.l_mark[0].ival) ; } break; case 89: #line 479 "parse.y" { yyval.ival = yystack.l_mark[-1].arg2p->cnt ; zfree(yystack.l_mark[-1].arg2p,sizeof(ARG2_REC)) ; code2op(_PUSHINT, yyval.ival) ; } break; case 90: #line 483 "parse.y" { yyval.ival=0 ; code2op(_PUSHINT, 0) ; } break; case 91: #line 487 "parse.y" { yyval.arg2p = (ARG2_REC*) zmalloc(sizeof(ARG2_REC)) ; yyval.arg2p->start = yystack.l_mark[-2].start ; yyval.arg2p->cnt = 2 ; } break; case 92: #line 492 "parse.y" { yyval.arg2p = yystack.l_mark[-2].arg2p ; yyval.arg2p->cnt++ ; } break; case 94: #line 497 "parse.y" { code2op(_PUSHINT, yystack.l_mark[-1].ival) ; } break; case 95: #line 504 "parse.y" { yyval.start = yystack.l_mark[-1].start ; eat_nl() ; code_jmp(_JZ, (INST*)0) ; } break; case 96: #line 509 "parse.y" { patch_jmp( code_ptr ) ; } break; case 97: #line 512 "parse.y" { eat_nl() ; code_jmp(_JMP, (INST*)0) ; } break; case 98: #line 517 "parse.y" { patch_jmp(code_ptr) ; patch_jmp(CDP(yystack.l_mark[0].start)) ; } break; case 99: #line 526 "parse.y" { eat_nl() ; BC_new() ; } break; case 100: #line 531 "parse.y" { yyval.start = yystack.l_mark[-5].start ; code_jmp(_JNZ, CDP(yystack.l_mark[-5].start)) ; BC_clear(code_ptr, CDP(yystack.l_mark[-2].start)) ; } break; case 101: #line 537 "parse.y" { eat_nl() ; BC_new() ; yyval.start = yystack.l_mark[-1].start ; /* check if const expression */ if ( code_ptr - 2 == CDP(yystack.l_mark[-1].start) && code_ptr[-2].op == _PUSHD && *(double*)code_ptr[-1].ptr != 0.0 ) code_ptr -= 2 ; else { INST *p3 = CDP(yystack.l_mark[-1].start) ; code_push(p3, (unsigned) CodeOffset(p3), scope, active_funct) ; code_ptr = p3 ; code2(_JMP, (INST*)0) ; /* code2() not code_jmp() */ } } break; case 102: #line 557 "parse.y" { int saved_offset ; int len ; INST *p1 = CDP(yystack.l_mark[-1].start) ; INST *p2 = CDP(yystack.l_mark[0].start) ; if ( p1 != p2 ) /* real test in loop */ { p1[1].op = CodeOffset(p1 + 1) ; saved_offset = code_offset ; len = (int) code_pop(code_ptr) ; code_ptr += len ; code_jmp(_JNZ, CDP(yystack.l_mark[0].start)) ; BC_clear(code_ptr, CDP(saved_offset)) ; } else /* while(1) */ { code_jmp(_JMP, p1) ; BC_clear(code_ptr, CDP(yystack.l_mark[0].start)) ; } } break; case 103: #line 583 "parse.y" { int cont_offset = code_offset ; unsigned len = code_pop(code_ptr) ; INST *p2 = CDP(yystack.l_mark[-2].start) ; INST *p4 = CDP(yystack.l_mark[0].start) ; code_ptr += len ; if ( p2 != p4 ) /* real test in for2 */ { p4[-1].op = CodeOffset(p4 - 1) ; len = code_pop(code_ptr) ; code_ptr += len ; code_jmp(_JNZ, CDP(yystack.l_mark[0].start)) ; } else /* for(;;) */ code_jmp(_JMP, p4) ; BC_clear(code_ptr, CDP(cont_offset)) ; } break; case 104: #line 606 "parse.y" { yyval.start = code_offset ; } break; case 105: #line 608 "parse.y" { yyval.start = yystack.l_mark[-1].start ; code1(_POP) ; } break; case 106: #line 611 "parse.y" { yyval.start = code_offset ; } break; case 107: #line 613 "parse.y" { if ( code_ptr - 2 == CDP(yystack.l_mark[-1].start) && code_ptr[-2].op == _PUSHD && * (double*) code_ptr[-1].ptr != 0.0 ) code_ptr -= 2 ; else { INST *p1 = CDP(yystack.l_mark[-1].start) ; code_push(p1, (unsigned) CodeOffset(p1), scope, active_funct) ; code_ptr = p1 ; code2(_JMP, (INST*)0) ; } } break; case 108: #line 630 "parse.y" { eat_nl() ; BC_new() ; code_push((INST*)0,0, scope, active_funct) ; } break; case 109: #line 634 "parse.y" { INST *p1 = CDP(yystack.l_mark[-1].start) ; eat_nl() ; BC_new() ; code1(_POP) ; code_push(p1, (unsigned) CodeOffset(p1), scope, active_funct) ; code_ptr -= code_ptr - p1 ; } break; case 110: #line 647 "parse.y" { check_array(yystack.l_mark[0].stp) ; code_array(yystack.l_mark[0].stp) ; code1(A_TEST) ; } break; case 111: #line 652 "parse.y" { yyval.start = yystack.l_mark[-3].arg2p->start ; code2op(A_CAT, yystack.l_mark[-3].arg2p->cnt) ; zfree(yystack.l_mark[-3].arg2p, sizeof(ARG2_REC)) ; check_array(yystack.l_mark[0].stp) ; code_array(yystack.l_mark[0].stp) ; code1(A_TEST) ; } break; case 112: #line 663 "parse.y" { if ( yystack.l_mark[-1].ival > 1 ) { code2op(A_CAT, yystack.l_mark[-1].ival) ; } check_array(yystack.l_mark[-4].stp) ; if( is_local(yystack.l_mark[-4].stp) ) { code2op(LAE_PUSHA, yystack.l_mark[-4].stp->offset) ; } else code2(AE_PUSHA, yystack.l_mark[-4].stp->stval.array) ; yyval.start = yystack.l_mark[-3].start ; } break; case 113: #line 676 "parse.y" { if ( yystack.l_mark[-1].ival > 1 ) { code2op(A_CAT, yystack.l_mark[-1].ival) ; } check_array(yystack.l_mark[-4].stp) ; if( is_local(yystack.l_mark[-4].stp) ) { code2op(LAE_PUSHI, yystack.l_mark[-4].stp->offset) ; } else code2(AE_PUSHI, yystack.l_mark[-4].stp->stval.array) ; yyval.start = yystack.l_mark[-3].start ; } break; case 114: #line 688 "parse.y" { if ( yystack.l_mark[-2].ival > 1 ) { code2op(A_CAT,yystack.l_mark[-2].ival) ; } check_array(yystack.l_mark[-5].stp) ; if( is_local(yystack.l_mark[-5].stp) ) { code2op(LAE_PUSHA, yystack.l_mark[-5].stp->offset) ; } else code2(AE_PUSHA, yystack.l_mark[-5].stp->stval.array) ; if ( yystack.l_mark[0].ival == '+' ) code1(_POST_INC) ; else code1(_POST_DEC) ; yyval.start = yystack.l_mark[-4].start ; } break; case 115: #line 705 "parse.y" { yyval.start = yystack.l_mark[-4].start ; if ( yystack.l_mark[-2].ival > 1 ) { code2op(A_CAT, yystack.l_mark[-2].ival) ; } check_array(yystack.l_mark[-5].stp) ; code_array(yystack.l_mark[-5].stp) ; code1(A_DEL) ; } break; case 116: #line 713 "parse.y" { yyval.start = code_offset ; check_array(yystack.l_mark[-1].stp) ; code_array(yystack.l_mark[-1].stp) ; code1(DEL_A) ; } break; case 117: #line 724 "parse.y" { eat_nl() ; BC_new() ; yyval.start = code_offset ; check_var(yystack.l_mark[-3].stp) ; code_address(yystack.l_mark[-3].stp) ; check_array(yystack.l_mark[-1].stp) ; code_array(yystack.l_mark[-1].stp) ; code2(SET_ALOOP, (INST*)0) ; } break; case 118: #line 738 "parse.y" { INST *p2 = CDP(yystack.l_mark[0].start) ; p2[-1].op = CodeOffset(p2 - 1) ; BC_clear( code_ptr+2 , code_ptr) ; code_jmp(ALOOP, p2) ; code1(POP_AL) ; } break; case 119: #line 755 "parse.y" { yyval.start = code_offset ; code2(F_PUSHA, yystack.l_mark[0].cp) ; } break; case 120: #line 757 "parse.y" { check_var(yystack.l_mark[0].stp) ; yyval.start = code_offset ; if ( is_local(yystack.l_mark[0].stp) ) { code2op(L_PUSHI, yystack.l_mark[0].stp->offset) ; } else code2(_PUSHI, yystack.l_mark[0].stp->stval.cp) ; CODE_FE_PUSHA() ; } break; case 121: #line 766 "parse.y" { if ( yystack.l_mark[-1].ival > 1 ) { code2op(A_CAT, yystack.l_mark[-1].ival) ; } check_array(yystack.l_mark[-4].stp) ; if( is_local(yystack.l_mark[-4].stp) ) { code2op(LAE_PUSHI, yystack.l_mark[-4].stp->offset) ; } else code2(AE_PUSHI, yystack.l_mark[-4].stp->stval.array) ; CODE_FE_PUSHA() ; yyval.start = yystack.l_mark[-3].start ; } break; case 122: #line 780 "parse.y" { yyval.start = yystack.l_mark[0].start ; CODE_FE_PUSHA() ; } break; case 123: #line 782 "parse.y" { yyval.start = yystack.l_mark[-1].start ; } break; case 124: #line 786 "parse.y" { field_A2I() ; } break; case 125: #line 789 "parse.y" { code1(F_ASSIGN) ; } break; case 126: #line 790 "parse.y" { code1(F_ADD_ASG) ; } break; case 127: #line 791 "parse.y" { code1(F_SUB_ASG) ; } break; case 128: #line 792 "parse.y" { code1(F_MUL_ASG) ; } break; case 129: #line 793 "parse.y" { code1(F_DIV_ASG) ; } break; case 130: #line 794 "parse.y" { code1(F_MOD_ASG) ; } break; case 131: #line 795 "parse.y" { code1(F_POW_ASG) ; } break; case 132: #line 802 "parse.y" { code2(_BUILTIN, bi_split) ; } break; case 133: #line 806 "parse.y" { yyval.start = yystack.l_mark[-2].start ; check_array(yystack.l_mark[0].stp) ; code_array(yystack.l_mark[0].stp) ; } break; case 134: #line 813 "parse.y" { code2(_PUSHI, &fs_shadow) ; } break; case 135: #line 815 "parse.y" { if ( CDP(yystack.l_mark[-1].start) == code_ptr - 2 ) { if ( code_ptr[-2].op == _MATCH0 ) RE_as_arg() ; else if ( code_ptr[-2].op == _PUSHS ) { CELL *cp = ZMALLOC(CELL) ; cp->type = C_STRING ; cp->ptr = code_ptr[-1].ptr ; cast_for_split(cp) ; code_ptr[-2].op = _PUSHC ; code_ptr[-1].ptr = (PTR) cp ; no_leaks_cell(cp); } } } break; case 136: #line 840 "parse.y" { yyval.start = yystack.l_mark[-3].start ; code2(_BUILTIN, bi_match) ; } break; case 137: #line 847 "parse.y" { INST *p1 = CDP(yystack.l_mark[0].start) ; if ( p1 == code_ptr - 2 ) { if ( p1->op == _MATCH0 ) RE_as_arg() ; else if ( p1->op == _PUSHS ) { CELL *cp = ZMALLOC(CELL) ; cp->type = C_STRING ; cp->ptr = p1[1].ptr ; cast_to_RE(cp) ; p1->op = _PUSHC ; p1[1].ptr = (PTR) cp ; no_leaks_cell(cp); } } } break; case 138: #line 871 "parse.y" { yyval.start = code_offset ; code1(_EXIT0) ; } break; case 139: #line 874 "parse.y" { yyval.start = yystack.l_mark[-1].start ; code1(_EXIT) ; } break; case 140: #line 878 "parse.y" { yyval.start = code_offset ; code1(_RET0) ; } break; case 141: #line 881 "parse.y" { yyval.start = yystack.l_mark[-1].start ; code1(_RET) ; } break; case 142: #line 887 "parse.y" { yyval.start = code_offset ; code2(F_PUSHA, &field[0]) ; code1(_PUSHINT) ; code1(0) ; code2(_BUILTIN, bi_getline) ; getline_flag = 0 ; } break; case 143: #line 894 "parse.y" { yyval.start = yystack.l_mark[0].start ; code1(_PUSHINT) ; code1(0) ; code2(_BUILTIN, bi_getline) ; getline_flag = 0 ; } break; case 144: #line 900 "parse.y" { code1(_PUSHINT) ; code1(F_IN) ; code2(_BUILTIN, bi_getline) ; /* getline_flag already off in yylex() */ } break; case 145: #line 905 "parse.y" { code2(F_PUSHA, &field[0]) ; code1(_PUSHINT) ; code1(PIPE_IN) ; code2(_BUILTIN, bi_getline) ; } break; case 146: #line 910 "parse.y" { code1(_PUSHINT) ; code1(PIPE_IN) ; code2(_BUILTIN, bi_getline) ; } break; case 147: #line 916 "parse.y" { getline_flag = 1 ; } break; case 150: #line 921 "parse.y" { yyval.start = code_offset ; code2(F_PUSHA, field+0) ; } break; case 151: #line 925 "parse.y" { yyval.start = yystack.l_mark[-1].start ; } break; case 152: #line 933 "parse.y" { INST *p5 = CDP(yystack.l_mark[-1].start) ; INST *p6 = CDP(yystack.l_mark[0].start) ; if ( p6 - p5 == 2 && p5->op == _PUSHS ) { /* cast from STRING to REPL at compile time */ CELL *cp = ZMALLOC(CELL) ; cp->type = C_STRING ; cp->ptr = p5[1].ptr ; cast_to_REPL(cp) ; p5->op = _PUSHC ; p5[1].ptr = (PTR) cp ; no_leaks_cell(cp); } code2(_BUILTIN, yystack.l_mark[-5].fp) ; yyval.start = yystack.l_mark[-3].start ; } break; case 153: #line 952 "parse.y" { yyval.fp = bi_sub ; } break; case 154: #line 953 "parse.y" { yyval.fp = bi_gsub ; } break; case 155: #line 958 "parse.y" { yyval.start = code_offset ; code2(F_PUSHA, &field[0]) ; } break; case 156: #line 963 "parse.y" { yyval.start = yystack.l_mark[-1].start ; } break; case 157: #line 971 "parse.y" { resize_fblock(yystack.l_mark[-1].fbp) ; restore_ids() ; switch_code_to_main() ; } break; case 158: #line 980 "parse.y" { eat_nl() ; scope = SCOPE_FUNCT ; active_funct = yystack.l_mark[-3].fbp ; *main_code_p = active_code ; yystack.l_mark[-3].fbp->nargs = (unsigned short) yystack.l_mark[-1].ival ; if ( yystack.l_mark[-1].ival ) yystack.l_mark[-3].fbp->typev = (char *) memset( zmalloc((size_t) yystack.l_mark[-1].ival), ST_LOCAL_NONE, (size_t) yystack.l_mark[-1].ival) ; else yystack.l_mark[-3].fbp->typev = (char *) 0 ; code_ptr = code_base = (INST *) zmalloc(INST_BYTES(PAGESZ)); code_limit = code_base + PAGESZ ; code_warn = code_limit - CODEWARN ; improve_arglist(yystack.l_mark[-3].fbp->name); free_arglist(); } break; case 159: #line 1001 "parse.y" { FBLOCK *fbp ; if ( yystack.l_mark[0].stp->type == ST_NONE ) { yystack.l_mark[0].stp->type = ST_FUNCT ; fbp = yystack.l_mark[0].stp->stval.fbp = (FBLOCK *) zmalloc(sizeof(FBLOCK)) ; fbp->name = yystack.l_mark[0].stp->name ; fbp->code = (INST*) 0 ; } else { type_error( yystack.l_mark[0].stp ) ; /* this FBLOCK will not be put in the symbol table */ fbp = (FBLOCK*) zmalloc(sizeof(FBLOCK)) ; fbp->name = "" ; } yyval.fbp = fbp ; } break; case 160: #line 1024 "parse.y" { yyval.fbp = yystack.l_mark[0].fbp ; if ( yystack.l_mark[0].fbp->code ) compile_error("redefinition of %s" , yystack.l_mark[0].fbp->name) ; } break; case 161: #line 1030 "parse.y" { yyval.ival = init_arglist() ; } break; case 163: #line 1035 "parse.y" { init_arglist(); yystack.l_mark[0].stp = save_arglist(yystack.l_mark[0].stp->name) ; yystack.l_mark[0].stp->offset = 0 ; yyval.ival = 1 ; } break; case 164: #line 1041 "parse.y" { if ( is_local(yystack.l_mark[0].stp) ) compile_error("%s is duplicated in argument list", yystack.l_mark[0].stp->name) ; else { yystack.l_mark[0].stp = save_arglist(yystack.l_mark[0].stp->name) ; yystack.l_mark[0].stp->offset = (unsigned char) yystack.l_mark[-2].ival ; yyval.ival = yystack.l_mark[-2].ival + 1 ; } } break; case 165: #line 1053 "parse.y" { /* we may have to recover from a bungled function definition */ /* can have local ids, before code scope changes */ restore_ids() ; switch_code_to_main() ; } break; case 166: #line 1066 "parse.y" { yyval.start = yystack.l_mark[-1].start ; code2(_CALL, yystack.l_mark[-2].fbp) ; if ( yystack.l_mark[0].ca_p ) code1(yystack.l_mark[0].ca_p->arg_num+1) ; else code1(0) ; check_fcall(yystack.l_mark[-2].fbp, scope, code_move_level, active_funct, yystack.l_mark[0].ca_p) ; } break; case 167: #line 1077 "parse.y" { yyval.ca_p = (CA_REC *) 0 ; } break; case 168: #line 1079 "parse.y" { yyval.ca_p = yystack.l_mark[0].ca_p ; yyval.ca_p->link = yystack.l_mark[-1].ca_p ; yyval.ca_p->arg_num = (short) (yystack.l_mark[-1].ca_p ? yystack.l_mark[-1].ca_p->arg_num+1 : 0) ; yyval.ca_p->call_lineno = token_lineno; } break; case 169: #line 1095 "parse.y" { yyval.ca_p = (CA_REC *) 0 ; } break; case 170: #line 1097 "parse.y" { yyval.ca_p = ZMALLOC(CA_REC) ; yyval.ca_p->link = yystack.l_mark[-2].ca_p ; yyval.ca_p->type = CA_EXPR ; yyval.ca_p->arg_num = (short) (yystack.l_mark[-2].ca_p ? yystack.l_mark[-2].ca_p->arg_num+1 : 0) ; yyval.ca_p->call_offset = code_offset ; yyval.ca_p->call_lineno = token_lineno; } break; case 171: #line 1105 "parse.y" { yyval.ca_p = ZMALLOC(CA_REC) ; yyval.ca_p->type = ST_NONE ; yyval.ca_p->link = yystack.l_mark[-2].ca_p ; yyval.ca_p->arg_num = (short) (yystack.l_mark[-2].ca_p ? yystack.l_mark[-2].ca_p->arg_num+1 : 0) ; yyval.ca_p->call_lineno = token_lineno; code_call_id(yyval.ca_p, yystack.l_mark[-1].stp) ; } break; case 172: #line 1116 "parse.y" { yyval.ca_p = ZMALLOC(CA_REC) ; yyval.ca_p->type = CA_EXPR ; yyval.ca_p->call_offset = code_offset ; } break; case 173: #line 1122 "parse.y" { yyval.ca_p = ZMALLOC(CA_REC) ; yyval.ca_p->type = ST_NONE ; code_call_id(yyval.ca_p, yystack.l_mark[-1].stp) ; } break; #line 2823 "parse.c" } yystack.s_mark -= yym; yystate = *yystack.s_mark; yystack.l_mark -= yym; yym = yylhs[yyn]; if (yystate == 0 && yym == 0) { #if YYDEBUG if (yydebug) printf("%sdebug: after reduction, shifting from state 0 to\ state %d\n", YYPREFIX, YYFINAL); #endif yystate = YYFINAL; *++yystack.s_mark = YYFINAL; *++yystack.l_mark = yyval; if (yychar < 0) { yychar = YYLEX; if (yychar < 0) yychar = YYEOF; #if YYDEBUG if (yydebug) { if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } #endif } if (yychar == YYEOF) goto yyaccept; goto yyloop; } if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate) yystate = yytable[yyn]; else yystate = yydgoto[yym]; #if YYDEBUG if (yydebug) printf("%sdebug: after reduction, shifting from state %d \ to state %d\n", YYPREFIX, *yystack.s_mark, yystate); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; *++yystack.s_mark = (YYINT) yystate; *++yystack.l_mark = yyval; goto yyloop; yyoverflow: YYERROR_CALL("yacc stack overflow"); yyabort: yyfreestack(&yystack); return (1); yyaccept: yyfreestack(&yystack); return (0); } mawk-1.3.4-20200120/init.h0000644000175100001440000000212212773573451013210 0ustar tomusers/******************************************** init.h copyright 2009-2012,2016, Thomas E. Dickey copyright 1991, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: init.h,v 1.6 2016/09/30 23:37:13 tom Exp $ */ /* init.h */ #ifndef INIT_H #define INIT_H #include "symtype.h" /* nodes to link file names for multiple -f option */ typedef struct pfile { struct pfile *link; char *fname; } PFILE; extern PFILE *pfile_list; extern char *sprintf_buff, *sprintf_limit; void initialize(int, char **); void code_init(void); void code_cleanup(void); void compile_cleanup(void); void scan_init(const char *); void bi_vars_init(void); void bi_funct_init(void); void print_init(void); void kw_init(void); void field_init(void); void fpe_init(void); void load_environ(ARRAY); void set_stdio(void); void print_version(void); int is_cmdline_assign(char *); #endif /* INIT_H */ mawk-1.3.4-20200120/config.sub0000755000175100001440000007557113536304670014072 0ustar tomusers#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2019 Free Software Foundation, Inc. timestamp='2019-06-30' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Split fields of configuration type # shellcheck disable=SC2162 IFS="-" read field1 field2 field3 field4 <&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova*) basic_machine=$field1 os=$maybe_os ;; android-linux) basic_machine=$field1-unknown os=linux-android ;; *) basic_machine=$field1-$field2 os=$field3 ;; esac ;; *-*) # A lone config we happen to match not fitting any pattern case $field1-$field2 in decstation-3100) basic_machine=mips-dec os= ;; *-*) # Second component is usually, but not always the OS case $field2 in # Prevent following clause from handling this valid os sun*os*) basic_machine=$field1 os=$field2 ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ | unicom* | ibm* | next | hp | isi* | apollo | altos* \ | convergent* | ncr* | news | 32* | 3600* | 3100* \ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ | ultra | tti* | harris | dolphin | highlevel | gould \ | cbm | ns | masscomp | apple | axis | knuth | cray \ | microblaze* | sim | cisco \ | oki | wec | wrs | winbond) basic_machine=$field1-$field2 os= ;; *) basic_machine=$field1 os=$field2 ;; esac ;; esac ;; *) # Convert single-component short-hands not valid as part of # multi-component configurations. case $field1 in 386bsd) basic_machine=i386-pc os=bsd ;; a29khif) basic_machine=a29k-amd os=udi ;; adobe68k) basic_machine=m68010-adobe os=scout ;; alliant) basic_machine=fx80-alliant os= ;; altos | altos3068) basic_machine=m68k-altos os= ;; am29k) basic_machine=a29k-none os=bsd ;; amdahl) basic_machine=580-amdahl os=sysv ;; amiga) basic_machine=m68k-unknown os= ;; amigaos | amigados) basic_machine=m68k-unknown os=amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=sysv4 ;; apollo68) basic_machine=m68k-apollo os=sysv ;; apollo68bsd) basic_machine=m68k-apollo os=bsd ;; aros) basic_machine=i386-pc os=aros ;; aux) basic_machine=m68k-apple os=aux ;; balance) basic_machine=ns32k-sequent os=dynix ;; blackfin) basic_machine=bfin-unknown os=linux ;; cegcc) basic_machine=arm-unknown os=cegcc ;; convex-c1) basic_machine=c1-convex os=bsd ;; convex-c2) basic_machine=c2-convex os=bsd ;; convex-c32) basic_machine=c32-convex os=bsd ;; convex-c34) basic_machine=c34-convex os=bsd ;; convex-c38) basic_machine=c38-convex os=bsd ;; cray) basic_machine=j90-cray os=unicos ;; crds | unos) basic_machine=m68k-crds os= ;; da30) basic_machine=m68k-da30 os= ;; decstation | pmax | pmin | dec3100 | decstatn) basic_machine=mips-dec os= ;; delta88) basic_machine=m88k-motorola os=sysv3 ;; dicos) basic_machine=i686-pc os=dicos ;; djgpp) basic_machine=i586-pc os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=ose ;; gmicro) basic_machine=tron-gmicro os=sysv ;; go32) basic_machine=i386-pc os=go32 ;; h8300hms) basic_machine=h8300-hitachi os=hms ;; h8300xray) basic_machine=h8300-hitachi os=xray ;; h8500hms) basic_machine=h8500-hitachi os=hms ;; harris) basic_machine=m88k-harris os=sysv3 ;; hp300 | hp300hpux) basic_machine=m68k-hp os=hpux ;; hp300bsd) basic_machine=m68k-hp os=bsd ;; hppaosf) basic_machine=hppa1.1-hp os=osf ;; hppro) basic_machine=hppa1.1-hp os=proelf ;; i386mach) basic_machine=i386-mach os=mach ;; isi68 | isi) basic_machine=m68k-isi os=sysv ;; m68knommu) basic_machine=m68k-unknown os=linux ;; magnum | m3230) basic_machine=mips-mips os=sysv ;; merlin) basic_machine=ns32k-utek os=sysv ;; mingw64) basic_machine=x86_64-pc os=mingw64 ;; mingw32) basic_machine=i686-pc os=mingw32 ;; mingw32ce) basic_machine=arm-unknown os=mingw32ce ;; monitor) basic_machine=m68k-rom68k os=coff ;; morphos) basic_machine=powerpc-unknown os=morphos ;; moxiebox) basic_machine=moxie-unknown os=moxiebox ;; msdos) basic_machine=i386-pc os=msdos ;; msys) basic_machine=i686-pc os=msys ;; mvs) basic_machine=i370-ibm os=mvs ;; nacl) basic_machine=le32-unknown os=nacl ;; ncr3000) basic_machine=i486-ncr os=sysv4 ;; netbsd386) basic_machine=i386-pc os=netbsd ;; netwinder) basic_machine=armv4l-rebel os=linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=newsos ;; news1000) basic_machine=m68030-sony os=newsos ;; necv70) basic_machine=v70-nec os=sysv ;; nh3000) basic_machine=m68k-harris os=cxux ;; nh[45]000) basic_machine=m88k-harris os=cxux ;; nindy960) basic_machine=i960-intel os=nindy ;; mon960) basic_machine=i960-intel os=mon960 ;; nonstopux) basic_machine=mips-compaq os=nonstopux ;; os400) basic_machine=powerpc-ibm os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=ose ;; os68k) basic_machine=m68k-none os=os68k ;; paragon) basic_machine=i860-intel os=osf ;; parisc) basic_machine=hppa-unknown os=linux ;; pw32) basic_machine=i586-unknown os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=rdos ;; rdos32) basic_machine=i386-pc os=rdos ;; rom68k) basic_machine=m68k-rom68k os=coff ;; sa29200) basic_machine=a29k-amd os=udi ;; sei) basic_machine=mips-sei os=seiux ;; sequent) basic_machine=i386-sequent os= ;; sps7) basic_machine=m68k-bull os=sysv2 ;; st2000) basic_machine=m68k-tandem os= ;; stratus) basic_machine=i860-stratus os=sysv4 ;; sun2) basic_machine=m68000-sun os= ;; sun2os3) basic_machine=m68000-sun os=sunos3 ;; sun2os4) basic_machine=m68000-sun os=sunos4 ;; sun3) basic_machine=m68k-sun os= ;; sun3os3) basic_machine=m68k-sun os=sunos3 ;; sun3os4) basic_machine=m68k-sun os=sunos4 ;; sun4) basic_machine=sparc-sun os= ;; sun4os3) basic_machine=sparc-sun os=sunos3 ;; sun4os4) basic_machine=sparc-sun os=sunos4 ;; sun4sol2) basic_machine=sparc-sun os=solaris2 ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun os= ;; sv1) basic_machine=sv1-cray os=unicos ;; symmetry) basic_machine=i386-sequent os=dynix ;; t3e) basic_machine=alphaev5-cray os=unicos ;; t90) basic_machine=t90-cray os=unicos ;; toad1) basic_machine=pdp10-xkl os=tops20 ;; tpf) basic_machine=s390x-ibm os=tpf ;; udi29k) basic_machine=a29k-amd os=udi ;; ultra3) basic_machine=a29k-nyu os=sym1 ;; v810 | necv810) basic_machine=v810-nec os=none ;; vaxv) basic_machine=vax-dec os=sysv ;; vms) basic_machine=vax-dec os=vms ;; vsta) basic_machine=i386-pc os=vsta ;; vxworks960) basic_machine=i960-wrs os=vxworks ;; vxworks68) basic_machine=m68k-wrs os=vxworks ;; vxworks29k) basic_machine=a29k-wrs os=vxworks ;; xbox) basic_machine=i686-pc os=mingw32 ;; ymp) basic_machine=ymp-cray os=unicos ;; *) basic_machine=$1 os= ;; esac ;; esac # Decode 1-component or ad-hoc basic machines case $basic_machine in # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) cpu=hppa1.1 vendor=winbond ;; op50n) cpu=hppa1.1 vendor=oki ;; op60c) cpu=hppa1.1 vendor=oki ;; ibm*) cpu=i370 vendor=ibm ;; orion105) cpu=clipper vendor=highlevel ;; mac | mpw | mac-mpw) cpu=m68k vendor=apple ;; pmac | pmac-mpw) cpu=powerpc vendor=apple ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) cpu=m68000 vendor=att ;; 3b*) cpu=we32k vendor=att ;; bluegene*) cpu=powerpc vendor=ibm os=cnk ;; decsystem10* | dec10*) cpu=pdp10 vendor=dec os=tops10 ;; decsystem20* | dec20*) cpu=pdp10 vendor=dec os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) cpu=m68k vendor=motorola ;; dpx2*) cpu=m68k vendor=bull os=sysv3 ;; encore | umax | mmax) cpu=ns32k vendor=encore ;; elxsi) cpu=elxsi vendor=elxsi os=${os:-bsd} ;; fx2800) cpu=i860 vendor=alliant ;; genix) cpu=ns32k vendor=ns ;; h3050r* | hiux*) cpu=hppa1.1 vendor=hitachi os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) cpu=m68000 vendor=hp ;; hp9k3[2-9][0-9]) cpu=m68k vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) cpu=hppa1.1 vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; i*86v32) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc os=sysv32 ;; i*86v4*) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc os=sysv4 ;; i*86v) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc os=sysv ;; i*86sol2) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc os=solaris2 ;; j90 | j90-cray) cpu=j90 vendor=cray os=${os:-unicos} ;; iris | iris4d) cpu=mips vendor=sgi case $os in irix*) ;; *) os=irix4 ;; esac ;; miniframe) cpu=m68000 vendor=convergent ;; *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) cpu=m68k vendor=atari os=mint ;; news-3600 | risc-news) cpu=mips vendor=sony os=newsos ;; next | m*-next) cpu=m68k vendor=next case $os in openstep*) ;; nextstep*) ;; ns2*) os=nextstep2 ;; *) os=nextstep3 ;; esac ;; np1) cpu=np1 vendor=gould ;; op50n-* | op60c-*) cpu=hppa1.1 vendor=oki os=proelf ;; pa-hitachi) cpu=hppa1.1 vendor=hitachi os=hiuxwe2 ;; pbd) cpu=sparc vendor=tti ;; pbb) cpu=m68k vendor=tti ;; pc532) cpu=ns32k vendor=pc532 ;; pn) cpu=pn vendor=gould ;; power) cpu=power vendor=ibm ;; ps2) cpu=i386 vendor=ibm ;; rm[46]00) cpu=mips vendor=siemens ;; rtpc | rtpc-*) cpu=romp vendor=ibm ;; sde) cpu=mipsisa32 vendor=sde os=${os:-elf} ;; simso-wrs) cpu=sparclite vendor=wrs os=vxworks ;; tower | tower-32) cpu=m68k vendor=ncr ;; vpp*|vx|vx-*) cpu=f301 vendor=fujitsu ;; w65) cpu=w65 vendor=wdc ;; w89k-*) cpu=hppa1.1 vendor=winbond os=proelf ;; none) cpu=none vendor=none ;; leon|leon[3-9]) cpu=sparc vendor=$basic_machine ;; leon-*|leon[3-9]-*) cpu=sparc vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; *-*) # shellcheck disable=SC2162 IFS="-" read cpu vendor <&2 exit 1 ;; esac ;; esac # Here we canonicalize certain aliases for manufacturers. case $vendor in digital*) vendor=dec ;; commodore*) vendor=cbm ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x$os != x ] then case $os in # First match some system type aliases that might get confused # with valid system types. # solaris* is a basic system type, with this one exception. auroraux) os=auroraux ;; bluegene*) os=cnk ;; solaris1 | solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; solaris) os=solaris2 ;; unixware*) os=sysv4.2uw ;; gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # es1800 is here to avoid being matched by es* (a different OS) es1800*) os=ose ;; # Some version numbers need modification chorusos*) os=chorusos ;; isc) os=isc2.2 ;; sco6) os=sco5v6 ;; sco5) os=sco3.2v5 ;; sco4) os=sco3.2v4 ;; sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` ;; sco3.2v[4-9]* | sco5v6*) # Don't forget version if it is 3.2v4 or newer. ;; scout) # Don't match below ;; sco*) os=sco3.2v2 ;; psos*) os=psos ;; # Now accept the basic system types. # The portable systems comes first. # Each alternative MUST end in a * to match a version number. # sysv* is not here because it comes later, after sysvr4. gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ | sym* | kopensolaris* | plan9* \ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ | aos* | aros* | cloudabi* | sortix* | twizzler* \ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ | knetbsd* | mirbsd* | netbsd* \ | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \ | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ | chorusrdb* | cegcc* | glidix* \ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ | linux-newlib* | linux-musl* | linux-uclibc* \ | uxpv* | beos* | mpeix* | udk* | moxiebox* \ | interix* | uwin* | mks* | rhapsody* | darwin* \ | openstep* | oskit* | conix* | pw32* | nonstopux* \ | storm-chaos* | tops10* | tenex* | tops20* | its* \ | os2* | vos* | palmos* | uclinux* | nucleus* \ | morphos* | superux* | rtmk* | windiss* \ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ | skyos* | haiku* | rdos* | toppers* | drops* | es* \ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ | nsk* | powerunix) # Remember, each alternative MUST END IN *, to match a version number. ;; qnx*) case $cpu in x86 | i*86) ;; *) os=nto-$os ;; esac ;; hiux*) os=hiuxwe2 ;; nto-qnx*) ;; nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; sim | xray | os68k* | v88r* \ | windows* | osx | abug | netware* | os9* \ | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) ;; linux-dietlibc) os=linux-dietlibc ;; linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; lynx*178) os=lynxos178 ;; lynx*5) os=lynxos5 ;; lynx*) os=lynxos ;; mac*) os=`echo "$os" | sed -e 's|mac|macos|'` ;; opened*) os=openedition ;; os400*) os=os400 ;; sunos5*) os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; sunos6*) os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; wince*) os=wince ;; utek*) os=bsd ;; dynix*) os=bsd ;; acis*) os=aos ;; atheos*) os=atheos ;; syllable*) os=syllable ;; 386bsd) os=bsd ;; ctix* | uts*) os=sysv ;; nova*) os=rtmk-nova ;; ns2) os=nextstep2 ;; # Preserve the version number of sinix5. sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; sinix*) os=sysv4 ;; tpf*) os=tpf ;; triton*) os=sysv3 ;; oss*) os=sysv3 ;; svr4*) os=sysv4 ;; svr3) os=sysv3 ;; sysvr4) os=sysv4 ;; # This must come after sysvr4. sysv*) ;; ose*) os=ose ;; *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) os=mint ;; zvmoe) os=zvmoe ;; dicos*) os=dicos ;; pikeos*) # Until real need of OS specific support for # particular features comes up, bare metal # configurations are quite functional. case $cpu in arm*) os=eabi ;; *) os=elf ;; esac ;; nacl*) ;; ios) ;; none) ;; *-eabi) ;; *) echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $cpu-$vendor in score-*) os=elf ;; spu-*) os=elf ;; *-acorn) os=riscix1.2 ;; arm*-rebel) os=linux ;; arm*-semi) os=aout ;; c4x-* | tic4x-*) os=coff ;; c8051-*) os=elf ;; clipper-intergraph) os=clix ;; hexagon-*) os=elf ;; tic54x-*) os=coff ;; tic55x-*) os=coff ;; tic6x-*) os=coff ;; # This must come before the *-dec entry. pdp10-*) os=tops20 ;; pdp11-*) os=none ;; *-dec | vax-*) os=ultrix4.2 ;; m68*-apollo) os=domain ;; i386-sun) os=sunos4.0.2 ;; m68000-sun) os=sunos3 ;; m68*-cisco) os=aout ;; mep-*) os=elf ;; mips*-cisco) os=elf ;; mips*-*) os=elf ;; or32-*) os=coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=sysv3 ;; sparc-* | *-sun) os=sunos4.1.1 ;; pru-*) os=elf ;; *-be) os=beos ;; *-ibm) os=aix ;; *-knuth) os=mmixware ;; *-wec) os=proelf ;; *-winbond) os=proelf ;; *-oki) os=proelf ;; *-hp) os=hpux ;; *-hitachi) os=hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=sysv ;; *-cbm) os=amigaos ;; *-dg) os=dgux ;; *-dolphin) os=sysv3 ;; m68k-ccur) os=rtu ;; m88k-omron*) os=luna ;; *-next) os=nextstep ;; *-sequent) os=ptx ;; *-crds) os=unos ;; *-ns) os=genix ;; i370-*) os=mvs ;; *-gould) os=sysv ;; *-highlevel) os=bsd ;; *-encore) os=bsd ;; *-sgi) os=irix ;; *-siemens) os=sysv4 ;; *-masscomp) os=rtu ;; f30[01]-fujitsu | f700-fujitsu) os=uxpv ;; *-rom68k) os=coff ;; *-*bug) os=coff ;; *-apple) os=macos ;; *-atari*) os=mint ;; *-wrs) os=vxworks ;; *) os=none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) case $os in riscix*) vendor=acorn ;; sunos*) vendor=sun ;; cnk*|-aix*) vendor=ibm ;; beos*) vendor=be ;; hpux*) vendor=hp ;; mpeix*) vendor=hp ;; hiux*) vendor=hitachi ;; unos*) vendor=crds ;; dgux*) vendor=dg ;; luna*) vendor=omron ;; genix*) vendor=ns ;; clix*) vendor=intergraph ;; mvs* | opened*) vendor=ibm ;; os400*) vendor=ibm ;; ptx*) vendor=sequent ;; tpf*) vendor=ibm ;; vxsim* | vxworks* | windiss*) vendor=wrs ;; aux*) vendor=apple ;; hms*) vendor=hitachi ;; mpw* | macos*) vendor=apple ;; *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) vendor=atari ;; vos*) vendor=stratus ;; esac ;; esac echo "$cpu-$vendor-$os" exit # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: mawk-1.3.4-20200120/examples/0000755000175100001440000000000013611312177013701 5ustar tomusersmawk-1.3.4-20200120/examples/gdecl.awk0000755000175100001440000000534712061214257015475 0ustar tomusers#!/usr/bin/mawk -f # parse a C declaration by recursive descent # # decl.awk with extra escapes \ ################################################ ############################################ # lexical scanner -- gobble() # input : string s -- treated as a regular expression # gobble eats SPACE, then eats longest match of s off front # of global variable line. # Cuts the matched part off of line # function gobble(s, x) { sub( /^ /, "", line) # eat SPACE if any # surround s with parenthesis to make sure ^ acts on the # whole thing match(line, "^" "(" s ")") x = substr(line, 1, RLENGTH) line = substr(line, RLENGTH+1) return x } function ptr_to(n, x) # print "pointer to" , n times { n = int(n) if ( n <= 0 ) return "" x = "pointer to" ; n-- while ( n-- ) x = x " pointer to" return x } #recursively get a decl # returns an english description of the declaration or # "" if not a C declaration. function decl( x, t, ptr_part) { x = gobble("[* ]+") # get list of *** ... gsub(/ /, "", x) # remove all SPACES ptr_part = ptr_to( length(x) ) # We expect to see either an identifier or '(' # if ( gobble("\\(") ) { # this is the recursive descent part # we expect to match a declaration and closing ')' # If not return "" to indicate failure if ( (x = decl()) == "" || gobble( "\\)" ) == "" ) return "" } else # expecting an identifier { if ( (x = gobble(id)) == "" ) return "" x = x ":" } # finally look for () # or [ opt_size ] while ( 1 ) if ( gobble( funct_mark ) ) x = x " function returning" else if ( t = gobble( array_mark ) ) { gsub(/ /, "", t) x = x " array" t " of" } else break x = x " " ptr_part return x } BEGIN { id = "[_A-Za-z][_A-Za-z0-9]*" funct_mark = "\\([ \t]*\\)" array_mark = "\\[[ \t]*[_A-Za-z0-9]*[ \t]*\\]" # I've assumed types are keywords or all CAPS or end in _t # Other conventions could be added. type0 = "int|char|short|long|double|float|void" type1 = "[_A-Z][_A-Z0-9]*" # types are CAPS type2 = "[_A-Za-z][_A-Za-z0-9]*_t" # end in _t types = "(" type0 "|" type1 "|" type2 ")" } { gsub( /\/\*([^*]|\*[^\/])*(\*\/|$)/ , " ") # remove comments gsub( /[ \t]+/, " ") # squeeze white space to a single space line = $0 scope = gobble( "extern|static" ) if ( type = gobble("(struct|union|enum) ") ) type = type gobble(id) # get the tag else { type = gobble("(un)?signed ") gobble( types ) } if ( ! type ) next if ( (x = decl()) && gobble( ";") ) { x = x " " type if ( scope ) x = x " (" scope ")" gsub( / +/, " ", x) # print x } } mawk-1.3.4-20200120/examples/qsort.awk0000755000175100001440000000210613611312177015557 0ustar tomusers#!/usr/bin/mawk -f # qsort text files # function middle(x,y,z) #return middle of 3 { if ( x <= y ) { if ( z >= y ) return y if ( z < x ) return x return z } if ( z >= x ) return x if ( z < y ) return y return z } function isort(A , n, i, j, hold) { # if needed a sentinel at A[0] will be created for( i = 2 ; i <= n ; i++) { hold = A[ j = i ] while ( A[j-1] > hold ) { j-- ; A[j+1] = A[j] } A[j] = hold } } # recursive quicksort function qsort(A, left, right ,i , j, pivot, hold) { pivot = middle(A[left], A[int((left+right)/2)], A[right]) i = left j = right while ( i <= j ) { while ( A[i] < pivot ) i++ while ( A[j] > pivot ) j-- if ( i <= j ) { hold = A[i] A[i++] = A[j] A[j--] = hold } } if ( j - left > BLOCK ) qsort(A,left,j) if ( right - i > BLOCK ) qsort(A,i,right) } BEGIN { BLOCK = 5 } { line[NR] = $0 "" # sort as string } END { if ( NR > BLOCK ) qsort(line, 1, NR) isort(line, NR) for(i = 1 ; i <= NR ; i++) print line[i] } mawk-1.3.4-20200120/examples/primes.awk0000755000175100001440000000204211061561047015704 0ustar tomusers#!/usr/bin/mawk -f # primes.awk # # mawk -f primes.awk [START] STOP # find all primes between 2 and STOP # or START and STOP # function usage() { ustr = sprintf("usage: %s [start] stop", ARGV[0]) system( "echo " ustr) exit 1 } BEGIN { if (ARGC == 1 || ARGC > 3 ) usage() if ( ARGC == 2 ) { start = 2 ; stop = ARGV[1]+0 } else if ( ARGC == 3 ) { start = ARGV[1]+0 ; stop = ARGV[2]+0 } if ( start < 2 ) start = 2 if ( stop < start ) stop = start prime[ p_cnt = 1 ] = 3 # keep primes in prime[] # keep track of integer part of square root by adding # odd integers odd = test = 5 root = 2 squares = 9 while ( test <= stop ) { if ( test >= squares ) { root++ odd += 2 squares += odd } flag = 1 for ( i = 1 ; prime[i] <= root ; i++ ) if ( test % prime[i] == 0 ) # not prime { flag = 0 ; break } if ( flag ) prime[ ++p_cnt ] = test test += 2 } prime[0] = 2 for( i = 0 ; prime[i] < start ; i++) ; for ( ; i <= p_cnt ; i++ ) print prime[i] } mawk-1.3.4-20200120/examples/eatc.awk0000755000175100001440000000075411061561047015331 0ustar tomusers#!/usr/bin/mawk -f # eatc.awk # another program to remove comments # { while( t = index($0 , "/*") ) { printf "%s" , substr($0,1,t-1) $0 = eat_comment( substr($0, t+2) ) } print } function eat_comment(s, t) { #replace comment by one space printf " " while ( (t = index(s, "*/")) == 0 ) if ( getline s == 0 ) { # input error -- unterminated comment system("/bin/sh -c 'echo unterminated comment' 1>&2") exit 1 } return substr(s,t+2) } mawk-1.3.4-20200120/examples/decl.awk0000755000175100001440000000574411061561047015330 0ustar tomusers#!/usr/bin/awk -f # parse a C declaration by recursive descent # based on a C program in KR ANSI edition # # run on a C file it finds the declarations # # restrictions: one declaration per line # doesn't understand struct {...} # makes assumptions about type names # # # some awks need double escapes on strings used as # regular expressions. If not run on mawk, use gdecl.awk ################################################ # lexical scanner -- gobble() # input : string s -- treated as a regular expression # gobble eats SPACE, then eats longest match of s off front # of global variable line. # Cuts the matched part off of line # function gobble(s, x) { sub( /^ /, "", line) # eat SPACE if any # surround s with parenthesis to make sure ^ acts on the # whole thing match(line, "^" "(" s ")") x = substr(line, 1, RLENGTH) line = substr(line, RLENGTH+1) return x } function ptr_to(n, x) # print "pointer to" , n times { n = int(n) if ( n <= 0 ) return "" x = "pointer to" ; n-- while ( n-- ) x = x " pointer to" return x } #recursively get a decl # returns an english description of the declaration or # "" if not a C declaration. function decl( x, t, ptr_part) { x = gobble("[* ]+") # get list of *** ... gsub(/ /, "", x) # remove all SPACES ptr_part = ptr_to( length(x) ) # We expect to see either an identifier or '(' # if ( gobble("\(") ) { # this is the recursive descent part # we expect to match a declaration and closing ')' # If not return "" to indicate failure if ( (x = decl()) == "" || gobble( "\)" ) == "" ) return "" } else # expecting an identifier { if ( (x = gobble(id)) == "" ) return "" x = x ":" } # finally look for () # or [ opt_size ] while ( 1 ) if ( gobble( funct_mark ) ) x = x " function returning" else if ( t = gobble( array_mark ) ) { gsub(/ /, "", t) x = x " array" t " of" } else break x = x " " ptr_part return x } BEGIN { id = "[_A-Za-z][_A-Za-z0-9]*" funct_mark = "\([ \t]*\)" array_mark = "\[[ \t]*[_A-Za-z0-9]*[ \t]*\]" # I've assumed types are keywords or all CAPS or end in _t # Other conventions could be added. type0 = "int|char|short|long|double|float|void" type1 = "[_A-Z][_A-Z0-9]*" # types are CAPS type2 = "[_A-Za-z][_A-Za-z0-9]*_t" # end in _t types = "(" type0 "|" type1 "|" type2 ")" } { gsub( "/\*([^*]|\*[^/])*(\*/|$)" , " ") # remove comments gsub( /[ \t]+/, " ") # squeeze white space to a single space line = $0 scope = gobble( "extern|static" ) if ( type = gobble("(struct|union|enum) ") ) type = type gobble(id) # get the tag else { type = gobble("(un)?signed ") gobble( types ) } if ( ! type ) next if ( (x = decl()) && gobble( ";") ) { x = x " " type if ( scope ) x = x " (" scope ")" gsub( / +/, " ", x) # print x } } mawk-1.3.4-20200120/examples/nocomment.awk0000755000175100001440000000111611061561047016405 0ustar tomusers#!/usr/bin/mawk -f # remove C comments from a list of files # using a comment as the record separator # # this is trickier than I first thought # The first version in .97-.9993 was wrong BEGIN { # RS is set to a comment (this is mildly tricky, I blew it here RS = "/\*([^*]|\*+[^*/])*\*+/" ORS = " " getline hold filename = FILENAME } # if changing files filename != FILENAME { filename = FILENAME printf "%s" , hold hold = $0 next } { # hold one record because we don't want ORS on the last # record in each file print hold hold = $0 } END { printf "%s", hold } mawk-1.3.4-20200120/examples/ct_length.awk0000755000175100001440000000062711061561047016363 0ustar tomusers#!/usr/bin/mawk -f # ct_length.awk # # replaces all length # by length($0) # { while ( i = index($0, "length") ) { printf "%s" , substr($0,1, i+5) # ...length $0 = substr($0,i+6) if ( match($0, /^[ \t]*\(/) ) { # its OK printf "%s", substr($0, 1, RLENGTH) $0 = substr($0, RLENGTH+1) } else # length alone printf "($0)" } print } mawk-1.3.4-20200120/examples/deps.awk0000755000175100001440000000243211061561047015343 0ustar tomusers#!/usr/bin/mawk -f # find include dependencies in C source # # mawk -f deps.awk C_source_files # -- prints a dependency list suitable for make # -- ignores #include < > # BEGIN { stack_index = 0 # stack[] holds the input files for(i = 1 ; i < ARGC ; i++) { file = ARGV[i] if ( file !~ /\.[cC]$/ ) continue # skip it outfile = substr(file, 1, length(file)-2) ".o" # INCLUDED[] stores the set of included files # -- start with the empty set for( j in INCLUDED ) delete INCLUDED[j] while ( 1 ) { if ( getline line < file <= 0 ) # no open or EOF { close(file) if ( stack_index == 0 ) break # empty stack else { file = stack[ stack_index-- ] continue } } if ( line ~ /^#include[ \t]+".*"/ ) { split(line, X, "\"") # filename is in X[2] if ( X[2] in INCLUDED ) # we've already included it continue #push current file stack[ ++stack_index ] = file INCLUDED[ file = X[2] ] = "" } } # end of while # test if INCLUDED is empty flag = 0 # on once the front is printed for( j in INCLUDED ) if ( ! flag ) { printf "%s : %s" , outfile, j ; flag = 1 } else printf " %s" , j if ( flag ) print "" }# end of loop over files in ARGV[i] } mawk-1.3.4-20200120/examples/hical0000755000175100001440000000562011243366022014707 0ustar tomusers#!/bin/sh # $MawkId: hical,v 1.4 2009/08/21 00:36:34 tom Exp $ # @(#) hical - displays previous, current & next months - today highlighted # @(#) an "internationalizationable" version of a 3-month 'cal' display, it # @(#) may be edited for week to start with Sun or Mon & for local language prog=${TMPDIR-/tmp}/hical.$$ ; trap 'rm -f $prog ; trap 0 ; exit' 0 1 2 3 15 : ${so:=`tput smso`} ${se:=`tput rmso`} # USER EDITS MAY BE REQUIRED for the arguments to the 'date' command # the script presumes 'date' recognizes these arguments in these ways: # w - Day of the week - Sunday = 0 # m - Month of year - 01 to 12 # d - Day of month - 01 to 31 # T - Time as HH:MM:SS # Y - Year (including century), as decimal numbers DATE_ARGS='%w %m %d %T %Y' # the 'awk' program file is written to a temporary file to avoid any # "arg list too long" error messages, yet have all the code in one file. cat >$prog <<'EOF' { # USER EDITS MAY BE REQUIRED (for FMT, day & month names, and the time stuff) # FMT = 0 # for weekdays ordered "Mo Tu We Th Fr Sa Su" FMT = 1 # for weekdays ordered "Su Mo Tu We Th Fr Sa" Header[0] = "Mo Tu We Th Fr Sa Su" Header[1] = "Su Mo Tu We Th Fr Sa" months = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec" time_is = "The time is:" ; time_fmt = "%s %s %s %s\n" # NO MORE USER EDITS REQUIRED (I think!) split(months,M_Name) ; split("31 28 31 30 31 30 31 31 30 31 30 31",M_Len) daynum = $1 + FMT Mon[2] = $2 + 0 today = $3 + 0 time = $4 Year[1] = Year[2] = Year[3] = $NF if ( Mon[2] == 1 ) { Year[1] = Year[1] - 1 ; Mon[1] = 12 } else { Mon[1] = Mon[2] - 1 } if ( Mon[2] == 12 ) { Year[3] = Year[3] + 1 ; Mon[3] = 1 } else { Mon[3] = Mon[2] + 1 } if ( Year[2] % 4 == 0 && Year[2] % 100 != 0 || Year[2] % 400 == 0 ) M_Len[2] = 29 Start[2] = 7 - ( ( today - daynum ) % 7 ) Start[1] = 7 - ( ( M_Len[Mon[1]] - Start[2] ) % 7 ) Start[3] = ( M_Len[Mon[2]] + Start[2] ) % 7 for (i=1;i<=3;i++) { while ( Start[i] >= 7 ) Start[i] -= 7 } for (mm=1;mm<=3;mm++) { if ( Year[mm] != Year[mm-1] ) printf( "%s %s %s\n", so, Year[mm], se ) if ( mm == 1 ) printf( "%s %s %s\n", so, Header[FMT], se ) j = k = 1 while ( j <= M_Len[Mon[mm]] ) { line = "" for (i=1;i<=7;i++) { if ( Start[mm] > 0 || j > M_Len[Mon[mm]] ) { date = "" ; Start[mm]-- } else date = j++ if ( mm == 2 && date == today ) { So = so ; Se = se } else { So = Se = "" } line = sprintf( "%s%s%2s%s ", line, So, date, Se ) } m1 = substr(M_Name[Mon[mm]],k++,1) printf( "%s %1s %s %s%s %s\n", so, m1, se, line, so, se ) } } printf( time_fmt, so, time_is, time, se ) } EOF date +"$DATE_ARGS" | ${AWK:=mawk} -f $prog so=$so se=$se exit 0 # EOF 'hical' - Tue Dec 19 19:19:19 EST 1994 # Bob Stockler - bob@trebor.iglou.com - CIS: 72726,452 mawk-1.3.4-20200120/examples/hcal0000755000175100001440000003333611061561047014545 0ustar tomusers#!/usr/bin/mawk -We # edit the above to be the full pathname of 'mawk' # @(#) hcal - v01.00.02 - Tue Feb 27 21:21:21 EST 1996 # @(#) prints a 3-month (highlighted) calendar centered on the target month # @(#) may be edited for week to start with Sun or Mon & for local language # @(#) to display a usage screen, execute: hcal -h # NOTE: to edit, set ts=4 in 'vi' (or equivalent) # to print, pipe through 'pr -t -e4' # Using ideas from a KornShell script by Mikhail Kuperblum (mikhail@klm.com) # Bob Stockler - bob@trebor.iglou.com - Sysop CompuServe SCOForum [75162,1612] BEGIN { # Local Edits: PROG = "hcal" # Program name given to this script # FMT = 0 # date format dd/mm/yyyy # FMT1 = 0 # for weekdays ordered "Mo Tu We Th Fr Sa Su" FMT = 1 # date format mm/dd/yyyy FMT1 = 1 # for weekdays ordered "Su Mo Tu We Th Fr Sa" # edit day & month names and abbreviations for local language names Days[0] = "Mo Tu We Th Fr Sa Su" Days[1] = "Su Mo Tu We Th Fr Sa" MONTHS = "January February March April May June July August" MONTHS = MONTHS " September October November December" Months = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec" # STDOUT = 0 # emulate SCO Unix 'cal' (NO highlighting) STDOUT = 1 # default to highlight mode MINUS = "-" # possible input date field delimiter SLASH = "/" # possible input date field delimiter DOT = "." # possible input date field delimiter IDFD = "[" MINUS # make MINUS the first character in this series IDFD = IDFD SLASH # so that it stands for itself in the RE IDFD = IDFD DOT "]" # Input Date Field Delimiters RE ODFD = SLASH # Output Date Field Delimiter (default) DATE_FMT = "%.2d%s%.2d%s%.4d" # date format ## this script presumes 'date' recognizes these arguments in these ways: ## w - Day of the week - Sunday = 0 ## m - Month of year - 01 to 12 ## d - Day of month - 01 to 31 ## y Last 2 digits of year - 00 to 99 ## Y - Year (including century), as decimal numbers ## j - Day of the year - 001 to 366 (Julian date) ## T - Time as HH:MM:SS ## X Current time, as defined by the locale ## a - Abbreviated weekday - Sun to Sat ## b - Abbreviated month name ## Z - Timezone name, or no characters if no timezone exists ## Command to get today's date information: ## DATE = "/bin/date '+%w %m %d 19%y %j~%a %b %d %T %Z 19%y'" ## For sunos4 ## DATE = DATE = "/bin/date '+%w %m %d 19%y %j~%a %h %d %T 19%y'" DATE = "/bin/date '+%w %m %d %Y %j~%a %b %d %X %Z %Y'" # End of Local Edits INT_RE = "^[0-9]+$" # unsigned integer RE S_INT_RE = "^[-+][0-9]+$" # signed integer RE MNAM_RE = "^[A-Za-z]+$" # month name RE YEAR_RE = "^[0-9]?[0-9]?[0-9]?[0-9]$" DATE_RE = "^[0-9]?[0-9]" IDFD "[0-9]?[0-9]" IDFD "[0-9]?[0-9]?[0-9]?[0-9]$" DAT1_RE = "^[0-9]?[0-9]" IDFD "[0-9]?[0-9]$" split(Months,M_Name) split("31 28 31 30 31 30 31 31 30 31 30 31",Mdays) ; Mdays[0] = 0 NUM_ARGS = ARGC - 1 if ( ARGV[1] == "-x" ) { # standout mode switch if ( STDOUT == 1 ) STDOUT = 0 ; else STDOUT = 1 ARG1 = ARGV[2] ; ARG2 = ARGV[3] ; NUM_ARGS -= 1 } else if ( ARGV[1] ~ /^-[h?]$/ ) { HELP = 1 ; exit } else { ARG1 = ARGV[1] ; ARG2 = ARGV[2] } if ( STDOUT == 1 ) { # get the terminal standout-start & standout-end control codes so = ENVIRON["so"] ; if ( ! so ) "tput smso" | getline so se = ENVIRON["se"] ; if ( ! se ) "tput rmso" | getline se } if ( NUM_ARGS == 0 ) { # no arguments - print a calendar display centered on today DEFAULT = 1 } else if ( NUM_ARGS == 1 ) { # one argument - may be a month name, date, year, or interval of days if ( ARG1 ~ DATE_RE ) DATE1 = Fmt_Date(ARG1) else if ( ARG1 ~ DAT1_RE ) DATE1 = ARG1 else if ( ARG1 ~ MNAM_RE ) { Get_Mnum() ; DATE1 = RMSO = ARG1 "/1" } else if ( ARG1 ~ S_INT_RE ) INTERVAL = ARG1 + 0 else if ( ARG1 ~ INT_RE ) { if ( ARG1 > 0 && ARG1 <= 9999 ) YEAR = ARG1 + 0 else if ( ARG1 > 9999 ) { ERR = 9 ; exit } else { ERR = 7 ; exit } } else { ERR = 1 ; exit } } else if ( NUM_ARGS == 2 ) { # two arguments, the second of which must be an integer if ( ARG2 ~ INT_RE ) { ARG2 = ARG2 + 0 if ( ARG2 < 1 ) { ERR = 7 ; exit } else if ( ARG2 > 9999 ) { ERR = 9 ; exit } } else { ERR = 1 ; exit } RMSO = 1 # the first may be a string or an integer if ( ARG1 ~ INT_RE ) { # a month number and a year if ( ARG1 < 1 || ARG1 > 12 ) { ERR = 4 ; mm = ARG1 ; exit } } else if ( ARG1 ~ MNAM_RE ) { Get_Mnum() } else { ERR = 6 ; exit } DATE1 = ARG1 "/1/" ARG2 } else { ERR = 2 ; exit } if ( DEFAULT ) { Get_Now() } else if ( INTERVAL ) { Get_Now() daynum = daynum + ( INTERVAL % 7 ) this_date = "" DATE1 = Get_Date(INTERVAL,m,d,y,j) split(DATE1,mdy,IDFD) Mon[2] = mdy[1] + 0 today = mdy[2] + 0 Year[1] = Year[2] = Year[3] = mdy[3] + 0 } else if ( DATE1 ) { Get_Now() if ( split(DATE1,mdy,IDFD) == 2 ) DATE1 = DATE1 "/" This_Year Chk_Date(DATE1) Mon[2] = mdy[1] + 0 today = mdy[2] + 0 Year[1] = Year[2] = Year[3] = mdy[3] + 0 DATE1 = sprintf( "%.2d/%.2d/%.4d", Mon[2], today, Year[2] ) INTERVAL = Get_Num(DATE1,m,d,y,j) daynum = daynum + ( INTERVAL % 7 ) this_date = "" } else if ( YEAR ) { so = se = "" Get_Now() Mon[2] = 2 today = 1 Year[1] = Year[2] = Year[3] = YEAR DATE1 = sprintf( "%.2d/%.2d/%.4d", Mon[2], today, Year[2] ) INTERVAL = Get_Num(DATE1,m,d,y,j) daynum = daynum + ( INTERVAL % 7 ) this_date = "" } else { ERR = 5 ; exit } if ( Mon[2] != 1 ) Mon[1] = Mon[2] - 1 else { Mon[1] = 12 ; Year[1] -= 1 } if ( Mon[2] != 12 ) Mon[3] = Mon[2] + 1 else { Mon[3] = 1 ; Year[3] += 1 } if ( Mon[1] == 2 ) Leap(Year[1]) else if ( Mon[2] == 2 ) Leap(Year[2]) else if ( Mon[3] == 2 ) Leap(Year[3]) Start[2] = 7 - ( ( today - daynum ) % 7 ) Start[1] = 7 - ( ( Mdays[Mon[1]] - Start[2] ) % 7 ) Start[3] = ( Mdays[Mon[2]] + Start[2] ) % 7 if ( ! YEAR ) quarters = 1 else { quarters = 4 ; s[3] = Start[3] for (i=4;i<=12;i++) { s[i] = ( Mdays[i-1] + s[i-1] ) % 7 } } for ( quarter = 1 ; quarter <= quarters ; quarter++ ) { if ( quarter > 1 ) { delete cal ll = 0 ; Mon[1] += 3 ; Mon[2] += 3 ; Mon[3] += 3 Start[1] = s[Mon[1]] ; Start[2] = s[Mon[2]] ; Start[3] = s[Mon[3]] } if ( Year[2] == 1752 && Mon[2] ~ /8|9|10/ ) Kludge_1752() if ( ARG1 ) print "" ; else printf( "\n%s\n\n", this_date ) for (i=1;i<=3;i++) { while ( Start[i] >= 7 ) Start[i] -= 7 } for (mm=1;mm<=3;mm++) { l = 1 if ( mm != 2 ) { So = Se = "" } else { So = so ; Se = se } cal[mm SUBSEP l++] = sprintf( "%s %-4s%.4d %s ", \ So, M_Name[Mon[mm]], Year[mm], Se ) cal[mm SUBSEP l++] = sprintf( "%s%3s", Days[FMT1], "" ) j = k = 1 while ( j <= Mdays[Mon[mm]] ) { line = "" for (i=1;i<=7;i++) { if ( Start[mm] > 0 || j > Mdays[Mon[mm]] ) { date = "" ; Start[mm]-- } else date = j++ if ( Year[mm] == 1752 && Mon[mm] == 9 && date == 3 ) { date = 14 ; j = 15 } if ( date == today && mm == 2 && ! RMSO ) { So = so ; Se = se } else { So = Se = "" } line = sprintf( "%s%s%2s%s ", line, So, date, Se ) } cal[mm SUBSEP l++] = sprintf( "%s ", line ) } if ( l > ll ) ll = l } for (l=1;l"/dev/tty" print usage >"/dev/tty" exit ERR } function Get_Now() { # get the week, month, date & year numbers and the time-of-day DATE | getline date split(date,Date,"~") split(Date[1],field) daynum = field[1] + FMT1 m = field[2] ; This_Mon = Mon[2] = m + 0 d = field[3] ; This_Date = today = d + 0 y = This_Year = Year[1] = Year[2] = Year[3] = field[4] j = julian = field[5] + 0 this_date = Date[2] } function Fmt_Date(date) { # format dates as mm/dd/yyyy or dd/mm/yyyy split(date,MorD_DorM_Y,IDFD) if ( FMT == 1 ) { Dt_Fld1 = MorD_DorM_Y[1] ; Dt_Fld2 = MorD_DorM_Y[2] } else { Dt_Fld1 = MorD_DorM_Y[2] ; Dt_Fld2 = MorD_DorM_Y[1] } Dt_Fld3 = MorD_DorM_Y[3] return sprintf( DATE_FMT, Dt_Fld1, ODFD, Dt_Fld2, ODFD, Dt_Fld3 ) } function Kludge_1752() { # kludge for September 1752 & the change to the Gregorian Calendar Mdays[9] = 30 if ( Mon[2] == 9 ) { Start[1] = Start[2] = 1 + FMT1 ; Start[3] = -1 + FMT1 } else if ( Mon[2] == 8 ) { Start[1] = 2 + FMT1 ; Start[2] = 5 + FMT1 ; Start[3] = 1 + FMT1 } else if ( Mon[2] == 10 ) { Start[1] = 1 + FMT1 ; Start[2] = -1 + FMT1 ; Start[3] = 3 } } function Get_Mnum() { ARG1 = tolower(ARG1) months = tolower(MONTHS) split(months,month) for (i=1;i<=12;i++) { if ( index(month[i],ARG1) == 1 ) { ARG = i ; n++ } } if ( n == 1 ) ARG1 = ARG else if ( n == 0 ) { ERR = 1 ; exit } else { ERR = 8 ; exit } } function Get_Num(date,m,d,y,j) { # get the number of days from one date to another date NOW = y m d ; N = 0 ; M = m + 0 ; D = d + 0 ; Y = y + 0 ; J = j + 0 split(date,mdy,IDFD) M2 = mdy[1] ; D2 = mdy[2] ; Y2 = mdy[3] THEN = Y2 M2 D2 ; M2 = M2 + 0 ; D2 = D2 + 0 ; Y2 = Y2 + 0 Leap(Y2) if ( M2 > 12 ) { ERR = 4 ; exit } if ( D2 > Mdays[M2] && Y2 != 1752 && M2 != 9 ) { ERR = 5 ; exit } if ( THEN ~ /^1752090[3-9]$|^1752091[0-3]$/ ) { ERR = 6 ; exit } Leap(Y) if ( THEN > NOW ) { Ydays = Ydays - J + 1 ; mdays = Mdays[M] - D + 1 while ( Y < Y2 ) Next_Y() while ( M < M2 ) Next_M() while ( D < D2 ) Next_D() N *= -1 } else { Ydays = J ; mdays = D while ( Y > Y2 ) Prev_Y() while ( M > M2 ) Prev_M() if ( Y == 1752 && M == 9 && D == 19 ) D = 30 while ( D > D2 ) Prev_D() } return N } function Get_Date(n,m,d,y,j) { # get the date a number of days before or after a date N = n + 0 ; M = m + 0 ; D = d + 0 ; Y = y + 0 ; J = j + 0 if ( N != 0 ) { Leap(Y) if ( N > 0 ) { Ydays = Ydays - J + 1 ; mdays = Mdays[M] - D + 1 while ( N >= Ydays ) { Next_Y() ; Leap(Y) } while ( N >= ( ( mdays > 0 ) ? mdays : Mdays[M] ) ) { Next_M() } while ( N > 0 ) Next_D() } else { Ydays = J ; mdays = D ; N *= -1 while ( N >= Ydays ) { Prev_Y() ; Leap(Y) } while ( N >= ( ( mdays > 0 ) ? mdays : Mdays[M] ) ) { Prev_M() } if ( Y == 1752 && M == 9 && D == 19 ) D = 30 while ( N > 0 ) Prev_D() } if ( Y < 1 ) { ERR = 3 ; exit } } return M ODFD D ODFD Y } function Leap(YR) { # adjust for Leap Years if ( YR % 4 == 0 && ( YR % 100 != 0 || YR % 400 == 0 || YR < 1800 ) ) { Ydays = 366 ; Mdays[2] = 29 } else { Ydays = 365 ; Mdays[2] = 28 } if ( YR != 1752 ) Mdays[9] = 30 else { Ydays = 355 ; Mdays[9] = 19 } } function Chk_Date(date) { # check validity of input dates split(date,mdy,IDFD) mm = mdy[1] + 0 ; dd = mdy[2] + 0 ; yy = mdy[3] + 0 if ( mm == 2 ) Leap(yy) if ( yy < 1 ) { ERR = 3 ; exit } if ( mm < 1 || mm > 12 ) { ERR = 4 ; exit } if ( dd < 1 || dd > Mdays[mm] ) { ERR = 5 ; exit } } # day counting functions for next or previous year, month and day function Next_Y() { N -= Ydays ; Y += 1 ; M = 1 ; D = 1 ; mdays = 0 ; Leap(Y) } function Next_M() { if ( mdays != 0 ) N -= mdays ; else N -= Mdays[M] M += 1 ; D = 1 ; mdays = 0 } function Next_D() { N -= 1 ; D += 1 if ( D > Mdays[M] ) { M += 1 ; D = 1 } else if ( Y == 1752 && M == 9 && D == 2 ) D = 13 } function Prev_Y() { N -= Ydays ; Y -= 1 ; M = 12 ; D = 31 ; mdays = 0 ; Leap(Y) } function Prev_M() { if ( mdays != 0 ) N -= mdays ; else N -= Mdays[M] M -= 1 ; D = Mdays[M] ; mdays = 0 } function Prev_D() { N -= 1 ; D -= 1 ; if ( Y == 1752 && M == 9 && D == 13 ) D = 2 } function Get_J(m,d,y) { # get the Julian date for an input date m = m + 0 ; d = d + 0 ; y = y + 0 Leap(y) j = d for (i=1;i Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. mawk-1.3.4-20200120/config_h.in0000644000175100001440000000313712763275301014177 0ustar tomusers/******************************************** config_h.in copyright 2009-2014,2016 Thomas E. Dickey vile:cmode This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: config_h.in,v 1.30 2016/09/05 14:01:37 tom Exp $ * template for config.h */ #undef DECL_ENVIRON #undef FPE_TRAPS_ON #undef GCC_NORETURN #undef GCC_PRINTF #undef GCC_PRINTFLIKE #undef GCC_SCANF #undef GCC_SCANFLIKE #undef GCC_UNUSED #undef HAVE_BSD_STDLIB_H #undef HAVE_ERRNO_H #undef HAVE_FCNTL_H #undef HAVE_FORK #undef HAVE_ISNAN #undef HAVE_MATHERR #undef HAVE_MATH__LIB_VERSION #undef HAVE_MKTIME #undef HAVE_PIPE #undef HAVE_REAL_PIPES #undef HAVE_REGEXPR_H_FUNCS #undef HAVE_REGEXP_H_FUNCS #undef HAVE_REGEX_H_FUNCS #undef HAVE_SIGACTION #undef HAVE_SIGACTION_SA_SIGACTION #undef HAVE_SIGINFO_H #undef HAVE_STRFTIME #undef HAVE_STRTOD_OVF_BUG #undef HAVE_SYS_WAIT_H #undef HAVE_TDESTROY #undef HAVE_TSEARCH #undef HAVE_UNISTD_H #undef HAVE_WAIT #undef LOCALE #undef MAWK_RAND_MAX #undef MAX__INT #undef MAX__LONG #undef MAX__UINT #undef NAME_RANDOM #undef NOINFO_SIGFPE #undef NO_LEAKS #undef SIZE_T_STDDEF_H #undef SIZE_T_TYPES_H #undef SYSTEM_NAME #undef TURN_OFF_FPE_TRAPS #undef TURN_ON_FPE_TRAPS #undef USE_IEEEFP_H #undef YY_NO_LEAKS #undef const #undef mawk_rand #undef mawk_srand #ifndef GCC_NORETURN #define GCC_NORETURN /* nothing */ #endif #ifndef GCC_UNUSED #define GCC_UNUSED /* nothing */ #endif #ifndef OPT_TRACE #define OPT_TRACE 0 #endif mawk-1.3.4-20200120/array.c0000644000175100001440000004172613611312405013351 0ustar tomusers/* array.c */ /* @MawkId: array.w,v 1.21 2020/01/20 11:54:19 tom Exp @ copyright 2009-2019,2020 Thomas E. Dickey copyright 1991-1996,2014 Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. array.c and array.h were generated with the commands notangle -R'"array.c"' array.w > array.c notangle -R'"array.h"' array.w > array.h Notangle is part of Norman Ramsey's noweb literate programming package available from CTAN(ftp.shsu.edu). It's easiest to read or modify this file by working with array.w. */ #include "mawk.h" #include "symtype.h" #include "memory.h" #include "split.h" #include "field.h" #include "bi_vars.h" struct anode ; typedef struct {struct anode *slink, *ilink ;} DUAL_LINK ; typedef struct anode { struct anode *slink ; struct anode *ilink ; STRING *sval ; unsigned hval ; Int ival ; CELL cell ; } ANODE ; static ANODE* find_by_ival(ARRAY, Int, int, int*); static ANODE* find_by_sval(ARRAY, STRING*, int, int*); #define NOT_AN_IVALUE (-Max_Int-1) /* usually 0x80000000 */ static void add_string_associations(ARRAY); #define STARTING_HMASK 63 /* 2^6-1, must have form 2^n-1 */ #define MAX_AVE_LIST_LENGTH 12 #define hmask_to_limit(x) (((x)+1)*MAX_AVE_LIST_LENGTH) #define ahash(sval) hash2((sval)->str, (sval)->len) static void make_empty_table(ARRAY, int); static void convert_split_array_to_table(ARRAY); static void double_the_hash_table(ARRAY); CELL* array_find( ARRAY A, CELL *cp, int create_flag) { ANODE *ap ; int redid ; if (A->size == 0 && !create_flag) /* eliminating this trivial case early avoids unnecessary conversions later */ return (CELL*) 0 ; switch (cp->type) { case C_DOUBLE: { double d = cp->dval ; Int ival = d_to_I(d) ; if ((double)ival == d) { if (A->type == AY_SPLIT) { if (ival >= 1 && ival <= (int) A->size) return (CELL*)A->ptr+(ival-1) ; if (!create_flag) return (CELL*) 0 ; convert_split_array_to_table(A) ; } else if (A->type == AY_NULL) make_empty_table(A, AY_INT) ; ap = find_by_ival(A, ival, create_flag, &redid) ; } else { /* convert to string */ char buff[260] ; STRING *sval ; sprintf(buff, string(CONVFMT)->str, d) ; sval = new_STRING(buff) ; ap = find_by_sval(A, sval, create_flag, &redid) ; free_STRING(sval) ; } } break ; case C_NOINIT: ap = find_by_sval(A, &null_str, create_flag, &redid) ; break ; default: ap = find_by_sval(A, string(cp), create_flag, &redid) ; break ; } return ap ? &ap->cell : (CELL *) 0 ; } void array_delete( ARRAY A, CELL *cp) { ANODE *ap ; int redid ; if (A->size == 0) return ; switch(cp->type) { case C_DOUBLE : { double d = cp->dval ; Int ival = d_to_I(d) ; if ((double)ival == d) { if (A->type == AY_SPLIT) { if (ival >=1 && ival <= (int) A->size) convert_split_array_to_table(A) ; else return ; /* ival not in range */ } ap = find_by_ival(A, ival, NO_CREATE, &redid) ; if (ap) { /* remove from the front of the ilist */ DUAL_LINK *table = (DUAL_LINK*) A->ptr ; table[(unsigned) ap->ival & A->hmask].ilink = ap->ilink ; if (ap->sval) { ANODE *p, *q = 0 ; unsigned indx = (unsigned) ap->hval & A->hmask ; p = table[indx].slink ; while(p != ap) { q = p ; p = q->slink ; } if (q) q->slink = p->slink ; else table[indx].slink = p->slink ; free_STRING(ap->sval) ; } cell_destroy(&ap->cell) ; ZFREE(ap) ; if (--A->size == 0) array_clear(A) ; } return ; } else { /* get the string value */ char buff[260] ; STRING *sval ; sprintf(buff, string(CONVFMT)->str, d) ; sval = new_STRING(buff) ; ap = find_by_sval(A, sval, NO_CREATE, &redid) ; free_STRING(sval) ; } } break ; case C_NOINIT : ap = find_by_sval(A, &null_str, NO_CREATE, &redid) ; break ; default : ap = find_by_sval(A, string(cp), NO_CREATE, &redid) ; break ; } if (ap) { /* remove from the front of the slist */ DUAL_LINK *table = (DUAL_LINK*) A->ptr ; table[ap->hval & A->hmask].slink = ap->slink ; if (ap->ival != NOT_AN_IVALUE) { ANODE *p, *q = 0 ; unsigned indx = (unsigned) ap->ival & A->hmask ; p = table[indx].ilink ; while(p != ap) { q = p ; p = q->ilink ; } if (q) q->ilink = p->ilink ; else table[indx].ilink = p->ilink ; } free_STRING(ap->sval) ; cell_destroy(&ap->cell) ; ZFREE(ap) ; if (--A->size == 0) array_clear(A) ; } } void array_load( ARRAY A, size_t cnt) { if (A->type != AY_SPLIT || A->limit < cnt) { array_clear(A) ; A->limit = (cnt & (size_t) ~3) + 4 ; A->ptr = zmalloc(A->limit*sizeof(CELL)) ; A->type = AY_SPLIT ; } else { /* reusing an existing AY_SPLIT array */ size_t i ; for(i=0; i < A->size; i++) { cell_destroy((CELL*)A->ptr + i) ; } } A->size = cnt ; transfer_to_array((CELL*) A->ptr, cnt) ; } void array_clear(ARRAY A) { unsigned i ; ANODE *p, *q ; if (A->type == AY_SPLIT) { for(i = 0; i < A->size; i++) cell_destroy((CELL*)A->ptr+i) ; zfree(A->ptr, A->limit * sizeof(CELL)) ; } else if (A->type & AY_STR) { DUAL_LINK *table = (DUAL_LINK*) A->ptr ; for(i=0; (unsigned) i <= A->hmask; i++) { p = table[i].slink ; while(p) { q = p ; p = q->slink ; free_STRING(q->sval) ; cell_destroy(&q->cell) ; ZFREE(q) ; } } zfree(A->ptr, (A->hmask+1)*sizeof(DUAL_LINK)) ; } else if (A->type & AY_INT) { DUAL_LINK *table = (DUAL_LINK*) A->ptr ; for(i=0; (unsigned) i <= A->hmask; i++) { p = table[i].ilink ; while(p) { q = p ; p = q->ilink ; cell_destroy(&q->cell) ; ZFREE(q) ; } } zfree(A->ptr, (A->hmask+1)*sizeof(DUAL_LINK)) ; } memset(A, 0, sizeof(*A)) ; } static int string_compare( const void *l, const void *r) { STRING*const * a = (STRING *const *) l; STRING*const * b = (STRING *const *) r; return strcmp((*a)->str, (*b)->str); } STRING** array_loop_vector( ARRAY A, size_t *sizep) { STRING** ret ; *sizep = A->size ; if (A->size > 0) { if (!(A->type & AY_STR)) add_string_associations(A) ; ret = (STRING**) zmalloc(A->size*sizeof(STRING*)) ; { int r = 0 ; /* indexes ret */ DUAL_LINK* table = (DUAL_LINK*) A->ptr ; int i ; /* indexes table */ ANODE *p ; /* walks slists */ for(i=0; (unsigned) i <= A->hmask; i++) { for(p = table[i].slink; p ; p = p->slink) { ret[r++] = p->sval ; p->sval->ref_cnt++ ; } } } if (getenv("WHINY_USERS") != NULL) /* gawk compatibility */ qsort(ret, A->size, sizeof(STRING*), string_compare); return ret ; } return (STRING**) 0 ; } CELL *array_cat( CELL *sp, int cnt) { CELL *p ; /* walks the eval stack */ CELL subsep ; /* local copy of SUBSEP */ size_t subsep_len ; /* string length of subsep_str */ char *subsep_str ; size_t total_len ; /* length of cat'ed expression */ CELL *top ; /* value of sp at entry */ char *target ; /* build cat'ed char* here */ STRING *sval ; /* build cat'ed STRING here */ cellcpy(&subsep, SUBSEP) ; if ( subsep.type < C_STRING ) cast1_to_s(&subsep) ; subsep_len = string(&subsep)->len ; subsep_str = string(&subsep)->str ; assert(cnt > 0); top = sp ; sp -= (cnt-1) ; total_len = ((size_t) (cnt-1)) * subsep_len ; for(p = sp ; p <= top ; p++) { if ( p->type < C_STRING ) cast1_to_s(p) ; total_len += string(p)->len ; } sval = new_STRING0(total_len) ; target = sval->str ; for(p = sp ; p < top ; p++) { memcpy(target, string(p)->str, string(p)->len) ; target += string(p)->len ; memcpy(target, subsep_str, subsep_len) ; target += subsep_len ; } /* now p == top */ memcpy(target, string(p)->str, string(p)->len) ; for(p = sp; p <= top ; p++) free_STRING(string(p)) ; free_STRING(string(&subsep)) ; /* set contents of sp , sp->type > C_STRING is possible so reset */ sp->type = C_STRING ; sp->ptr = (PTR) sval ; return sp ; } static ANODE* find_by_ival( ARRAY A , Int ival , int create_flag , int *redo ) { DUAL_LINK *table = (DUAL_LINK*) A->ptr ; unsigned indx = (unsigned) ival & A->hmask ; ANODE *p = table[indx].ilink ; /* walks ilist */ ANODE *q = (ANODE*) 0 ; /* trails p */ while(1) { if (!p) { /* search failed */ if (A->type & AY_STR) { /* need to search by string */ char buff[256] ; STRING *sval ; sprintf(buff, INT_FMT, ival) ; sval = new_STRING(buff) ; p = find_by_sval(A, sval, create_flag, redo) ; if (*redo) { table = (DUAL_LINK*) A->ptr ; } free_STRING(sval) ; if (!p) return (ANODE*) 0 ; } else if (create_flag) { p = ZMALLOC(ANODE) ; p->sval = (STRING*) 0 ; p->cell.type = C_NOINIT ; if (++A->size > A->limit) { double_the_hash_table(A) ; /* changes table, may change index */ table = (DUAL_LINK*) A->ptr ; indx = A->hmask & (unsigned) ival ; } } else return (ANODE*) 0 ; p->ival = ival ; A->type |= AY_INT ; break ; } else if (p->ival == ival) { /* found it, now move to the front */ if (!q) /* already at the front */ return p ; /* delete for insertion at the front */ q->ilink = p->ilink ; break ; } q = p ; p = q->ilink ; } /* insert at the front */ p->ilink = table[indx].ilink ; table[indx].ilink = p ; return p ; } static ANODE* find_by_sval( ARRAY A , STRING *sval , int create_flag , int *redo ) { unsigned hval = ahash(sval) ; char *str = sval->str ; DUAL_LINK *table ; unsigned indx ; ANODE *p ; /* walks list */ ANODE *q = (ANODE*) 0 ; /* trails p */ if (! (A->type & AY_STR)) add_string_associations(A) ; table = (DUAL_LINK*) A->ptr ; indx = hval & A->hmask ; p = table[indx].slink ; *redo = 0 ; while(1) { if (!p) { if (create_flag) { { p = ZMALLOC(ANODE) ; p->sval = sval ; sval->ref_cnt++ ; p->ival = NOT_AN_IVALUE ; p->hval = hval ; p->cell.type = C_NOINIT ; if (++A->size > A->limit) { double_the_hash_table(A) ; /* changes table, may change index */ table = (DUAL_LINK*) A->ptr ; indx = hval & A->hmask ; *redo = 1 ; } } break ; } return (ANODE*) 0 ; } else if (p->hval == hval) { if (strcmp(p->sval->str,str) == 0 ) { /* found */ if (!q) /* already at the front */ return p ; else { /* delete for move to the front */ q->slink = p->slink ; break ; } } } q = p ; p = q->slink ; } p->slink = table[indx].slink ; table[indx].slink = p ; return p ; } static void add_string_associations(ARRAY A) { if (A->type == AY_NULL) make_empty_table(A, AY_STR) ; else { DUAL_LINK *table ; int i ; /* walks table */ ANODE *p ; /* walks ilist */ char buff[256] ; if (A->type == AY_SPLIT) convert_split_array_to_table(A) ; table = (DUAL_LINK*) A->ptr ; for(i=0; (unsigned) i <= A->hmask; i++) { p = table[i].ilink ; while(p) { sprintf(buff, INT_FMT, p->ival) ; p->sval = new_STRING(buff) ; p->hval = ahash(p->sval) ; p->slink = table[A->hmask&p->hval].slink ; table[A->hmask&p->hval].slink = p ; p = p->ilink ; } } A->type |= AY_STR ; } } static void make_empty_table( ARRAY A , int type ) /* AY_INT or AY_STR */ { size_t sz = (STARTING_HMASK+1)*sizeof(DUAL_LINK) ; A->type = (short) type ; A->hmask = STARTING_HMASK ; A->limit = hmask_to_limit(STARTING_HMASK) ; A->ptr = memset(zmalloc(sz), 0, sz) ; } static void convert_split_array_to_table(ARRAY A) { CELL *cells = (CELL*) A->ptr ; unsigned i ; /* walks cells */ DUAL_LINK *table ; unsigned j ; /* walks table */ size_t entry_limit = A->limit ; A->hmask = STARTING_HMASK ; A->limit = hmask_to_limit(STARTING_HMASK) ; while(A->size > A->limit) { A->hmask = (A->hmask<<1) + 1 ; /* double the size */ A->limit = hmask_to_limit(A->hmask) ; } { size_t sz = (A->hmask+1)*sizeof(DUAL_LINK) ; A->ptr = memset(zmalloc(sz), 0, sz) ; table = (DUAL_LINK*) A->ptr ; } /* insert each cells[i] in the new hash table on an ilist */ for(i=0, j=1; i < A->size; i++) { ANODE *p = ZMALLOC(ANODE) ; p->sval = (STRING*) 0 ; p->ival = (Int) (i + 1) ; p->cell = cells[i] ; p->ilink = table[j].ilink ; table[j].ilink = p ; j++ ; j &= A->hmask ; } A->type = AY_INT ; zfree(cells, entry_limit*sizeof(CELL)) ; } static void double_the_hash_table(ARRAY A) { unsigned old_hmask = A->hmask ; unsigned new_hmask = (old_hmask<<1)+1 ; DUAL_LINK *table ; A->ptr = zrealloc(A->ptr, (old_hmask+1)*sizeof(DUAL_LINK), (new_hmask+1)*sizeof(DUAL_LINK)) ; table = (DUAL_LINK*) A->ptr ; /* zero out the new part which is the back half */ memset(&table[old_hmask+1], 0, (old_hmask+1)*sizeof(DUAL_LINK)) ; if (A->type & AY_STR) { unsigned i ; /* index to old lists */ unsigned j ; /* index to new lists */ ANODE *p ; /* walks an old list */ ANODE *q ; /* trails p for deletion */ ANODE *tail ; /* builds new list from the back */ ANODE dummy0, dummy1 ; for(i=0, j=old_hmask+1; i <= old_hmask; i++, j++) { q = &dummy0 ; q->slink = p = table[i].slink ; tail = &dummy1 ; while (p) { if ((p->hval & new_hmask) != (unsigned) i) { /* move it */ q->slink = p->slink ; tail = tail->slink = p ; } else q = p ; p = q->slink ; } table[i].slink = dummy0.slink ; tail->slink = (ANODE*) 0 ; table[j].slink = dummy1.slink ; } } if (A->type & AY_INT) { unsigned i ; /* index to old lists */ unsigned j ; /* index to new lists */ ANODE *p ; /* walks an old list */ ANODE *q ; /* trails p for deletion */ ANODE *tail ; /* builds new list from the back */ ANODE dummy0, dummy1 ; for(i=0, j=old_hmask+1; i <= old_hmask; i++, j++) { q = &dummy0 ; q->ilink = p = table[i].ilink ; tail = &dummy1 ; while (p) { if (((unsigned) p->ival & new_hmask) != i) { /* move it */ q->ilink = p->ilink ; tail = tail->ilink = p ; } else q = p ; p = q->ilink ; } table[i].ilink = dummy0.ilink ; tail->ilink = (ANODE*) 0 ; table[j].ilink = dummy1.ilink ; } } A->hmask = new_hmask ; A->limit = hmask_to_limit(new_hmask) ; } mawk-1.3.4-20200120/rexp1.c0000644000175100001440000001316712773552401013302 0ustar tomusers/******************************************** rexp1.c copyright 2009-2010,2016, Thomas E. Dickey copyright 1991,1993, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: rexp1.c,v 1.16 2016/09/30 21:11:29 tom Exp $ */ /* re machine operations */ #include "rexp.h" /* initialize a two state machine */ static void new_TWO( int type, MACHINE * mp) /* init mp-> */ { mp->start = (STATE *) RE_malloc(2 * STATESZ); mp->stop = mp->start + 1; mp->start->s_type = (SType) type; mp->stop->s_type = M_ACCEPT; } /* build a machine that recognizes any */ MACHINE RE_any(void) { MACHINE x; new_TWO(M_ANY, &x); return x; } /* build a machine that recognizes the start of string */ MACHINE RE_start(void) { MACHINE x; new_TWO(M_START, &x); return x; } MACHINE RE_end(void) { MACHINE x; new_TWO(M_END, &x); return x; } /* build a machine that recognizes a class */ MACHINE RE_class(BV * bvp) { MACHINE x; new_TWO(M_CLASS, &x); x.start->s_data.bvp = bvp; return x; } MACHINE RE_u(void) { MACHINE x; new_TWO(M_U, &x); return x; } MACHINE RE_str(char *str, size_t len) { MACHINE x; new_TWO(M_STR, &x); x.start->s_len = (SLen) len; x.start->s_data.str = str; return x; } /* replace m and n by a machine that recognizes mn */ void RE_cat(MACHINE * mp, MACHINE * np) { size_t sz1, sz2, sz; sz1 = (size_t) (mp->stop - mp->start); sz2 = (size_t) (np->stop - np->start + 1); sz = sz1 + sz2; mp->start = (STATE *) RE_realloc(mp->start, sz * STATESZ); mp->stop = mp->start + (sz - 1); memcpy(mp->start + sz1, np->start, sz2 * STATESZ); RE_free(np->start); } /* replace m by a machine that recognizes m|n */ void RE_or(MACHINE * mp, MACHINE * np) { register STATE *p; size_t szm, szn; szm = (size_t) (mp->stop - mp->start + 1); szn = (size_t) (np->stop - np->start + 1); p = (STATE *) RE_malloc((szm + szn + 1) * STATESZ); memcpy(p + 1, mp->start, szm * STATESZ); RE_free(mp->start); mp->start = p; (mp->stop = p + szm + szn)->s_type = M_ACCEPT; p->s_type = M_2JA; p->s_data.jump = (int) (szm + 1); memcpy(p + szm + 1, np->start, szn * STATESZ); RE_free(np->start); (p += szm)->s_type = M_1J; p->s_data.jump = (int) szn; } /* * Ignore attempts to wrap an atom using zero-or-more repetitions in another * loop with the same condition. */ static int ignore_star_star(MACHINE * mp) { size_t sz = (size_t) (mp->stop - mp->start + 1); if (sz >= 4) { STATE *p = mp->start; STATE *q = mp->stop; if ((p->s_type % U_ON) != M_2JA) { ; } else if (p->s_data.jump != 4) { TRACE((".. expected jump %d\n", p->s_data.jump)); } else if (((p + 1)->s_type % U_ON) != M_SAVE_POS) { TRACE((".. expected save %s\n", REs_type(p + 1))); } else if (((q - 2)->s_type % U_ON) != M_CLASS && ((q - 2)->s_type % U_ON) != M_STR && ((q - 2)->s_type % U_ON) != M_U) { TRACE((".. expected atom %s\n", REs_type(q - 2))); } else if (((q - 1)->s_type % U_ON) != M_2JC) { TRACE(("ignored loop %s\n", REs_type(q - 1))); } else { TRACE(("ignore repeated loop\n")); return 1; } } return 0; } /* UNARY OPERATIONS */ /* replace m by m* */ void RE_close(MACHINE * mp) { register STATE *p; size_t sz; if (ignore_star_star(mp)) return; /* * 2JA end * loop: * SAVE_POS * m * 2JC loop * end: * ACCEPT */ sz = (size_t) (mp->stop - mp->start + 1); p = (STATE *) RE_malloc((sz + 3) * STATESZ); memcpy(p + 2, mp->start, sz * STATESZ); RE_free(mp->start); mp->start = p; mp->stop = p + (sz + 2); p->s_type = M_2JA; p->s_data.jump = (int) (sz + 2); (++p)->s_type = M_SAVE_POS; (p += sz)->s_type = M_2JC; p->s_data.jump = -(int) sz; (p + 1)->s_type = M_ACCEPT; } /* replace m by m+ (positive closure) */ void RE_poscl(MACHINE * mp) { register STATE *p; size_t sz; if (ignore_star_star(mp)) return; /* * loop: * SAVE_POS * m * 2JC loop * ACCEPT */ sz = (size_t) (mp->stop - mp->start + 1); p = (STATE *) RE_malloc((sz + 2) * STATESZ); memcpy(p + 1, mp->start, sz * STATESZ); RE_free(mp->start); mp->start = p; mp->stop = p + (sz + 1); p++->s_type = M_SAVE_POS; p += sz - 1; p->s_type = M_2JC; p->s_data.jump = -((int) sz); (p + 1)->s_type = M_ACCEPT; } /* replace m by m? (zero or one) */ void RE_01(MACHINE * mp) { size_t sz; register STATE *p; sz = (size_t) (mp->stop - mp->start + 1); p = (STATE *) RE_malloc((sz + 1) * STATESZ); memcpy(p + 1, mp->start, sz * STATESZ); RE_free(mp->start); mp->start = p; mp->stop = p + sz; p->s_type = M_2JB; p->s_data.jump = (int) sz; } /*=================================== MEMORY ALLOCATION *==============================*/ PTR RE_malloc(size_t sz) { PTR p; p = malloc(sz); TRACE(("RE_malloc(%lu) ->%p\n", (unsigned long) sz, p)); if (p == 0) RE_error_trap(MEMORY_FAILURE); return p; } PTR RE_realloc(PTR p, size_t sz) { PTR q; q = realloc(p, sz); TRACE(("RE_realloc(%p, %lu) ->%p\n", p, (unsigned long) sz, q)); if (q == 0) RE_error_trap(MEMORY_FAILURE); return q; } #ifdef NO_LEAKS void RE_free(PTR p) { TRACE(("RE_free(%p)\n", p)); free(p); } #endif mawk-1.3.4-20200120/code.c0000644000175100001440000002005113425166731013145 0ustar tomusers/******************************************** code.c copyright 2009-2016,2019, Thomas E. Dickey copyright 1991-1994,1995, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: code.c,v 1.39 2019/02/02 01:09:45 tom Exp $ */ #include "mawk.h" #include "code.h" #include "init.h" #include "jmp.h" #include "field.h" #ifdef NO_LEAKS #include "repl.h" #include "scan.h" #endif static CODEBLOCK *new_code(void); CODEBLOCK active_code; CODEBLOCK *main_code_p, *begin_code_p, *end_code_p; INST *begin_start, *main_start, *end_start; size_t begin_size, main_size, end_size; INST *execution_start = 0; /* grow the active code */ void code_grow(void) { unsigned oldsize = (unsigned) (code_limit - code_base); unsigned newsize = PAGESZ + oldsize; unsigned delta = (unsigned) (code_ptr - code_base); if (code_ptr > code_limit) bozo("CODEWARN is too small"); code_base = (INST *) zrealloc(code_base, INST_BYTES(oldsize), INST_BYTES(newsize)); code_limit = code_base + newsize; code_warn = code_limit - CODEWARN; code_ptr = code_base + delta; } /* shrinks executable code that's done to its final size */ INST * code_shrink(CODEBLOCK * p, size_t *sizep) { size_t oldsize = INST_BYTES(p->limit - p->base); size_t newsize = INST_BYTES(p->ptr - p->base); INST *retval; *sizep = newsize; retval = (INST *) zrealloc(p->base, oldsize, newsize); TRACE(("code_shrink old %p %lu, new %p %lu\n", (void *) p->base, oldsize, (void *) retval, newsize)); ZFREE(p); return retval; } /* code an op and a pointer in the active_code */ void xcode2(int op, PTR ptr) { register INST *p = code_ptr + 2; if (p >= code_warn) { code_grow(); p = code_ptr + 2; } p[-2].op = op; p[-1].ptr = ptr; code_ptr = p; } /* code two ops in the active_code */ void code2op(int x, int y) { register INST *p = code_ptr + 2; if (p >= code_warn) { code_grow(); p = code_ptr + 2; } p[-2].op = x; p[-1].op = y; code_ptr = p; } void code_init(void) { main_code_p = new_code(); active_code = *main_code_p; code1(_OMAIN); } /* final code relocation set_code() as in set concrete */ void set_code(void) { /* set the main code which is active_code */ if (end_code_p || code_offset > 1) { int gl_offset = code_offset; if (NR_flag) code2op(OL_GL_NR, _HALT); else code2op(OL_GL, _HALT); *main_code_p = active_code; main_start = code_shrink(main_code_p, &main_size); next_label = main_start + gl_offset; execution_start = main_start; } else { /* only BEGIN */ zfree(code_base, INST_BYTES(PAGESZ)); code_base = 0; ZFREE(main_code_p); } /* set the END code */ if (end_code_p) { active_code = *end_code_p; code2op(_EXIT0, _HALT); *end_code_p = active_code; end_start = code_shrink(end_code_p, &end_size); } /* set the BEGIN code */ if (begin_code_p) { active_code = *begin_code_p; if (main_start) code2op(_JMAIN, _HALT); else code2op(_EXIT0, _HALT); *begin_code_p = active_code; begin_start = code_shrink(begin_code_p, &begin_size); execution_start = begin_start; } if (!execution_start) { /* program had functions but no pattern-action bodies */ execution_start = begin_start = (INST *) zmalloc(2 * sizeof(INST)); execution_start[0].op = _EXIT0; execution_start[1].op = _HALT; } } void dump_code(void) { dump_funcs(); /* dumps all user functions */ if (begin_start) { fprintf(stdout, "BEGIN\n"); da(begin_start, stdout); } if (end_start) { fprintf(stdout, "END\n"); da(end_start, stdout); } if (main_start) { fprintf(stdout, "MAIN\n"); da(main_start, stdout); } dump_regex(); /* dumps all regular expressions */ } static CODEBLOCK * new_code(void) { CODEBLOCK *p = ZMALLOC(CODEBLOCK); p->base = (INST *) zmalloc(INST_BYTES(PAGESZ)); p->limit = p->base + PAGESZ; p->warn = p->limit - CODEWARN; p->ptr = p->base; return p; } /* moves the active_code from MAIN to a BEGIN or END */ void be_setup(int scope) { *main_code_p = active_code; if (scope == SCOPE_BEGIN) { if (!begin_code_p) begin_code_p = new_code(); active_code = *begin_code_p; } else { if (!end_code_p) end_code_p = new_code(); active_code = *end_code_p; } } #ifdef NO_LEAKS void free_cell_data(CELL *cp) { switch (cp->type) { case C_RE: TRACE(("\t... C_RE\n")); re_destroy(cp->ptr); zfree(cp, sizeof(CELL)); break; case C_REPL: TRACE(("\t... C_REPL\n")); repl_destroy(cp); zfree(cp, sizeof(CELL)); break; case C_REPLV: TRACE(("\t... C_REPLV\n")); repl_destroy(cp); zfree(cp, sizeof(CELL)); break; case C_MBSTRN: case C_STRING: case C_STRNUM: if (cp >= (field + (nf < 1 ? 1 : nf)) || (cp < field)) { cell_destroy(cp); } break; } } void free_codes(const char *tag, INST * base, size_t size) { INST *cdp; INST *last = base + (size / sizeof(*last)); CELL *cp; (void) tag; TRACE(("free_codes(%s) base %p, size %lu\n", tag, (void *) base, size)); if (base != 0 && size != 0) { for (cdp = base; cdp < last; ++cdp) { TRACE_INST(cdp, base); switch ((MAWK_OPCODES) (cdp->op)) { case AE_PUSHA: case AE_PUSHI: ++cdp; /* skip pointer */ cp = (CELL *) (cdp->ptr); if (cp != 0) { free_cell_data(cp); } break; case _MATCH0: case _MATCH1: ++cdp; /* skip pointer */ re_destroy(cdp->ptr); break; case LAE_PUSHA: case LA_PUSHA: case A_CAT: ++cdp; /* skip value */ break; case A_PUSHA: case L_PUSHA: case L_PUSHI: case _BUILTIN: case _PRINT: case _PUSHA: case _PUSHI: case _PUSHINT: ++cdp; /* skip value */ break; case _PUSHD: ++cdp; /* skip value */ if (cdp->ptr != &double_one && cdp->ptr != &double_zero) zfree(cdp->ptr, sizeof(double)); break; case F_PUSHI: ++cdp; /* skip pointer */ ++cdp; /* skip integer */ break; case _PUSHS: ++cdp; /* skip value */ free_STRING((STRING *) (cdp->ptr)); break; case _RANGE: cdp += 4; /* PAT1 */ break; case _CALL: cdp += 1 + cdp[2].op; break; case A_DEL: case A_LENGTH: case A_TEST: case DEL_A: case FE_PUSHA: case FE_PUSHI: case F_ADD_ASG: case F_ASSIGN: case F_DIV_ASG: case F_MOD_ASG: case F_MUL_ASG: case F_POST_DEC: case F_POST_INC: case F_POW_ASG: case F_PRE_DEC: case F_PRE_INC: case F_PUSHA: case F_SUB_ASG: case NF_PUSHI: case OL_GL: case OL_GL_NR: case POP_AL: case _ADD: case _ADD_ASG: case _ASSIGN: case _CAT: case _DIV: case _DIV_ASG: case _EQ: case _EXIT0: /* this does free memory... */ case _EXIT: case _GT: case _GTE: case _HALT: case _JMAIN: case _LT: case _LTE: case _MATCH2: case _MOD: case _MOD_ASG: case _MUL: case _MUL_ASG: case _NEQ: case _NEXT: case _NEXTFILE: case _NOT: case _OMAIN: case _POP: case _POST_DEC: case _POST_INC: case _POW: case _POW_ASG: case _PRE_DEC: case _PRE_INC: case _RET0: case _RET: case _STOP: case _SUB: case _SUB_ASG: case _TEST: case _UMINUS: case _UPLUS: break; case _JNZ: case _JZ: case _LJZ: case _LJNZ: case _JMP: case _PUSHC: case ALOOP: case LAE_PUSHI: case SET_ALOOP: ++cdp; /* cdp->op is literal param */ break; } } zfree(base, size); } } void code_leaks(void) { TRACE(("code_leaks\n")); if (begin_start != 0) { free_codes("BEGIN", begin_start, begin_size); begin_start = 0; begin_size = 0; } if (end_start != 0) { free_codes("END", end_start, end_size); end_start = 0; end_size = 0; } if (main_start != 0) { free_codes("MAIN", main_start, main_size); main_start = 0; main_size = 0; } } #endif mawk-1.3.4-20200120/cast.c0000644000175100001440000002025312773450670013174 0ustar tomusers/******************************************** cast.c copyright 2009-2014,2016, Thomas E. Dickey copyright 1991-1995,1996, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: cast.c,v 1.21 2016/09/30 11:51:20 tom Exp $ */ /* cast.c */ #include "mawk.h" #include "field.h" #include "memory.h" #include "scan.h" #include "repl.h" const int mpow2[NUM_CELL_TYPES] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512}; void cast1_to_d(CELL *cp) { switch (cp->type) { case C_NOINIT: cp->dval = 0.0; break; case C_DOUBLE: return; case C_MBSTRN: case C_STRING: { register STRING *s = (STRING *) cp->ptr; errno = 0; #ifdef FPE_TRAPS_ON /* look for overflow error */ cp->dval = strtod(s->str, (char **) 0); if (errno && cp->dval != 0.0) /* ignore underflow */ rt_error("overflow converting %s to double", s->str); #else cp->dval = strtod(s->str, (char **) 0); #endif free_STRING(s); } break; case C_STRNUM: /* don't need to convert, but do need to free the STRING part */ free_STRING(string(cp)); break; default: bozo("cast on bad type"); } cp->type = C_DOUBLE; } void cast2_to_d(CELL *cp) { register STRING *s; switch (cp->type) { case C_NOINIT: cp->dval = 0.0; break; case C_DOUBLE: goto two; case C_STRNUM: free_STRING(string(cp)); break; case C_MBSTRN: case C_STRING: s = (STRING *) cp->ptr; errno = 0; #ifdef FPE_TRAPS_ON /* look for overflow error */ cp->dval = strtod(s->str, (char **) 0); if (errno && cp->dval != 0.0) /* ignore underflow */ rt_error("overflow converting %s to double", s->str); #else cp->dval = strtod(s->str, (char **) 0); #endif free_STRING(s); break; default: bozo("cast on bad type"); } cp->type = C_DOUBLE; two: cp++; switch (cp->type) { case C_NOINIT: cp->dval = 0.0; break; case C_DOUBLE: return; case C_STRNUM: free_STRING(string(cp)); break; case C_MBSTRN: case C_STRING: s = (STRING *) cp->ptr; errno = 0; #ifdef FPE_TRAPS_ON /* look for overflow error */ cp->dval = strtod(s->str, (char **) 0); if (errno && cp->dval != 0.0) /* ignore underflow */ rt_error("overflow converting %s to double", s->str); #else cp->dval = strtod(s->str, (char **) 0); #endif free_STRING(s); break; default: bozo("cast on bad type"); } cp->type = C_DOUBLE; } void cast1_to_s(CELL *cp) { register Int lval; char xbuff[260]; switch (cp->type) { case C_NOINIT: null_str.ref_cnt++; cp->ptr = (PTR) & null_str; break; case C_DOUBLE: lval = d_to_I(cp->dval); if (lval == cp->dval) sprintf(xbuff, INT_FMT, lval); else sprintf(xbuff, string(CONVFMT)->str, cp->dval); cp->ptr = (PTR) new_STRING(xbuff); break; case C_STRING: return; case C_MBSTRN: case C_STRNUM: break; default: bozo("bad type on cast"); } cp->type = C_STRING; } void cast2_to_s(CELL *cp) { register Int lval; char xbuff[260]; switch (cp->type) { case C_NOINIT: null_str.ref_cnt++; cp->ptr = (PTR) & null_str; break; case C_DOUBLE: lval = d_to_I(cp->dval); if (lval == cp->dval) sprintf(xbuff, INT_FMT, lval); else sprintf(xbuff, string(CONVFMT)->str, cp->dval); cp->ptr = (PTR) new_STRING(xbuff); break; case C_STRING: goto two; case C_MBSTRN: case C_STRNUM: break; default: bozo("bad type on cast"); } cp->type = C_STRING; two: cp++; switch (cp->type) { case C_NOINIT: null_str.ref_cnt++; cp->ptr = (PTR) & null_str; break; case C_DOUBLE: lval = d_to_I(cp->dval); if (lval == cp->dval) sprintf(xbuff, INT_FMT, lval); else sprintf(xbuff, string(CONVFMT)->str, cp->dval); cp->ptr = (PTR) new_STRING(xbuff); break; case C_STRING: return; case C_MBSTRN: case C_STRNUM: break; default: bozo("bad type on cast"); } cp->type = C_STRING; } void cast_to_RE(CELL *cp) { register PTR p; if (cp->type < C_STRING) cast1_to_s(cp); p = re_compile(string(cp)); no_leaks_re_ptr(p); free_STRING(string(cp)); cp->type = C_RE; cp->ptr = p; } void cast_for_split(CELL *cp) { static const char meta[] = "^$.*+?|[]()"; static char xbuff[] = "\\X"; int c; size_t len; if (cp->type < C_STRING) cast1_to_s(cp); if ((len = string(cp)->len) == 1) { if ((c = string(cp)->str[0]) == ' ') { free_STRING(string(cp)); cp->type = C_SPACE; return; } else if (c == 0) { #ifdef LOCAL_REGEXP char temp[1]; temp[0] = (char) c; free_STRING(string(cp)); cp->ptr = (PTR) new_STRING1(temp, (size_t) 1); #else /* * A null is not a meta character, but strchr will match it anyway. * For now, there's no reason to compile a null as a regular * expression - just return a string containing the single * character. That is used in a special case in set_rs_shadow(). */ char temp[2]; temp[0] = (char) c; free_STRING(string(cp)); cp->ptr = (PTR) new_STRING1(temp, (size_t) 1); return; #endif } else if ((strchr) (meta, c)) { xbuff[1] = (char) c; free_STRING(string(cp)); cp->ptr = (PTR) new_STRING(xbuff); } } else if (len == 0) { free_STRING(string(cp)); cp->type = C_SNULL; return; } cast_to_RE(cp); } /* input: cp-> a CELL of type C_MBSTRN (maybe strnum) test it -- casting it to the appropriate type which is C_STRING or C_STRNUM */ void check_strnum(CELL *cp) { char *temp; register unsigned char *s, *q; cp->type = C_STRING; /* assume not C_STRNUM */ s = (unsigned char *) string(cp)->str; q = s + string(cp)->len; while (scan_code[*s] == SC_SPACE) s++; if (s == q) return; while (scan_code[q[-1]] == SC_SPACE) q--; if (scan_code[q[-1]] != SC_DIGIT && q[-1] != '.') return; switch (scan_code[*s]) { case SC_DIGIT: case SC_PLUS: case SC_MINUS: case SC_DOT: errno = 0; #ifdef FPE_TRAPS_ON cp->dval = strtod((char *) s, &temp); /* make overflow pure string */ if (errno && cp->dval != 0.0) break; #else cp->dval = strtod((char *) s, &temp); #endif #ifdef ERANGE if (errno == ERANGE) break; #endif if ((char *) q <= temp) { cp->type = C_STRNUM; /* <= instead of == , for some buggy strtod e.g. Apple Unix */ } break; } } /* cast a CELL to a replacement cell */ void cast_to_REPL(CELL *cp) { register STRING *sval; if (cp->type < C_STRING) cast1_to_s(cp); sval = (STRING *) cp->ptr; cellcpy(cp, repl_compile(sval)); free_STRING(sval); } /* convert a double to Int (this is not as simple as a cast because the results are undefined if it won't fit). Truncate large values to +Max_Int or -Max_Int Send nans to -Max_Int */ Int d_to_I(double d) { if (d >= Max_Int) return Max_Int; if (d > -Max_Int) return (Int) d; return -Max_Int; } /* convert a double to UInt (this is not as simple as a cast because the results are undefined if it won't fit). Truncate large values to Max_UInt or 0 Send nans to 0 */ UInt d_to_U(double d) { if (d >= Max_UInt) return Max_UInt; if (d > 0) return (UInt) d; return 0; } #ifdef NO_LEAKS typedef struct _all_cells { struct _all_cells *next; char ptr; CELL *cp; } ALL_CELLS; static ALL_CELLS *all_cells; /* * Some regular expressions are parsed, and the pointer stored in the byte-code * where we cannot distinguish it from other constants. Keep a list here, to * free on exit for auditing. */ void no_leaks_cell(CELL *cp) { ALL_CELLS *p = calloc(1, sizeof(ALL_CELLS)); p->next = all_cells; p->cp = cp; p->ptr = 0; all_cells = p; } void no_leaks_cell_ptr(CELL *cp) { ALL_CELLS *p = calloc(1, sizeof(ALL_CELLS)); p->next = all_cells; p->cp = cp; p->ptr = 1; all_cells = p; } void cell_leaks(void) { while (all_cells != 0) { ALL_CELLS *next = all_cells->next; if (all_cells->ptr) { zfree(all_cells->cp, sizeof(CELL)); } else { free_cell_data(all_cells->cp); } free(all_cells); all_cells = next; } } #endif mawk-1.3.4-20200120/ACKNOWLEDGMENT0000644000175100001440000000276006176763171014131 0ustar tomusersVersion 1.2 =========== Thanks for help with beta test to Bill Davidsen, Tom Dickey, Ed Ferguson, Jack Fitts, Onno van der Linden, Carl Mascott, Jean-Pierre Radley, John Roll, Ian Searle, Bob Stockler. The calendar program examples/hical was written by Bob Stockler. Darrel Hankerson ported versions 1.2.x to DOS/OS2. Version 1.0 and 1.1 =================== Carl Mascott ported mawk to V7 and in the process rooted out some subtle (and not so subtle) bugs. Ian Searle ported mawk to System V and put up with my insane attempts to get fpe exception trapping off. An anonymous reviewer for comp.sources.reviewed did the MSC and Mac ports and wrote .bat files for the tests. Another or maybe the same reviewer did the Dynix port. Ports to new systems: Ed Ferguson MIPS M2000 C2.20 OS4.52 Jwahar R. Bammi Atari ST Berry Kercheval SGI IRIX 4.0.1 Andy Newman Next 2.1 Mike Carlton Next 2.1 Elliot Jaffe AIX 3.1 Jeremy Martin Convex 9.1 Scott Hunziker Coherent 4.0 Ken Poulton Hpux Onno van der Linden 386bsd 0.1 Bob Hutchinson Linux 0.98p14 The DOS version is a lot better thanks to suggestions and testing from Ed Ferguson, Jack Fitts, Nadav Horesh, Michael Golan and Conny Ohstrom. The DOS additions for 1.1.2d are all ideas of Ben Myers; much of the code is his too. Arnold Robbins kept me current on POSIX standards for AWK, and explained some of the "dark corners". Thank you to everyone who reported bugs or offered encouragement, suggestions or criticism. (At least the bugs got fixed). mawk-1.3.4-20200120/split.h0000644000175100001440000000135512405404755013377 0ustar tomusers/******************************************** split.h copyright 2014, Thomas E. Dickey copyright 2014, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: split.h,v 1.2 2014/09/14 21:34:37 tom Exp $ */ /* split.h */ #ifndef SCAN_H #define SCAN_H extern size_t null_split(const char *s, size_t slen); extern size_t re_split(char *s, size_t slen, PTR re); extern size_t space_split(const char *s, size_t slen); extern void transfer_to_array(CELL cp[], size_t cnt); extern void transfer_to_fields(size_t); #endif /* SCAN_H */ mawk-1.3.4-20200120/patchlev.h0000644000175100001440000000072713611306521014044 0ustar tomusers/* patchlev.h copyright 2009-2019,2020, Thomas E. Dickey copyright 1991-1996,2014, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. */ /* * $MawkId: patchlev.h,v 1.95 2020/01/20 11:21:53 tom Exp $ */ #define PATCH_BASE 1 #define PATCH_LEVEL 3 #define PATCH_STRING ".4" #define DATE_STRING "20200120" mawk-1.3.4-20200120/CHANGES0000644000175100001440000007746113611311251013065 0ustar tomusers-- $MawkId: CHANGES,v 1.273 2020/01/20 11:44:41 tom Exp $ Changes by Thomas E Dickey 20200120 + resync with my-autoconf. + fix typos found with codespell. + when reading input in interactive mode, provide for extending the buffer size for very long lines (Original-Mawk #59). 20200106 + correct line-number shown in too-many-arguments error message for the case where the function is a forward reference (report by "mukti"). + fix install for manpage when configure --srcdir option is used (report by Rajeev V Pillai). + use both CFLAGS/LDFLAGS when linking in makefile (report by Rajeev V Pillai). + fix clang-9 warning in bi_funct.c (report by Rajeev V Pillai). + minor improvement to gcc warning options, from vile 20191231 + updated configure macros + update config.guess and config.sub 20190203 + improve manpage formatting, e.g., for man2html + improve debug-traces 20190129 + eliminate non-portable tdestroy() from zmalloc no-leaks code. + updated configure macros + update config.guess and config.sub 20181114 + revert a change for memory-leaks which made the forced-exit via a user function inconsistent with earlier versions (report by Sihera Andre). + amend a change for memory-leaks to avoid a double-free (Original-Mawk #56). 20171017 + add Debian compile/link flags to test-package. + cleanup spurious warnings from latest gcc. + changes for Original-Mawk #48: + add checks for stack overflow and underflow + increase stack limit to 1024 + updated configure macros + update config.guess and config.sub 20161120 + add runtime check for assignments to OFMT and CONVFMT to ensure they use a single parameter (Original-Mawk #47). + repair build for --with-valgrind, broken in 20160930 const-fixes. 20161107 + correct sign-extension from 20160615 change to rand() (report by Christian Neukirchen). 20160930 + optimize closes on regular expressions to filter out redundant wildcards, fixing a special case leftover by changes in 20100224 (Original-Mawk #34). + add regular-expressions to the -Wdump option when using mawk's built-in regular expressions. + fix a sign-extension in character-class parser (Original-Mawk #46). + minor optimizations. + improve use of const in tables. 20160927 + allow single-quote as a flag in printf, to complete the change for LC_NUMERIC in 20121129 (report by Graham Monteith). + revert one of the fixes made for a Coverity warning about loss of precision in 20121209, which unnecessarily exposed a different problem (Original-Mawk #45). 20160918 + simplify "system()" function by calling C "system()" function, and use POSIX macros for wait-status to provide a less-ambiguous return value (suggested by Aharon Robbins). + add a null-pointer check in bi_mktime (patch by Ismael Luceno). 20160905 + escape '/' in range for test/reg4.awk to allow test-comparison with gawk and BWK. + updated configure macros, e.g., for compiler warnings and static analysis: + CF_CC_ENV_FLAGS + CF_GNU_SOURCE + CF_PROG_LINT + CF_RAND + CF_XOPEN_SOURCE + minor build-fix for HPUX 11.11 "make", which is confused by the recursive use of "make" in clean/distclean rules. + amend fix for Gentoo #424137 to eliminate a memory leak when opening files (Original-Mawk #44). + update config.guess and config.sub 20160615 + correct range when using system rand() function, which was 0..2 rather than 0..1 on BSD systems (report/patch by Masaki Waga). 20160313 + correct order of checks for machine state in REtest which caused an out-of-bounds reference (Original-Mawk #36). 20160226 + update COPYING from https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt (Original-Mawk #38). + minor updates to configure script macros + update config.guess and config.sub 20150503 + add --with-man2html configure option + improve description of -W options and how they can be combined into a comma-separated list (adapted from Leif LeBaron). + modify parsing for -Wexec to permit its value to be separated by '=' in addition to a space, for consistency with the other -W options. + cosmetic changes to configure script macros, from work on xterm. + update config.guess and config.sub 20141206 + Mawk behaves incorrectly when using the nextfile statement. It marks the file as dead, but does not check such state and thus ends reading from a closed fd (patch by Ismael Luceno). 20141027 + remove a special check for anchored regular expressions in gsub3 which did not handle expressions with "|" alternation (report by "Ypnose"). 20140914 + rename vs6.mak / vs6.h to vs2008 for Visual Studio 2008 compiles. + remove MS-DOS support. + add a check in split for empty regex, treating that the same as an empty string (Original-Mawk #9). + correct inconsistently-ifdef'd reset of errno in check_strnum() function, which caused some values to be internally classified as strings rather than strnums (Original-Mawk #26). + add parameter to REmatch to control use of REG_NOTBOL and its equivalent in mawk (prompted by discussion with Mike Brennan, Original-Mawk #24). + settle on "gsub3" implementation (suggested by Mike Brennan, Original-Mawk #11). + change default for configure option --enable-init-srand to enable this (discussion with Mike Brennan). + add -W random option to set initial srand() seed. + add TraceVA, use to provide debug-traces for errmsg(). + add note in manpage about "nextfile", see for example: http://www.opengroup.org/austin/docs/austin_578.txt http://austingroupbugs.net/view.php?id=607 + make it possible to build with "bsd" library ported to Linux by setting LIBS=-lbsd before running configure script. + show random-function names in version message, as well as maximum integer-value. + modify initialization of srand default seed from time of day to use gettimeofday, etc., so that successive runs of mawk are less likely to use the same seed value (suggested by Mike Brennan). + make a further refinement, "gsub3" which uses a single pass. + change SType and SLen types to improve performance as well as handling larger regular expressions (suggested by Mike Brennan). + fix some minor issues reported by Coverity. + regenerate parse.c using byacc 20140422 + modify makefile-rule for generating parse.c to keep the "#line" preprocessor lines consistent with the actual filename. This is needed by lcov. + add test/reg7.awk to help with recent testing. + discard intermediate new_gsub used for regression-testing, will do further improvements based on "gsub2". + fix a comparison in rexp3.c to work with embedded nulls (patch by Mike Brennan). + in-progress changes to implement "gsub2", which will reduce copying. + discard intermediate old_gsub used for regression-testing, using original gsub function renamed to "gsub0" for that purpose. + remove old compiler information from version message. + remove NF value from version message. + patches by Mike Brennan: + changed the intermediate storage of STRINGS used by split. + cleaned up the xxx_split() functions. a) removed hand loop unrolling. What was an optimization for intel 8086/88 is silly today. b) consequence of a) some macros went away so the code is easier to read/understand. c) handles null in input string Note: re_split() does \x00 null correctly, but it calls REmatch() which does not. I have examples where REmatch works with nulls and examples of not working. That needs to be fixed. + changed field allocation to support no upper limit. + when comparing two strings, allow for embedded nulls. + add checks in rexp3.c for infinite loop for testcase noloop.awk (report by Tibor Palinkas). + improve test-package for debian by adding postrm script to restore "mawk-base" to its unalternatized configuration, as well as adding messages to the other pre/post scripts. + patches by Mike Brennan: + increase some limits: NF is now 1048575, sprintf limit is 8192. + updated array.w; mostly documentation improvements + add array.pdf generated from array.w + add -Wu / -Wusage / -Wh / -Whelp to show usage message, like gawk. If long options are enabled, honor --help and --usage as well. + if no command-line parameters are given, show usage message like gawk and BWK (report by Michael Sanders). + improve configure macros CF_ADD_CFLAGS, CF_ADD_LIBS, CF_XOPEN_SOURCE, e.g., for Minix3.2 port. + restore in-progress change to gsub; resolved problem handling its internal use of vectors for second parameter when "&" marker is used. + improve configure check for Intel compiler warnings; trim unwanted -no-gcc option. + for Solaris suppress the followup check for defining _XOPEN_SOURCE + update config.guess and config.sub 20131226 + add configure check to work around recent breakage in Cygwin's math.h which declares _LIB_VERSION without allowing it to be updated (report by Gert Hulselmans). + minor updates to configure script, for clang and mingw + update config.guess and config.sub 20130803 + minor updates to configure script + add limit-checks, improve index computation in scan.c to fix old 1.3.3 problems with very long string-literals in the parsed script (report by Marcin Krol). + update config.guess and config.sub 20130219 + modify missing-operand check in rexp.c to allow the case of empty "()", matching behavior of gawk and BWK (report by Arkadiusz Miskiewicz). + revert in-progress change to gsub retain ifdef'd for additional development since it did not handle array as the second parameter (report by Arkadiusz Miskiewicz). 20121209 + build-fix for cygwin in matherr.c, which declares a different type for _LIB_VERSION + add missing "-f" option in examples/gdecl.awk + fix a regression in fflush, ensuring that it returns an error if the argument does not match any output filename (report by Nathan Weeks). + modify wording of configure --help message to make it clear that the default for --with-builtin-regex uses the builtin regular expression engine of mawk. + fix issues reported by Coverity scan. Most of these were minor, and were addressed by modifying the source to allow Coverity to improve its analysis of the code. + amend support for LC_NUMERIC by translating period to the local decimal separator as needed to work with strtod() which is used to validate decimal constants when scanning source files. This fixes an infinite loop with mawk 'BEGIN { print 1.0 }' (report by Jan Psota). + regenerate man/mawk.doc, overlooked in previous updates. 20121129 + change behavior if internal fflush call fails: rather than exiting with an error, propagate the return value to the script as -1, for consistency with gawk and BWK (discussion with Aharon Robbins and Nathan Weeks). + add special case for forward reference to a function using an array parameter, updating the function's parameter type so that the array is passed properly. + support length(array), as done in gawk and BWK awk (Original-Mawk #1). + support LC_NUMERIC, which will modify the displayed decimal point in some locales. It does not modify the decimal point used for input, matching the behavior of nawk and BWK awk (prompted by request from Yechiel Bardov for thousands-separator). + add configure option --enable-init-srand to allow choice whether to initialize random numbers automatically at startup or not. Not doing this makes programs more predictable (Debian #63843, Original-Mawk #3). + add configure option --enable-builtin-srand, use that to deprecate mawk's builtin srand/rand functions which generally are not as good as the system-provided functions. + extend --enable-trace configure option to show builtin functions. + add systime and mktime functions + when warning about unrecognized options, do not exit with error on these gawk options: --lint --lint-old --posix --re-interval --traditional + integrate strftime function (patch by Dominic Letz, Original-Mawk #2). + correct logic for "/dev/stdin" special device (GenToo #424137, Original-Mawk #17). + updates for configure script macros: + modify configure script and makefile to support cross-compiles. + remove Turbo C++ and Zortech C++ makefiles. + remove obsolete function-checks: fmod, memcpy, strchr, strerror, strtod, vfprintf. + remove obsolete checks for some headers: math.h, stdarg.h, stdlib.h, string.h time.h + support --datarootdir option. + add 3rd parameter to AC_DEFINE's to allow autoheader to run. + remove unused macros. + update config.guess and config.sub + add icons for webpage artwork 20120627 + add "/dev/stdin" name for stdin for consistency with other implementations of awk (suggested by Aharon Robbins). + improve overflow check in check_strnum() (Ubuntu #485574). + implement gawk extension "nextfile" (suggested by Aharon Robbins). + updates for configure macros CF_ANSI_CC_CHECK, CF_ENABLE_TRACE, CF_GCC_ATTRIBUTES, CF_GCC_WARNINGS, CF_MAKE_TAGS, CF_MSG_LOG, CF_REGEX, CF_XOPEN_SOURCE. + update config.guess and config.sub 20101210 + update copyright notices to reflect changes made starting 20080909. This commit was made in May 2012, updates only copyright notices needed for project registration on Savannah as discussed in Debian #554167. However, since current policy on Savannah discriminates against GPLv2, it will be hosted elsewhere. See http://invisible-island.net/mawk/ http://github.com/ThomasDickey 20101207 + add configure --enable-trace, to consolidate various debugging traces which were written to stderr. This writes to Trace.out. + modify zmalloc.c to make it simpler to use the --disable-leaks configure script option to analyze memory leaks. The memory pool which interferes with analysis can be disabled by defining DEBUG_ZMALLOC. + (IN-PROGRESS) convert gsub() function from recursive, to non-recursive to lessen use of program stack (Debian #158481). + escape some dashes in manpage, to work with groff. + change section for Debian package to "interpreters" (Debian #442071). + fix printable token value for SC_MATCH in scan.c (report by Heiner Marxen). 20100625 + correct translation of octal and hex escapes for system regular expression library. + modify configure script to support --program-suffix, etc. + add Debian package scripts, for "mawk-cur". + add RPM spec-file. + move release- and patch-level values from version.c to patchlev.h to simplify packaging scripts. 20100618 + correct translation of "^{" pattern for system regular expression library (report by Elias Pipping). + fix sentence fragment in README (report by Elias Pipping). 20100507 + cleanup gcc warnings for 64-bit platform, e.g., use size_t rather than unsigned, etc. + fix warnings from clang --analyze + update/improve configure script + modify CF_GCC_VERSION to ignore stderr, e.g., from c89 alias + modify CF_GCC_WARNINGS, moving -W and -Wall into the list to check, since c89 alias for gcc complains about these options. + add --disable-leaks and related options, for testing. + add lint rule to makefile. + add configure-check for ctags to work with pkgsrc. + amend change of array.w, fixes a regression in "delete" (report by Heiner Marxen). 20100419 + modify split() to handle embedded nulls in the string to split, e.g., BEGIN{s="a\0b"; print length(s); n = split(s,f,""); print n} (report by Morris Lee). + modify array.w to update table pointers in the special case where an array is known to have string-indices, but is later indexed via integers. The problem occurs when the array grows large enough to rehash it, e.g., BEGIN{a["n"];for(i=1;i<1000;++i)printf "%d\n", a[i]; } (report by Morris Lee). + increase size of reference-count for strings to unsigned. It was an unsigned short, which prevented using arrays larger than 64k, e.g., BEGIN{for(i = 1; i <= 65550; ++i){if(i >= 65534 && i<= 65537) print i; s[i] = "a"}; delete s;} (report by Morris Lee). + add special case for Solaris 10 (and up) to configure check CF_XOPEN_SOURCE + refactored configure check CF_REGEX 20100224 + add a configure check for large files (report by Sean Kumar). + modify check in collect_RE() to show the actual limit value, e.g., MIN_SPRINTF-2 used for built-in regular expressions. + increase MIN_SPRINTF, used as limit on regular-expression size, to match the MAX_SPLIT value, i.e., slightly more than doubling the size (report by Markus Gnam). + further modify makefile to build outside the source-tree. + modify makefile and mawktest to use relative path again, since the existing script did not work with openSUSE's build (patch by Guido Berhoerster). + fix makefile's .c.i rule, which lacked CPP definition. + update mawktest.bat script to more/less correspond with mawktest, for Win32 console except where echo command does not handle the required quoting syntax. + add vs6.mak, for Visual Studio 6. + modify mawktest script to report results from all tests, rather than halting on the first failure. + add limit-check after processing match(test, "[^0-9A-Za-z]") to ensure the internal trailing null of the test-string is not mistaken for part of the string, i.e., RSTART, RLENGTH are computed correctly (report by Markus Gnam). + modify parsing of -W option to use comma-separated values, e.g., "-Wi,e" for "-Winteractive" and "-Werror". + add timestamp to scancode.c, to help manage revisions. + improve configure macro CF_XOPEN_SOURCE, making it remove possibly conflicting definitions before adding new ones. + update config.guess and config.sub > patches by Jan Psota: + improve buffering for -Winteractive option. + allow multiple single-character flags after -W, e.g., "-Wie" for "-Winteractive" and "-Werror" to permit these to be passed on a "#"-line of a shell script, e.g., #!/usr/bin/mawk -Wie > patches by Jonathan Nieder: + add new M_SAVE_POS and M_2JC operation codes (states) to the built-in regular expression engine. Use these to reimplement m* (closure), to provide a way to avoid infinite looping on matches against empty strings. This change requires reimplementing the workaround for gawk's noloop1 testcase from 20090726. + improve buffer-overflow check for string_buff. + fix collect_RE to treat "[^]]" as a character class (meaning "not a closing bracket") but "[^^]]" not as one. This also requires initializing the local "start of character class" variable to NULL rather than the beginning of the string, to avoid an invalid array access when collecting expressions such as "^text". + within a character class and not followed by a :, ., or ~, a "[" is just like any other character. This way, you can tell mawk to scan for a literal [ character with "mawk /[[]/", and you can scan for a [ or ] with "mawk /[][]/". Also clean up the relevant loop in do_class() to make it a bit more readable. + outside a character class, a "]" is just like any other character. + prevent do_class() from scanning past the end, e.g., if the terminating zero byte was escaped. + fix regular-expression parsing when a right parenthesis ")" is found without a preceding left parenthesis. + fix resetting of position stack when backtracking. + modify regular-expression engine to avoid exponential running time for some regular expression matches in which the first match mawk finds extends to the end of the string. This is a new fix for the gawk noloop2 test, added here for regression testing. 20091220 + bump version to 1.3.4 + update INSTALL and README files. + improve configure checks for math library. + change test for NaN to use sqrt() rather than log() to work around cygwin's partly broken math functions. + add/use isnanf() to work around other breakage in cygwin math functions. + add configure check for _XOPEN_SOURCE, etc., needed to define proper function pointer for sigaction, e.g., on Tru64. + add check for sigaction function pointer, whose POSIX form is absent from the cygwin header. + extend MAWKBINMODE, adding a third bit which when set will suppress the change for RS or ORS to use CR/LF rather than LF. This is used for MinGW to make the "check" rule in a build work, for instance. + add configure check for functions used for pipe/system calls, e.g., for MinGW where these are absent. + add runtime check for floating-point underflow exceptions + fix an old 1.3.3 bug in re_split(), which did not check properly for the end of buffer; this broke on Tru64. + drop obsolete config-user, v7 and atarist subdirectories + improve configure checks for sigaction, making the definitions used in fpe_check.c consistent with matherr.c + build fixes for AIX, Tru64. + add configure check for 'environ'. + remove redundant setlocale() calls; only LC_CTYPE and LC_NUMERIC are used. 20091213 + add makedeps.sh script to aid in updating object dependencies in Makefile.in + use "mkdir -p" rather than mkdirs.sh (suggested by Aleksey Cheusov). + reformatted this file, to simplify extraction of contributor names. + update config.guess and config.sub > patches by Jonathan Nieder: + modify CF_DISABLE_ECHO autoconf macro to ensure that command lines in Makefile.in begin with a tab. + the makefile does not use $(MAKE); remove the SET_MAKE substitution. + add some files to the "make clean" rule, in case make gets interrupted in the middle of a rule. + add a maintainer-clean rule to the makefile, to remove files which could be regenerated. + fix an unescaped "-" in man/mawk.1 + remove an unneeded cast in bi_funct.c + fix an unused parameter warning in matherr.c + drop unused line_no parameter from compile_error() and its callers. + convert makescan.c to ANSI C, do further cleanup of that file. + split-out scancode.h from scan.h 20090920 + improve hash function by using FNV-1 algorithm (patch/analysis by Jim Mellander). This greatly improves speed for accessing arrays with a large number of distinct keys; however the unsorted order in "for" loops will differ. + add "internal regex" or "external regex" string to version message to allow scripting based on support for embedded nulls. + drop obsolete CF_MAWK_PROG_GCC and CF_MAWK_PROG_YACC macros from configure script (report by Mike Frysinger). + fixes to allow build outside source-tree (report by Mike Frysinger). + correct logic in scan.c to handle expression "[[]" (report by Aleksey Cheusov). + add MAWK_LONG_OPTIONS feature to allow mawk to ignore long options which are not implemented. + two changes for embedded nulls, allows FS to be either a null or contain a character class with null, e.g., '\000' or '[ \000]': + modify built-in regular expression functions to accept embedded nulls. + modify input reader FINgets() to accept embedded nulls in data read from files. Data read from standard input is line-buffered, and is still null-terminated. + update config.guess and config.sub 20090820 + minor portability/standards fixes for examples/hical + add WHINY_USERS sorted-array feature, for compatibility with gawk (patch by Aharon Robbins). + correct lower-limit for d_to_U() function, which broke conversion of zero in "%x" format, added in fix for Debian #303825 (report by Masami Hiramatsu). + modify "%s" and "%c" formatting in printf/sprintf commands to ensure that "%02s" does not do zero-padding, for standards conformance (discussion with Aharon Robbins, Mike Brennan, prompted by Debian #339799). 20090728 + add fallback definitions for GCC_NORETURN and GCC_UNUSED to build with non-gcc compilers (report by Jan Wells). 20090727 + add check/fix to prevent gsub from recurring to modify on a substring of the current line when the regular expression is anchored to the beginning of the line; fixes gawk's anchgsub testcase. + add check for implicit concatenation mistaken for exponent; fixes gawk's hex testcase. + add character-classes to built-in regular expressions. + add 8-bit locale support 20090726 + improve configure checks for MAX__UINT. + add a check for infinite loop in REmatch(), to work with gawk's noloop1 testcase. + modify logic to allow setting RS to an explicit null character, e.g., RS="\0" (Ubuntu #400409). + modify workaround for (incorrect) scripts which use a zero-parameter for substr to ensure the overall length of the result stays the same. For example, from makewhatis: filename_no_gz = substr(filename, 0, RSTART - 1); + move regular-expression files into main directory to simplify building using configure --srcdir and VPATH. + modify internal functions for gsub() to handle a case from makewhatis script from man 1.6f which substitutes embedded zero bytes to a different value (report by Gabor Z Papp). + change default for configure --with-builtin-regex to prefer the builtin regular expressions. They are incomplete, but POSIX regular expressions cannot match nulls embedded in strings. + require standard C compiler; converted to ANSI C. + rename #define'd SV_SIGINFO to MAWK_SV_SIGINFO to avoid predefined name on Mac OS X (report on comp.lang.awk). + revise configure script to use conventional scheme for generating config.h 20090721 + port to cygwin, modifying test-script to work with executable-suffix and fp-exception code to allow const in declaration. 20090712 + bump patch-date. + fix Debian #127293 "mawk does not understand unescaped '/' in character classes", noting that gawk 3.1.6 also has problems with this area. + drop support for varargs; use stdarg only. + add tags rule to makefile. + rename configure option "--with-local-regexp" to "--with-builtin-regex" + add build-fix from NetBSD port: enable vax FP support when defined(__vax__) as well as BSD43_VAX. from ragge. + add configure --disable-echo option + identify updated files with "MawkId" keywords, retaining old log comments for reference. Ongoing changes are recorded here. + change maintainer email address to my own. 20090711 + use conventional install/uninstall rules in makefile. + add install-sh script, mkdirs.sh, config.guess and config.sub + add $DESTDIR support to makefile + add uninstall make-target + add configure --enable-warnings option (fixed some warnings...) + change configure script to autoconf 2.52 to permit cross-compiles. + drop config.user file; replace with conventional autoconf --prefix, etc. + fill-in CA_REC.type in two places in parse.y which weren't initialized. + fix Debian #38353 (absent expression on last part of "for" statement caused core-dump). + fix Debian #303825 (printf %x clamps numbers to signed range rather than unsigned range). + apply fix from Debian #355966 (null-pointer check in is_string_split()) + apply fix from Debian #391051 (limit-check in scan.c) 20090709 + add support for external regexp libraries (patch by Aleksey Cheusov) (originally comp.lang.awk June 15 2005, also cited in Debian #355442 March 6, 2006). 20090705 + fixes to build on BeOS (if LIBS is set to -lroot), and QNX (redefinition of setmode). 20080909 + fix gcc 4.3.1 -Wall warnings + transform mawk.ac.m4 to aclocal.m4, renaming macros to use "CF_" or "CF_MAWK_" prefixes depending on their reusability. Modified macros to use quoting consistent with recent autoconf versions. + regenerate configure with autoconf version 2.13.20030927 + regenerate parse.c with byacc - 1.9 20080827 + ifdef'd prototypes in nstd.h which belong to stdlib.h, string.h to use standard C by default. + source-in Debian patches 01-08 (see below). Changes for 20080909 fix Debian #496980 as well. ------------------------------------------------------------------------------- Debian patches: (Peter Eisentraut Sat, 05 Apr 2008 17:11:11 +0200) 08_fix-for-gcc3.3 Debian #195371 (James Troup Fri, 30 May 2003 15:24:50 +0100) 07_mawktest-check-devfull Debian #51875 06_parse.y-semicolons Debian #170973 05_-Wall-fixes 04_mawk.1-fix-pi Debian #103699 03_read-and-close-redefinition Debian #104124 02_fix-examples Debian #36011 01_error-on-full-fs Debian #28249 Debian #4293 ------------------------------------------------------------------------------- 1.3.1 -> 1.3.2 Sep 1996 1) Numeric but not integer indices caused core dump in new array scheme. Fixed bug and fired test division. 2) Added ferror() checks on writes. 3) Added some static storage specs to array.c to keep non-ansi compilers happy. 1.3 -> 1.3.1 Sep 1996 Release to new ftp site ftp://ftp.whidbey.net. 1) Workaround for overflow exception in strtod, sunos5.5 solaris. 2) []...] and [^]...] put ] in a class (or not in a class) without having to use back-slash escape. 1.2.2 -> 1.3 Jul 1996 Extensive redesign of array data structures to support large arrays and fast access to arrays created with split. Many of the ideas in the new design were inspired by reading "The Design and Implementation of Dynamic Hashing Sets and Tables in Icon" by William Griswold and Gregg Townsend, SPE 23,351-367. 1.2.1 -> 1.2.2 Jan 1996 1) Improved autoconfig, in particular, fpe tests. This is far from perfect and never will be until C standardizes an interface to ieee754. 2) Removed automatic error message on open failure for getline. 3) Flush all output before system(). Previous behavior was to only flush std{out,err}. 4) Explicitly fclose() all output on exit to work around AIX4.1 bug. 5) Fixed random number generator to work with longs larger than 32bits. 6) Added a type Int which is int on real machines and long on dos machines. Believe that all implicit assumptions that int=32bits are now gone. ------------------------------------------------------------------------------- Changes from version 1.1.4 to 1.2: 1) Limit on code size set by #define in sizes.h is gone. 2) A number of obscure bugs have been fixed such as, you can now make a recursive function call inside a for( i in A) loop. Function calls with array parameters in loop expressions sometimes generated erroneous internal code. See RCS log comments in code for details. Reported bugs are fixed. 3) new -W options -We file : reads commands from file and next argument, regardless of form, is ARGV[1]. Useful for passing -v , -f etc to an awk program started with #!/.../mawk #!/usr/local/bin/mawk -We myprogram -v works, while #!/usr/local/bin/mawk -f myprogram -v gives error message mawk: option -v lacks argument This is really a posix bozo. Posix says you end arguments with "--" , but this doesn't work with the "#!" convention. -W interactive : forces stdout to be unbuffered and stdin to be line buffered. Records from stdin are lines regardless of the value of RS. Useful for interaction with a mawk on a pipe. -W dump, -Wd : disassembles internal code to stdout (used to be stderr) and exits 0. 4) FS = "" causes each record to be broken into characters and placed into $1,$2 ... same with split(x,A,"") and split(x,A,//) 5) print > "/dev/stdout" writes to stdout, exactly the same as print This is useful for passing stdout to function my_special_output_routine(s, file) { # do something fancy with s print s > file } 6) New built-in function fflush() -- copied from the lastest att awk. fflush() : flushes stdout and returns 0 fflush(file) flushes file and returns 0; if file was not an open output file then returns -1. 7) delete A ; -- removes all elements of the array A intended to replace: for( i in A) delete A[i] 8) mawk errors such as compilation failure, file open failure, etc. now exit 2 which reserves exit 1 for the user. 9) No program now silently exits 0, prior behavior was to exit 2 with an error message mawk-1.3.4-20200120/rexp4.c0000644000175100001440000000116312375512105013271 0ustar tomusers/* regexp_system.c copyright 2009-2010,2014 Thomas E. Dickey copyright 2005, Aleksey Cheusov This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. */ /* * $MawkId: rexp4.c,v 1.8 2014/08/22 00:52:21 tom Exp $ */ #include "mawk.h" #include "rexp.h" #include "field.h" char * is_string_split(PTR q, SLen * lenp) { STATE *p = (STATE *) q; if (p != 0 && (p[0].s_type == M_STR && p[1].s_type == M_ACCEPT)) { *lenp = p->s_len; return p->s_data.str; } else return (char *) 0; } mawk-1.3.4-20200120/da.c0000644000175100001440000002624513425170556012632 0ustar tomusers/******************************************** da.c copyright 2008-2017,2019, Thomas E. Dickey copyright 1991-1994,1995, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: da.c,v 1.24 2019/02/02 01:25:02 tom Exp $ */ /* da.c */ /* disassemble code */ #include "mawk.h" #include "code.h" #include "bi_funct.h" #include "repl.h" #include "field.h" typedef struct fdump { struct fdump *link; FBLOCK *data; } DUMP_FUNCS; static DUMP_FUNCS *fdump_list; /* linked list of all user functions */ #ifdef LOCAL_REGEXP #include "regexp.h" typedef struct regex { struct regex *link; PTR data; } DUMP_REGEX; static DUMP_REGEX *regex_list; /* list regular expressions dumped */ static void add_to_regex_list(PTR); #else #define add_to_regex_list(p) /* nothing */ #endif /* LOCAL_REGEXP */ typedef struct { char op; const char *name; } OP_NAME; static const char *find_bi_name(PF_CP); /* *INDENT-OFF* */ static const OP_NAME simple_code[] = { {_STOP, "stop"}, {FE_PUSHA, "fe_pusha"}, {FE_PUSHI, "fe_pushi"}, {A_LENGTH, "a_length"}, {A_TEST, "a_test"}, {A_DEL, "a_del"}, {DEL_A, "del_a"}, {POP_AL, "pop_al"}, {_POP, "pop"}, {_ADD, "add"}, {_SUB, "sub"}, {_MUL, "mul"}, {_DIV, "div"}, {_MOD, "mod"}, {_POW, "pow"}, {_NOT, "not"}, {_UMINUS, "uminus"}, {_UPLUS, "uplus"}, {_TEST, "test"}, {_CAT, "cat"}, {_ASSIGN, "assign"}, {_ADD_ASG, "add_asg"}, {_SUB_ASG, "sub_asg"}, {_MUL_ASG, "mul_asg"}, {_DIV_ASG, "div_asg"}, {_MOD_ASG, "mod_asg"}, {_POW_ASG, "pow_asg"}, {NF_PUSHI, "nf_pushi"}, {F_ASSIGN, "f_assign"}, {F_ADD_ASG, "f_add_asg"}, {F_SUB_ASG, "f_sub_asg"}, {F_MUL_ASG, "f_mul_asg"}, {F_DIV_ASG, "f_div_asg"}, {F_MOD_ASG, "f_mod_asg"}, {F_POW_ASG, "f_pow_asg"}, {_POST_INC, "post_inc"}, {_POST_DEC, "post_dec"}, {_PRE_INC, "pre_inc"}, {_PRE_DEC, "pre_dec"}, {F_POST_INC, "f_post_inc"}, {F_POST_DEC, "f_post_dec"}, {F_PRE_INC, "f_pre_inc"}, {F_PRE_DEC, "f_pre_dec"}, {_EQ, "eq"}, {_NEQ, "neq"}, {_LT, "lt"}, {_LTE, "lte"}, {_GT, "gt"}, {_GTE, "gte"}, {_MATCH2, "match2"}, {_EXIT, "exit"}, {_EXIT0, "exit0"}, {_NEXT, "next"}, {_NEXTFILE, "nextfile"}, {_RET, "ret"}, {_RET0, "ret0"}, {_OMAIN, "omain"}, {_JMAIN, "jmain"}, {OL_GL, "ol_gl"}, {OL_GL_NR, "ol_gl_nr"}, {_HALT, (char *) 0} } ; /* *INDENT-ON* */ static const char *jfmt = "%s%s%03d\n"; /* format to print jumps */ static const char *tab2 = "\t\t"; void da_string(FILE *fp, const char *str, size_t len) { size_t n; fputc('"', fp); for (n = 0; n < len; ++n) { UChar ch = (UChar) str[n]; switch (ch) { case '\\': fprintf(fp, "\\\\"); break; case '"': fprintf(fp, "\""); break; default: if (ch >= 32 && ch < 127) fprintf(fp, "%c", ch); else fprintf(fp, "\\%03o", ch); break; } } fputc('"', fp); } INST * da_this(INST * p, INST * start, FILE *fp) { CELL *cp; const char *name; /* print the relative code address (label) */ fprintf(fp, "%03ld ", (long) (p - start)); fprintf(fp, ".\t"); switch ((MAWK_OPCODES) (p++->op)) { case _PUSHC: cp = (CELL *) p++->ptr; switch (cp->type) { case C_RE: add_to_regex_list(cp->ptr); fprintf(fp, "pushc\t%p\t/%s/\n", cp->ptr, re_uncompile(cp->ptr)); break; case C_SPACE: fprintf(fp, "pushc\tspace split\n"); break; case C_SNULL: fprintf(fp, "pushc\tnull split\n"); break; case C_REPL: fprintf(fp, "pushc\trepl\t%s\n", repl_uncompile(cp)); break; case C_REPLV: fprintf(fp, "pushc\treplv\t%s\n", repl_uncompile(cp)); break; default: fprintf(fp, "pushc\tWEIRD\n");; break; } break; case _PUSHD: fprintf(fp, "pushd\t%.6g\n", *(double *) p++->ptr); break; case _PUSHS: { STRING *sval = (STRING *) p++->ptr; fprintf(fp, "pushs\t"); da_string(fp, sval->str, sval->len); fprintf(fp, "\n"); break; } case _MATCH0: case _MATCH1: add_to_regex_list(p->ptr); fprintf(fp, "match%d\t%p\t/%s/\n", p[-1].op == _MATCH1, p->ptr, re_uncompile(p->ptr)); p++; break; case _PUSHA: fprintf(fp, "pusha\t%s\n", reverse_find(ST_VAR, &p++->ptr)); break; case _PUSHI: cp = (CELL *) p++->ptr; if (cp == field) fprintf(fp, "pushi\t$0\n"); else if (cp == &fs_shadow) fprintf(fp, "pushi\t@fs_shadow\n"); else { if (cp > NF && cp <= LAST_PFIELD) name = reverse_find(ST_FIELD, &cp); else name = reverse_find(ST_VAR, &cp); fprintf(fp, "pushi\t%s\n", name); } break; case L_PUSHA: fprintf(fp, "l_pusha\t%d\n", p++->op); break; case L_PUSHI: fprintf(fp, "l_pushi %d\t# frame-number\n", p++->op); break; case LAE_PUSHI: fprintf(fp, "lae_pushi\t%d\n", p++->op); break; case LAE_PUSHA: fprintf(fp, "lae_pusha\t%d\n", p++->op); break; case LA_PUSHA: fprintf(fp, "la_pusha\t%d\n", p++->op); break; case F_PUSHA: cp = (CELL *) p++->ptr; if (cp >= NF && cp <= LAST_PFIELD) fprintf(fp, "f_pusha\t%s\n", reverse_find(ST_FIELD, &cp)); else fprintf(fp, "f_pusha\t$%d\n", field_addr_to_index(cp)); break; case F_PUSHI: p++; fprintf(fp, "f_pushi\t$%d\n", p++->op); break; case AE_PUSHA: fprintf(fp, "ae_pusha\t%s\n", reverse_find(ST_ARRAY, &p++->ptr)); break; case AE_PUSHI: fprintf(fp, "ae_pushi\t%s\n", reverse_find(ST_ARRAY, &p++->ptr)); break; case A_PUSHA: fprintf(fp, "a_pusha\t%s\n", reverse_find(ST_ARRAY, &p++->ptr)); break; case _PUSHINT: fprintf(fp, "pushint\t%d\n", p++->op); break; case _BUILTIN: fprintf(fp, "%s\n", find_bi_name((PF_CP) p++->ptr)); break; case _PRINT: fprintf(fp, "%s\n", (PF_CP) p++->ptr == bi_printf ? "printf" : "print"); break; case _JMP: fprintf(fp, jfmt, "jmp", tab2, (p - start) + p->op); p++; break; case _JNZ: fprintf(fp, jfmt, "jnz", tab2, (p - start) + p->op); p++; break; case _JZ: fprintf(fp, jfmt, "jz", tab2, (p - start) + p->op); p++; break; case _LJZ: fprintf(fp, jfmt, "ljz", tab2, (p - start) + p->op); p++; break; case _LJNZ: fprintf(fp, jfmt, "ljnz", tab2 + 1, (p - start) + p->op); p++; break; case SET_ALOOP: fprintf(fp, "set_al\t%03ld\n", (long) (p + p->op - start)); p++; break; case ALOOP: fprintf(fp, "aloop\t%03ld\n", (long) (p - start + p->op)); p++; break; case A_CAT: fprintf(fp, "a_cat\t%d\n", p++->op); break; case _CALL: fprintf(fp, "call\t%s\t%d\n", ((FBLOCK *) p->ptr)->name, p[1].op); p += 2; break; case _RANGE: fprintf(fp, "range\t%03ld %03ld %03ld\n", /* label for pat2, action, follow */ (long) (p - start + p[1].op), (long) (p - start + p[2].op), (long) (p - start + p[3].op)); p += 4; break; default: { const OP_NAME *q = simple_code; int k = (p - 1)->op; while (q->op != _HALT && q->op != k) q++; fprintf(fp, "%s\n", q->op != _HALT ? q->name : "bad instruction"); } break; } return p; } void da(INST * p, FILE *fp) { INST *base = p; while (p->op != _HALT) { p = da_this(p, base, fp); } fflush(fp); } /* *INDENT-OFF* */ static struct { PF_CP action ; const char *name ; } special_cases[] = { {bi_split, "split"}, {bi_match, "match"}, {bi_getline, "getline"}, {bi_sub, "sub"}, {bi_gsub, "gsub"}, {(PF_CP) 0, (char *) 0} } ; /* *INDENT-ON* */ static const char * find_bi_name(PF_CP p) { const BI_REC *q; int i; for (q = bi_funct; q->name; q++) { if (q->fp == p) { /* found */ return q->name; } } /* next check some special cases */ for (i = 0; special_cases[i].action; i++) { if (special_cases[i].action == p) { return special_cases[i].name; } } return "unknown builtin"; } void add_to_fdump_list(FBLOCK * fbp) { DUMP_FUNCS *p = ZMALLOC(DUMP_FUNCS); p->data = fbp; p->link = fdump_list; fdump_list = p; } void dump_funcs(void) { register DUMP_FUNCS *p, *q = fdump_list; while (q) { p = q; q = p->link; fprintf(stdout, "function %s\n", p->data->name); da(p->data->code, stdout); ZFREE(p); } } #ifdef LOCAL_REGEXP static void add_to_regex_list(PTR re) { DUMP_REGEX *p = ZMALLOC(DUMP_REGEX); p->data = re; p->link = regex_list; regex_list = p; } void dump_regex(void) { register DUMP_REGEX *p, *q = regex_list; while (q) { p = q; q = p->link; fprintf(stdout, "# regex %p\n", p->data); REmprint(cast_to_re(p->data), stdout); ZFREE(p); } } #else /* using system regex */ void dump_regex(void) { } #endif /* LOCAL_REGEXP */ #if OPT_TRACE > 0 /* *INDENT-OFF* */ static const OP_NAME type_names[] = { {C_NOINIT, "noinit"}, {C_DOUBLE, "double"}, {C_STRING, "string"}, {C_STRNUM, "strnum"}, {C_MBSTRN, "mbstrn"}, {C_RE, "re"}, {C_SPACE, "space"}, {C_SNULL, "snull"}, {C_REPL, "repl"}, {C_REPLV, "replv"} }; /* *INDENT-ON* */ const char * da_type_name(CELL *cdp) { int n; const char *result = "?"; for (n = 0; n < (int) (sizeof(type_names) / sizeof(type_names[0])); ++n) { if (cdp->type == (int) type_names[n].op) { result = type_names[n].name; break; } } return result; } /* *INDENT-OFF* */ static const OP_NAME other_codes[] = { { AE_PUSHA, "ae_pusha" }, { AE_PUSHI, "ae_pushi" }, { ALOOP, "aloop" }, { A_CAT, "a_cat" }, { A_PUSHA, "a_pusha" }, { F_PUSHA, "f_pusha" }, { F_PUSHI, "f_pushi" }, { LAE_PUSHA, "lae_pusha" }, { LAE_PUSHI, "lae_pushi" }, { LA_PUSHA, "la_pusha" }, { L_PUSHA, "l_pusha" }, { L_PUSHI, "l_pushi" }, { SET_ALOOP, "set_al" }, { _CALL, "call" }, { _JMP, "jmp" }, { _JNZ, "jnz" }, { _JZ, "jz" }, { _LJNZ, "ljnz" }, { _LJZ, "ljz" }, { _MATCH0, "match0" }, { _MATCH1, "match1" }, { _PUSHA, "pusha" }, { _PUSHC, "pushc" }, { _PUSHD, "pushd" }, { _PUSHI, "pushi" }, { _PUSHINT, "pushint" }, { _PUSHS, "pushs" }, { _RANGE, "range" }, { _HALT, 0 }, }; /* *INDENT-ON* */ const char * da_op_name(INST * cdp) { int n; const char *result = 0; if (cdp->op == _BUILTIN) { result = find_bi_name((PF_CP) cdp[1].ptr); } else if (cdp->op == _PRINT) { result = ((PF_CP) cdp->ptr == bi_printf ? "printf" : "print"); } else if (cdp->op == _HALT) { result = "halt"; } else { for (n = 0; simple_code[n].op != _HALT; ++n) { if (simple_code[n].op == cdp->op) { result = simple_code[n].name; break; } } if (result == 0) { for (n = 0; other_codes[n].op != _HALT; ++n) { if (other_codes[n].op == cdp->op) { result = other_codes[n].name; break; } } } if (result == 0) { result = "unknown"; } } return result; } #endif mawk-1.3.4-20200120/vs6.mak0000644000175100001440000001264512042736676013316 0ustar tomusers# $MawkId: vs6.mak,v 1.3 2012/10/27 10:55:58 tom Exp $ # Microsoft C makefile for mawk, # # Tested with Microsoft Visual Studio 6 using nmake. ############################################################################### # copyright 2010,2012 Thomas E. Dickey # # This is a source file for mawk, an implementation of # the AWK programming language. # # Mawk is distributed without warranty under the terms of # the GNU General Public License, version 2, 1991. ############################################################################### !include #======================================================================== CFLAGS = -I. -DLOCAL_REGEXP $(cflags) .c.obj: $(CC) $(CFLAGS) -c $< OBJ1 = parse.obj array.obj bi_funct.obj bi_vars.obj cast.obj code.obj \ da.obj error.obj execute.obj fcall.obj OBJ2 = field.obj files.obj fin.obj hash.obj jmp.obj init.obj \ kw.obj main.obj matherr.obj OBJ3 = memory.obj print.obj re_cmpl.obj scan.obj scancode.obj split.obj \ zmalloc.obj version.obj regexp.obj dosexec.obj MAWK_OBJ = $(OBJ1) $(OBJ2) $(OBJ3) mawk.exe : $(MAWK_OBJ) $(link) $(LDFLAGS) $(MAWK_OBJ) $(LIBS) -out:mawk.exe -map:mawk.map config.h : msdos/vs6.h copy msdos\vs6.h config.h dosexec.c : msdos/dosexec.c copy msdos\dosexec.c dosexec.c mawk_test : mawk.exe # test that we have a sane mawk @echo you may have to run the test manually cd test && mawktest.bat fpe_test : mawk.exe # test FPEs are handled OK @echo testing floating point exception handling @echo you may have to run the test manually cd test && fpe_test.bat check : mawk_test fpe_test ################################################### # FIXME # parse.c is provided # so you don't need to make it. # # But if you do: here's how: # To make it with byacc # YACC=byacc # parse.c : parse.y # $(YACC) -d parse.y # rename y_tab.h parse.h # rename y_tab.c parse.c ######################################## scancode.c : makescan.c scan.h $(CC) -o makescan.exe makescan.c makescan.exe > scancode.c del makescan.exe clean : -del *.bak -del *.exe -del *.ilk -del *.map -del *.pdb -del *.obj distclean : clean -del dosexec.c -del scancode.c -del config.h # dependencies of .objs on .h array.obj : array.h bi_vars.h config.h field.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h bi_funct.obj : array.h bi_funct.h bi_vars.h config.h field.h files.h fin.h init.h mawk.h memory.h nstd.h regexp.h repl.h sizes.h symtype.h types.h zmalloc.h bi_vars.obj : array.h bi_vars.h config.h field.h init.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h cast.obj : array.h config.h field.h mawk.h memory.h nstd.h parse.h repl.h scan.h scancode.h sizes.h symtype.h types.h zmalloc.h code.obj : array.h code.h config.h field.h init.h jmp.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h da.obj : array.h bi_funct.h code.h config.h field.h mawk.h memory.h nstd.h repl.h sizes.h symtype.h types.h zmalloc.h error.obj : array.h bi_vars.h config.h mawk.h nstd.h parse.h scan.h scancode.h sizes.h symtype.h types.h execute.obj : array.h bi_funct.h bi_vars.h code.h config.h field.h fin.h mawk.h memory.h nstd.h regexp.h repl.h sizes.h symtype.h types.h zmalloc.h fcall.obj : array.h code.h config.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h field.obj : array.h bi_vars.h config.h field.h init.h mawk.h memory.h nstd.h parse.h regexp.h repl.h scan.h scancode.h sizes.h symtype.h types.h zmalloc.h files.obj : array.h config.h files.h fin.h init.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h fin.obj : array.h bi_vars.h config.h field.h fin.h mawk.h memory.h nstd.h parse.h scan.h scancode.h sizes.h symtype.h types.h zmalloc.h hash.obj : array.h config.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h init.obj : array.h bi_vars.h code.h config.h field.h init.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h jmp.obj : array.h code.h config.h init.h jmp.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h kw.obj : array.h config.h init.h mawk.h nstd.h parse.h sizes.h symtype.h types.h main.obj : array.h code.h config.h files.h init.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h makescan.obj : config.h nstd.h scancode.h matherr.obj : array.h config.h init.h mawk.h nstd.h sizes.h symtype.h types.h memory.obj : config.h mawk.h memory.h nstd.h sizes.h types.h zmalloc.h parse.obj : array.h bi_funct.h bi_vars.h code.h config.h field.h files.h jmp.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h print.obj : array.h bi_funct.h bi_vars.h config.h field.h files.h mawk.h memory.h nstd.h parse.h scan.h scancode.h sizes.h symtype.h types.h zmalloc.h re_cmpl.obj : array.h config.h mawk.h memory.h nstd.h parse.h regexp.h repl.h scan.h scancode.h sizes.h symtype.h types.h zmalloc.h scan.obj : array.h code.h config.h field.h files.h fin.h init.h mawk.h memory.h nstd.h parse.h repl.h scan.h scancode.h sizes.h symtype.h types.h zmalloc.h split.obj : array.h bi_funct.h bi_vars.h config.h field.h mawk.h memory.h nstd.h parse.h regexp.h repl.h scan.h scancode.h sizes.h symtype.h types.h zmalloc.h version.obj : array.h config.h init.h mawk.h nstd.h patchlev.h sizes.h symtype.h types.h zmalloc.obj : config.h mawk.h nstd.h sizes.h types.h zmalloc.h regexp.obj : rexpdb.c rexp4.c rexp2.c regexp_system.c sizes.h mawk.h rexp0.c rexp1.c config.h rexp.h regexp.h nstd.h rexp3.c rexp.c field.h mawk-1.3.4-20200120/files.c0000644000175100001440000003233613424170664013345 0ustar tomusers/******************************************** files.c copyright 2008-2016,2019. Thomas E. Dickey copyright 1991-1994,1996. Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: files.c,v 1.33 2019/01/30 00:37:08 tom Exp $ */ /* files.c */ #include "mawk.h" #include "files.h" #include "memory.h" #include "fin.h" #include "init.h" #include #ifdef HAVE_SYS_WAIT_H #include #endif #ifdef V7 #include /* defines FIOCLEX */ #endif #ifdef HAVE_FCNTL_H #include #define CLOSE_ON_EXEC(fd) fcntl(fd, F_SETFD, 1) #else #define CLOSE_ON_EXEC(fd) ioctl(fd, FIOCLEX, (PTR) 0) #endif /* We store dynamically created files on a linked linear list with move to the front (big surprise) */ typedef struct file { struct file *link; STRING *name; short type; int pid; /* we need to wait() when we close a pipe */ /* holds temp file index under MSDOS */ #ifdef HAVE_FAKE_PIPES int inpipe_exit; #endif PTR ptr; /* FIN* or FILE* */ } FILE_NODE; static FILE_NODE *file_list; /* Prototypes for local functions */ static FILE *tfopen(const char *, const char *); static int efflush(FILE *); static void close_error(FILE_NODE * p); static FILE_NODE * alloc_filenode(void) { FILE_NODE *result; result = ZMALLOC(FILE_NODE); #ifdef NO_LEAKS result->name = 0; #endif result->ptr = 0; return result; } static void free_filenode(FILE_NODE * p) { #ifdef NO_LEAKS if (p->name != 0) { free_STRING(p->name); } #endif zfree(p, sizeof(FILE_NODE)); } static void output_failed(const char *name) { errmsg(errno, "cannot open \"%s\" for output", name); mawk_exit(2); /* NOTREACHED */ } #if USE_BINMODE #define BinMode2(t,f) ((binmode() & 2) ? (t) : (f)) #else #define BinMode2(t,f) (f) #endif /* * Find a file on file_list. Outputs return a FILE*, while inputs return FIN*. */ PTR file_find(STRING * sval, int type) { FILE_NODE *p = file_list; FILE_NODE *q = (FILE_NODE *) 0; char *name = sval->str; TRACE(("file_find(%s, %d)\n", name, type)); while (1) { if (!p) { /* open a new one */ p = alloc_filenode(); switch (p->type = (short) type) { case F_TRUNC: if (!(p->ptr = (PTR) tfopen(name, BinMode2("wb", "w")))) output_failed(name); break; case F_APPEND: if (!(p->ptr = (PTR) tfopen(name, BinMode2("ab", "a")))) output_failed(name); break; case F_IN: if (!(p->ptr = (PTR) FINopen(name, 0))) { free_filenode(p); return (PTR) 0; } break; case PIPE_OUT: case PIPE_IN: #if defined(HAVE_REAL_PIPES) || defined(HAVE_FAKE_PIPES) if (!(p->ptr = get_pipe(name, type, &p->pid))) { if (type == PIPE_OUT) output_failed(name); else { free_filenode(p); return (PTR) 0; } } #else rt_error("pipes not supported"); #endif break; #ifdef DEBUG default: bozo("bad file type"); #endif } /* successful open */ p->name = sval; sval->ref_cnt++; break; /* while loop */ } /* search is by name and type */ if (strcmp(name, p->name->str) == 0 && (p->ptr != 0) && (p->type == type || /* no distinction between F_APPEND and F_TRUNC here */ (p->type >= F_APPEND && type >= F_APPEND))) { /* found */ if (!q) /*at front of list */ return p->ptr; /* delete from list for move to front */ q->link = p->link; break; /* while loop */ } q = p; p = p->link; } /* end while loop */ /* put p at the front of the list */ p->link = file_list; return (PTR) (file_list = p)->ptr; } /* Close a file and delete its node from the file_list. Walk the whole list, in case a name has two nodes, e.g. < "/dev/tty" and > "/dev/tty" */ int file_close(STRING * sval) { FILE_NODE *p; FILE_NODE *q = 0; /* trails p */ FILE_NODE *hold; char *name = sval->str; int retval = -1; TRACE(("file_close(%s)\n", name)); p = file_list; while (p) { if (strcmp(name, p->name->str) == 0) { /* found */ /* Remove it from the list first because we might be called again if an error occurs leading to an infinite loop. Note that we don't have to consider the list corruption caused by a recursive call because it will never return. */ if (q == 0) file_list = p->link; else q->link = p->link; switch (p->type) { case F_TRUNC: case F_APPEND: if (fclose((FILE *) p->ptr) != 0) { close_error(p); } retval = 0; break; case PIPE_OUT: if (fclose((FILE *) p->ptr) != 0) { close_error(p); } #ifdef HAVE_REAL_PIPES retval = wait_for(p->pid); #endif #ifdef HAVE_FAKE_PIPES retval = close_fake_outpipe(p->name->str, p->pid); #endif break; case F_IN: FINclose((FIN *) p->ptr); retval = 0; break; case PIPE_IN: FINclose((FIN *) p->ptr); #ifdef HAVE_REAL_PIPES retval = wait_for(p->pid); #endif #ifdef HAVE_FAKE_PIPES { char xbuff[100]; unlink(tmp_file_name(p->pid, xbuff)); retval = p->inpipe_exit; } #endif break; } hold = p; p = p->link; free_filenode(hold); } else { q = p; p = p->link; } } return retval; } /* find an output file with name == sval and fflush it */ int file_flush(STRING * sval) { int ret = 0; FILE_NODE *p = file_list; size_t len = sval->len; char *str = sval->str; if (len == 0) { /* for consistency with gawk */ ret = flush_all_output(); } else { int found = 0; while (p) { if (IS_OUTPUT(p->type) && len == p->name->len && strcmp(str, p->name->str) == 0) { found = 1; if (efflush((FILE *) p->ptr) != 0) ret = -1; /* it's possible for a command and a file to have the same name -- so keep looking */ } p = p->link; } if (!found) ret = -1; } return ret; } int flush_all_output(void) { int ret = 0; FILE_NODE *p; for (p = file_list; p; p = p->link) { if (IS_OUTPUT(p->type)) { if (efflush((FILE *) p->ptr) != 0) ret = -1; } } return ret; } static int efflush(FILE *fp) { int ret; if ((ret = fflush(fp)) < 0) { errmsg(errno, "unexpected write error"); } return ret; } /* When we exit, we need to close and wait for all output pipes */ #ifdef HAVE_REAL_PIPES /* work around for bug in AIX 4.1 -- If there are exactly 16 or 32 or 48 ..., open files then the last one doesn't get flushed on exit. So the following is now a misnomer as we'll really close all output. */ void close_out_pipes(void) { FILE_NODE *p = file_list; FILE_NODE *q = 0; while (p) { if (IS_OUTPUT(p->type)) { if (fclose((FILE *) p->ptr) != 0) { /* if another error occurs we do not want to be called for the same file again */ if (q != 0) q->link = p->link; else file_list = p->link; close_error(p); } else if (p->type == PIPE_OUT) { wait_for(p->pid); } } q = p; p = p->link; } } #else #ifdef HAVE_FAKE_PIPES /* pipes are faked with temp files */ void close_fake_pipes(void) { FILE_NODE *p = file_list; char xbuff[100]; /* close input pipes first to free descriptors for children */ while (p) { if (p->type == PIPE_IN) { FINclose((FIN *) p->ptr); unlink(tmp_file_name(p->pid, xbuff)); } p = p->link; } /* doit again */ p = file_list; while (p) { if (p->type == PIPE_OUT) { if (fclose(p->ptr) != 0) { close_error(p); } close_fake_outpipe(p->name->str, p->pid); } p = p->link; } } #endif /* HAVE_FAKE_PIPES */ #endif /* ! HAVE_REAL_PIPES */ /* hardwire to /bin/sh for portability of programs */ const char *shell = "/bin/sh"; #ifdef HAVE_REAL_PIPES PTR get_pipe(char *name, int type, int *pid_ptr) { int the_pipe[2], local_fd, remote_fd; if (pipe(the_pipe) == -1) return (PTR) 0; /* * If this is an input-pipe then local_fd is reader, remote_fd is writer * If this is an output-pipe then local_fd is writer, remote_fd is reader */ local_fd = the_pipe[type == PIPE_OUT]; remote_fd = the_pipe[type == PIPE_IN]; /* to keep output ordered correctly */ fflush(stdout); fflush(stderr); switch (*pid_ptr = fork()) { case -1: close(local_fd); close(remote_fd); return (PTR) 0; case 0: /* * This is the child process. Close the unused end of the pipe, i.e, * (local_fd) and then close the input/output file descriptor that * corresponds to the direction we want to read/write. * * The dup() call uses the first unused file descriptor, which happens * to be the one that we just closed, e.g., 0 or 1 for stdin and stdout * respectively. */ close(local_fd); close(type == PIPE_IN); IGNORE_RC(dup(remote_fd)); close(remote_fd); execl(shell, shell, "-c", name, (char *) 0); errmsg(errno, "failed to exec %s -c %s", shell, name); fflush(stderr); _exit(128); default: close(remote_fd); /* we could deadlock if future child inherit the local fd , set close on exec flag */ (void) CLOSE_ON_EXEC(local_fd); break; } return ((type == PIPE_IN) ? (PTR) FINdopen(local_fd, 0) : (PTR) fdopen(local_fd, "w")); } /*------------ children ------------------*/ /* we need to wait for children at the end of output pipes to complete so we know any files they have created are complete */ /* dead children are kept on this list */ static struct child { int pid; int exit_status; struct child *link; } *child_list; static void add_to_child_list(int pid, int exit_status) { struct child *p = ZMALLOC(struct child); p->pid = pid; p->exit_status = exit_status; p->link = child_list; child_list = p; } static struct child * remove_from_child_list(int pid) { struct child dummy; struct child *p; struct child *q = &dummy; dummy.link = p = child_list; while (p) { if (p->pid == pid) { q->link = p->link; break; } else { q = p; p = p->link; } } child_list = dummy.link; return p; /* null return if not in the list */ } /* wait for a specific child to complete and return its exit status If pid is zero, wait for any single child and put it on the dead children list */ int wait_for(int pid) { int exit_status = 0; struct child *p; int id; TRACE(("wait_for %d\n", pid)); if (pid == 0) { id = wait(&exit_status); add_to_child_list(id, exit_status); } /* see if an earlier wait() caught our child */ else if ((p = remove_from_child_list(pid))) { exit_status = p->exit_status; ZFREE(p); } else { /* need to really wait */ while ((id = wait(&exit_status)) != pid) { if (id == -1) /* can't happen */ bozo("wait_for"); else { /* we got the exit status of another child put it on the child list and try again */ add_to_child_list(id, exit_status); } } } return wait_status(exit_status); } /* * POSIX system() call returns a value from wait(), which should be tested * using the POSIX macros. */ int wait_status(int status) { if (status != -1) { if (WIFEXITED(status)) { status = WEXITSTATUS(status); } else if (WIFSIGNALED(status)) { status = 256 + WTERMSIG(status); } } return status; } #endif /* HAVE_REAL_PIPES */ /* * Create names by which the standard streams can be referenced in a script. */ void set_stdio(void) { FILE_NODE *p, *q, *r; /* We insert stderr first to get it at the end of the list. This is needed because we want to output errors encountered on closing stdout. */ q = alloc_filenode(); q->link = (FILE_NODE *) 0; q->type = F_TRUNC; q->name = new_STRING("/dev/stderr"); q->ptr = (PTR) stderr; p = alloc_filenode(); p->link = q; p->type = F_TRUNC; p->name = new_STRING("/dev/stdout"); p->ptr = (PTR) stdout; r = alloc_filenode(); r->link = p; r->type = F_IN; r->name = new_STRING("/dev/stdin"); /* Note: ptr is set in file_find() */ file_list = r; } /* fopen() but no buffering to ttys */ static FILE * tfopen(const char *name, const char *mode) { FILE *retval = fopen(name, mode); if (retval) { if (isatty(fileno(retval))) setbuf(retval, (char *) 0); else { #ifdef MSDOS enlarge_output_buffer(retval); #endif } } return retval; } #ifdef MSDOS void enlarge_output_buffer(FILE *fp) { if (setvbuf(fp, (char *) 0, _IOFBF, BUFFSZ) < 0) { errmsg(errno, "setvbuf failed on fileno %d", fileno(fp)); mawk_exit(2); } } #endif #if USE_BINMODE void stdout_init(void) { #ifdef MSDOS if (!isatty(1)) enlarge_output_buffer(stdout); #endif if (binmode() & 2) { setmode(1, O_BINARY); setmode(2, O_BINARY); } } #endif /* USE_BINMODE */ /* An error occurred closing the file referred to by P. We tell the user and terminate the program. */ static void close_error(FILE_NODE * p) { TRACE(("close_error(%s)\n", p->name->str)); errmsg(errno, "close failed on file %s", p->name->str); #ifdef NO_LEAKS free_filenode(p); #endif mawk_exit(2); } #ifdef NO_LEAKS void files_leaks(void) { TRACE(("files_leaks\n")); while (file_list != 0) { FILE_NODE *p = file_list; file_list = p->link; free_filenode(p); } } #endif mawk-1.3.4-20200120/rexp0.c0000644000175100001440000004250213611311445013265 0ustar tomusers/******************************************** rexp0.c copyright 2008-2016,2020, Thomas E. Dickey copyright 2010, Jonathan Nieder copyright 1991-1994,1996, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: rexp0.c,v 1.34 2020/01/20 11:46:45 tom Exp $ */ /* lexical scanner */ #undef LOCAL_REGEXP /* no need for push/pop */ #include "rexp.h" #include typedef struct { int first; int last; } CCLASS; /* static functions */ static int do_str(int, char **, MACHINE *); static int do_class(char **, MACHINE *); static int escape(char **); static BV *store_bvp(BV *); /* make next array visible */ /* *INDENT-OFF* */ static const char char2token[] = { T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*07*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*0f*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*17*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*1f*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_END, T_CHAR, T_CHAR, T_CHAR, /*27*/ T_LP, T_RP, T_STAR, T_PLUS, T_CHAR, T_CHAR, T_ANY, T_CHAR, /*2f*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*37*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_Q, /*3f*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*47*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*4f*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*57*/ T_CHAR, T_CHAR, T_CHAR, T_CLASS,T_SLASH,T_CHAR, T_START,T_CHAR, /*5f*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*67*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*6f*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*77*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_OR, T_CHAR, T_CHAR, T_CHAR, /*7f*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*87*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*8f*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*97*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*9f*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*a7*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*af*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*b7*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*bf*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*c7*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*cf*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*d7*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*df*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*e7*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*ef*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, /*f7*/ T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR, T_CHAR /*ff*/ }; /* *INDENT-ON* */ #define NOT_STARTED (-1) static int prev; static size_t nest; static char *lp; /* ptr to reg exp string */ static char *re_str; /* base of 'lp' */ static size_t re_len; void RE_lex_init(char *re, size_t len) { re_str = lp = re; re_len = len + 1; prev = NOT_STARTED; nest = 0; RE_run_stack_init(); RE_pos_stack_init(); } /* * Get the next token from re_str. * * For nullary operations (T_STR, T_ANY, T_U, T_CLASS, T_START, T_END), * before returning the appropriate token, this will write the * corresponding machine to *mp. * * For the rest (T_PLUS, T_STAR, T_OR, T_Q, T_RP, T_LP, and T_CAT), *mp * is left alone. * * Returns 0 for end of regexp. */ int RE_lex(MACHINE * mp) { /* * lp records the current position while parsing. * nest records the parenthesis nesting level. * prev records the last token returned. */ register int c; if ((unsigned) (1 + lp - re_str) >= re_len) { return 0; } switch (c = char2token[(UChar) (*lp)]) { case T_PLUS: case T_STAR: if (prev == T_START) RE_error_trap(6); /* fall thru */ case T_OR: case T_Q: lp++; return prev = c; case T_RP: if (!nest) { /* ) without matching ( is ordinary */ c = T_CHAR; break; } nest--; lp++; return prev = c; case 0: return 0; case T_LP: switch (prev) { case T_CHAR: case T_STR: case T_ANY: case T_CLASS: case T_START: case T_RP: case T_PLUS: case T_STAR: case T_Q: case T_U: return prev = T_CAT; default: nest++; lp++; return prev = T_LP; } } /* *lp is an operand, but implicit cat op is possible */ switch (prev) { case NOT_STARTED: case T_OR: case T_LP: case T_CAT: switch (c) { case T_ANY: { static int plus_is_star_flag = 0; if (*++lp == '*') { lp++; *mp = RE_u(); return prev = T_U; } else if (*lp == '+') { if (plus_is_star_flag) { lp++; *mp = RE_u(); plus_is_star_flag = 0; return prev = T_U; } else { plus_is_star_flag = 1; lp--; *mp = RE_any(); return prev = T_ANY; } } else { *mp = RE_any(); prev = T_ANY; } } break; case T_SLASH: lp++; c = escape(&lp); prev = do_str(c, &lp, mp); break; case T_CHAR: c = *lp++; prev = do_str(c, &lp, mp); break; case T_CLASS: prev = do_class(&lp, mp); break; case T_START: *mp = RE_start(); lp++; prev = T_START; break; case T_END: lp++; *mp = RE_end(); return prev = T_END; default: RE_panic("bad switch in RE_lex"); } break; default: /* don't advance the pointer */ return prev = T_CAT; } /* check for end character */ if (*lp == '$') { mp->start->s_type = (SType) (mp->start->s_type + END_ON); lp++; } return prev; } /* Collect a run of characters into a string machine. If the run ends at *,+, or ?, then don't take the last character unless the string has length one. */ static int do_str( int c, /* the first character */ char **pp, /* where to put the re_char pointer on exit */ MACHINE * mp) /* where to put the string machine */ { register char *p; /* runs thru the input */ char *pt = 0; /* trails p by one */ char *str; /* collect it here */ register char *s; /* runs thru the output */ size_t len; /* length collected */ p = *pp; s = str = RE_malloc(re_len); *s++ = (char) c; len = 1; while ((1 + p - re_str) < (int) re_len) { char *save; switch (char2token[(UChar) (*p)]) { case T_CHAR: pt = p; *s++ = *p++; break; case T_SLASH: pt = p; save = p + 1; /* keep p in a register */ *s++ = (char) escape(&save); p = save; break; default: goto out; } len++; } out: /* if len > 1 and we stopped on a ? + or * , need to back up */ if (len > 1 && (*p == '*' || *p == '+' || *p == '?')) { len--; p = pt; s--; } *s = 0; *pp = p; *mp = RE_str((char *) RE_realloc(str, len + 1), len); return T_STR; } /*-------------------------------------------- BUILD A CHARACTER CLASS *---------------------------*/ #define char_on(b,x) ((b)[(x)>>3] |= (UChar) ( 1 << ((x)&7) )) static void block_on(BV b, int x, int y) /* caller makes sure x<=y and x>0 y>0 */ { int lo = x >> 3; int hi = y >> 3; int r_lo = x & 7; int r_hi = y & 7; if (lo == hi) { b[lo] |= (UChar) ((1 << (r_hi + 1)) - (1 << r_lo)); } else { int i; for (i = lo + 1; i < hi; i++) b[i] = 0xff; b[lo] |= (UChar) (0xff << r_lo); b[hi] |= (UChar) (~(0xff << (r_hi + 1))); } } #define CCLASS_DATA(name) { CCLASS_##name, #name, sizeof(#name) - 1 } typedef enum { CCLASS_NONE = 0, CCLASS_alnum, CCLASS_alpha, CCLASS_blank, CCLASS_cntrl, CCLASS_digit, CCLASS_graph, CCLASS_lower, CCLASS_print, CCLASS_punct, CCLASS_space, CCLASS_upper, CCLASS_xdigit } CCLASS_ENUM; #ifndef isblank #define isblank(c) ((c) == ' ' || (c) == '\t') #endif static CCLASS * lookup_cclass(char **start) { static CCLASS *cclass_data[CCLASS_xdigit]; static const struct { CCLASS_ENUM code; const char *name; unsigned size; } cclass_table[] = { CCLASS_DATA(alnum), CCLASS_DATA(alpha), CCLASS_DATA(blank), CCLASS_DATA(cntrl), CCLASS_DATA(digit), CCLASS_DATA(graph), CCLASS_DATA(lower), CCLASS_DATA(print), CCLASS_DATA(punct), CCLASS_DATA(space), CCLASS_DATA(upper), CCLASS_DATA(xdigit), }; CCLASS *result = 0; CCLASS_ENUM code = CCLASS_NONE; const char *name; char *colon; size_t size; size_t item; #ifdef NO_LEAKS if (start == 0) { for (item = 0; item < (sizeof(cclass_data) / sizeof(cclass_data[0])); ++item) { if (cclass_data[item]) { free(cclass_data[item]); cclass_data[item] = 0; } } return 0; } #endif name = (*start += 2); /* point past "[:" */ colon = strchr(name, ':'); if (colon == 0 || colon[1] != ']') { RE_error_trap(-E3); } size = (size_t) (colon - *start); /* length of name */ if (size < 5 || size > 6) { RE_error_trap(-E3); } *start = colon + 2; switch (name[0]) { case 'a': item = ((name[2] == 'n') ? CCLASS_alnum : CCLASS_alpha); break; case 'b': item = CCLASS_blank; break; case 'c': item = CCLASS_cntrl; break; case 'd': item = CCLASS_digit; break; case 'g': item = CCLASS_graph; break; case 'l': item = CCLASS_lower; break; case 'p': item = ((name[1] == 'r') ? CCLASS_print : CCLASS_punct); break; case 's': item = CCLASS_space; break; case 'u': item = CCLASS_upper; break; case 'x': item = CCLASS_xdigit; break; default: item = CCLASS_NONE; break; } if (item-- != CCLASS_NONE && (size == cclass_table[item].size) && !strncmp(name, cclass_table[item].name, size)) { code = cclass_table[item].code; } else { RE_error_trap(-E3); } if ((result = cclass_data[item]) == 0) { int ch = 0; size_t have = 4; size_t used = 0; CCLASS *data = malloc(sizeof(CCLASS) * have); int in_class = 0; int first = -2; int last = -2; for (ch = 0; ch < 256; ++ch) { switch (code) { case CCLASS_NONE: in_class = 0; break; case CCLASS_alnum: in_class = isalnum(ch); break; case CCLASS_alpha: in_class = isalpha(ch); break; case CCLASS_blank: in_class = isblank(ch); break; case CCLASS_cntrl: in_class = iscntrl(ch); break; case CCLASS_digit: in_class = isdigit(ch); break; case CCLASS_graph: in_class = isgraph(ch); break; case CCLASS_lower: in_class = islower(ch); break; case CCLASS_print: in_class = isprint(ch); break; case CCLASS_punct: in_class = ispunct(ch); break; case CCLASS_space: in_class = isspace(ch); break; case CCLASS_upper: in_class = isupper(ch); break; case CCLASS_xdigit: in_class = isxdigit(ch); break; } if (in_class) { if (first >= 0) { last = ch; } else { first = last = ch; } } else if (first >= 0) { if (used + 2 >= have) { have *= 2; data = realloc(data, sizeof(CCLASS) * have); } data[used].first = first; data[used].last = last; ++used; first = last = -2; } } if (first >= 0) { if (used + 2 >= have) { have *= 2; data = realloc(data, sizeof(CCLASS) * have); } data[used].first = first; data[used].last = last; ++used; } data[used].first = -1; cclass_data[item] = data; result = data; } return result; } static CCLASS * get_cclass(char *start, char **next) { CCLASS *result = 0; if (start[0] == '[' && start[1] == ':') { result = lookup_cclass(&start); if (next != 0) { *next = start; } } return result; } /* * Check if we're pointing to a left square-bracket. If so, return nonzero * if that is a literal one, not part of character class, etc. * * http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html#tag_09_03_05 */ static int literal_leftsq(char *start) { int result = 0; if (start[0] == '[') { if (get_cclass(start, 0) == 0) result = 1; } return result; } /* build a BV for a character class. *start points at the '[' on exit: *start points at the character after ']' mp points at a machine that recognizes the class */ static int do_class(char **start, MACHINE * mp) { char *p, *q; BV *bvp; int prevc; int comp_flag; int level; CCLASS *cclass; p = (*start) + 1; /* []...] puts ] in a class [^]..] negates a class with ] */ if (literal_leftsq(p) || p[0] == ']') p++; else if (p[0] == '^' && (literal_leftsq(p + 1) || p[1] == ']')) p += 2; /* XXX. Does not handle collating symbols or equivalence * class expressions. See also collect_RE(). */ for (level = 0, q = p;; ++q) { if (*q == '[' && q[1] == ':') { if (++level > 1) RE_error_trap(-E3); } else if (*q == ']') { if (level == 0) break; if (q[-1] != ':') RE_error_trap(-E3); --level; } else if (*q == '\\') { ++q; } if (*q == '\0' && q == (re_str + re_len - 1)) { /* no closing bracket */ RE_error_trap(-E3); } } /* q now pts at the back of the class */ p = *start + 1; *start = q + 1; bvp = (BV *) RE_malloc(sizeof(BV)); memset(bvp, 0, sizeof(BV)); if (*p == '^') { comp_flag = 1; p++; } else comp_flag = 0; prevc = -1; /* indicates - cannot be part of a range */ while (p < q) { switch (*p) { case '\\': ++p; prevc = escape(&p); char_on(*bvp, prevc); break; case '[': if ((cclass = get_cclass(p, &p)) != 0) { while (cclass->first >= 0) { block_on(*bvp, cclass->first, cclass->last); ++cclass; } } else { prevc = (UChar) * p++; char_on(*bvp, prevc); } break; case '-': if (prevc == -1 || p + 1 == q) { prevc = '-'; char_on(*bvp, '-'); p++; } else { int c; char *mark = ++p; if (*p != '\\') c = (UChar) * p++; else { ++p; c = escape(&p); } if (prevc <= c) { block_on(*bvp, prevc, c); prevc = -1; } else { /* back up */ p = mark; prevc = '-'; char_on(*bvp, '-'); } } break; default: prevc = (UChar) * p++; char_on(*bvp, prevc); break; } } if (comp_flag) { for (p = (char *) bvp; p < (char *) bvp + sizeof(BV); p++) { *p = (char) (~*p); } } *mp = RE_class(store_bvp(bvp)); return T_CLASS; } /* storage for bit vectors so they can be reused , stored in an unsorted linear array the array grows as needed */ #define BV_GROWTH 6 static BV **bv_base, **bv_limit; static BV **bv_next; /* next empty slot in the array */ static BV * store_bvp(BV * bvp) { register BV **p; unsigned t; if (bv_next == bv_limit) { /* need to grow */ if (!bv_base) { /* first growth */ t = 0; bv_base = (BV **) RE_malloc(BV_GROWTH * sizeof(BV *)); } else { t = (unsigned) (bv_next - bv_base); bv_base = (BV **) RE_realloc(bv_base, (t + BV_GROWTH) * sizeof(BV *)); } bv_next = bv_base + t; bv_limit = bv_next + BV_GROWTH; } /* put bvp in bv_next as a sentinel */ *bv_next = bvp; p = bv_base; while (memcmp(*p, bvp, sizeof(BV))) p++; if (p == bv_next) { /* it is new */ bv_next++; } else { /* we already have it */ RE_free(bvp); } return *p; } /* ---------- convert escape sequences -------------*/ #define isoctal(x) ((x)>='0'&&(x)<='7') #define NOT_HEX 16 static char hex_val['f' - 'A' + 1] = { 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 13, 14, 15}; /* interpret 1 character as hex */ static int ctohex(int c) { int t; if (isdigit((UChar) c)) return c - '0'; if (isxdigit((UChar) c) && (t = hex_val[c - 'A'])) return t; return NOT_HEX; } /* * Return the char and move the pointer forward. * On entry *s -> at the character after the slash. */ static int escape(char **start_p) { register char *p = *start_p; register unsigned x; unsigned xx; switch (*p) { case 'n': *start_p = p + 1; return '\n'; case 't': *start_p = p + 1; return '\t'; case 'f': *start_p = p + 1; return '\f'; case 'b': *start_p = p + 1; return '\b'; case 'r': *start_p = p + 1; return '\r'; case 'a': *start_p = p + 1; return '\07'; case 'v': *start_p = p + 1; return '\013'; case '\0': return '\\'; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': x = (unsigned) (*p++ - '0'); if (isoctal(*p)) { x = (x << 3) + (unsigned) (*p++ - '0'); if (isoctal(*p)) x = (x << 3) + (unsigned) (*p++ - '0'); } *start_p = p; return (int) (x & 0xff); case 'x': ++p; if ((x = (unsigned) ctohex(*p)) == NOT_HEX) { *start_p = p; return 'x'; } /* look for another hex digit */ if ((xx = (unsigned) ctohex(*++p)) != NOT_HEX) { x = (x << 4) + xx; p++; } *start_p = p; return (int) x; default: /* anything else \c -> c */ *start_p = p + 1; return (UChar) * p; } } mawk-1.3.4-20200120/INSTALL0000644000175100001440000002231010771537705013124 0ustar tomusersInstallation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. mawk-1.3.4-20200120/field.h0000644000175100001440000000533212375511765013334 0ustar tomusers/******************************************** field.h copyright 2009-2010,2014 Thomas E. Dickey copyright 1991-1995,2014 Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: field.h,v 1.12 2014/08/22 00:51:01 tom Exp $ * @Log: field.h,v @ * Revision 1.2 1995/06/18 19:42:16 mike * Remove some redundant declarations and add some prototypes * * Revision 1.1.1.1 1993/07/03 18:58:12 mike * move source to cvs * * Revision 5.2 1992/01/06 08:10:24 brennan * set_binmode() proto for MSDOS * * Revision 5.1 91/12/05 07:59:16 brennan * 1.1 pre-release * */ /* field.h */ #ifndef MAWK_FIELD_H #define MAWK_FIELD_H 1 #include "nstd.h" #include "types.h" extern void set_field0(char *, size_t); extern void split_field0(void); extern void field_assign(CELL *, CELL *); extern char *is_string_split(PTR, SLen *); extern void slow_cell_assign(CELL *, CELL *); extern CELL *slow_field_ptr(int); extern int field_addr_to_index(CELL *); extern void set_binmode(int); #define NUM_PFIELDS 5 extern CELL field[FBANK_SZ + NUM_PFIELDS]; /* $0, $1 ... $(FBANK_SZ-1), NF, RS, RS, CONVFMT, OFMT */ /* more fields if needed go here */ extern CELL **fbankv; /* fbankv[0] == field */ /* index to CELL * for a field */ #define field_ptr(i) ((i) < FBANK_SZ ? field + (i) : slow_field_ptr(i)) /* some, such as RS may be defined in system-headers */ #undef NF #undef RS #undef FS #undef CONVFMT #undef OFMT /* some compilers choke on (NF-field) in a case statement even though it's constant so ... */ #define NF_field FBANK_SZ #define RS_field (FBANK_SZ + 1) #define FS_field (FBANK_SZ + 2) #define CONVFMT_field (FBANK_SZ + 3) #define OFMT_field (FBANK_SZ + 4) /* the pseudo fields, assignment has side effects */ #define NF (field + NF_field) /* must be first */ #define RS (field + RS_field) #define FS (field + FS_field) #define CONVFMT (field + CONVFMT_field) #define OFMT (field + OFMT_field) /* must be last */ #define LAST_PFIELD OFMT extern int nf; /* shadows NF */ /* a shadow type for RS and FS */ #define SEP_SPACE 0 #define SEP_CHAR 1 #define SEP_STR 2 #define SEP_RE 3 #define SEP_MLR 4 typedef struct { char type; char c; PTR ptr; /* STRING* or RE machine* */ } SEPARATOR; extern SEPARATOR rs_shadow; extern CELL fs_shadow; /* types for splitting overflow */ typedef struct spov { struct spov *link; STRING *sval; } SPLIT_OV; extern SPLIT_OV *split_ov_list; #endif /* MAWK_FIELD_H */ mawk-1.3.4-20200120/hash.c0000644000175100001440000001417012044613077013157 0ustar tomusers/******************************************** hash.c copyright 2008-2010,2012, Thomas E. Dickey copyright 1991-1993,1994, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: hash.c,v 1.19 2012/11/02 00:39:27 tom Exp $ * @Log: hash.c,v @ * Revision 1.3 1994/10/08 19:15:43 mike * remove SM_DOS * * Revision 1.2 1993/07/16 00:17:35 mike * cleanup * * Revision 1.1.1.1 1993/07/03 18:58:14 mike * move source to cvs * * Revision 5.1 1991/12/05 07:56:05 brennan * 1.1 pre-release * */ /* hash.c */ #include "mawk.h" #include "memory.h" #include "symtype.h" #ifdef NO_LEAKS #include "bi_vars.h" #endif /* * FNV-1 hash function * http://www.isthe.com/chongo/tech/comp/fnv/index.html */ unsigned hash(const char *s) { /* FNV-1 */ register unsigned h = 2166136261U; while (*s) { h ^= (UChar) (*s++); h *= 16777619U; } return h; } unsigned hash2(const char *s, size_t len) { /* FNV-1 */ register unsigned h = 2166136261U; while (len-- != 0) { h ^= (UChar) (*s++); h *= 16777619U; } return h; } typedef struct hash { struct hash *link; SYMTAB symtab; } HASHNODE; static HASHNODE *hash_table[HASH_PRIME]; #ifdef NO_LEAKS static void free_hashnode(HASHNODE *); #else #define free_hashnode(p) zfree(delete(p->symtab.name), sizeof(HASHNODE)) #endif /* insert a string in the symbol table. Caller knows the symbol is not there -- used for initialization */ SYMTAB * insert(const char *s) { register HASHNODE *p = ZMALLOC(HASHNODE); register unsigned h; p->link = hash_table[h = hash(s) % HASH_PRIME]; p->symtab.name = s; #ifdef NO_LEAKS p->symtab.free_name = 0; #endif hash_table[h] = p; return &p->symtab; } /* Find s in the symbol table, if not there insert it, s must be dup'ed */ SYMTAB * find(const char *s) { register HASHNODE *p; HASHNODE *q; unsigned h; p = hash_table[h = hash(s) % HASH_PRIME]; q = (HASHNODE *) 0; while (1) { if (!p) { p = ZMALLOC(HASHNODE); p->symtab.type = ST_NONE; p->symtab.name = strcpy(zmalloc(strlen(s) + 1), s); #ifdef NO_LEAKS p->symtab.free_name = 1; #endif break; } if (strcmp(p->symtab.name, s) == 0) /* found */ { if (!q) /* already at the front */ return &p->symtab; else { /* delete from the list */ q->link = p->link; break; } } q = p; p = p->link; } /* put p on front of the list */ p->link = hash_table[h]; hash_table[h] = p; return &p->symtab; } /* remove a node from the hash table return a ptr to the node */ static unsigned last_hash; static HASHNODE * delete(const char *s) { register HASHNODE *p; HASHNODE *q = (HASHNODE *) 0; unsigned h; p = hash_table[last_hash = h = hash(s) % HASH_PRIME]; while (p) { if (strcmp(p->symtab.name, s) == 0) /* found */ { if (q) q->link = p->link; else hash_table[h] = p->link; return p; } else { q = p; p = p->link; } } #ifdef DEBUG /* we should not ever get here */ bozo("delete"); #endif return (HASHNODE *) 0; } /* when processing user functions, global ids which are replaced by local ids are saved on this list */ static HASHNODE *save_list; /* store a global id on the save list, return a ptr to the local symtab */ SYMTAB * save_id(const char *s) { HASHNODE *p, *q; unsigned h; p = delete(s); q = ZMALLOC(HASHNODE); q->symtab.type = ST_LOCAL_NONE; q->symtab.name = p->symtab.name; /* put q in the hash table */ q->link = hash_table[h = last_hash]; hash_table[h] = q; /* save p */ p->link = save_list; save_list = p; return &q->symtab; } /* restore all global identifiers */ void restore_ids(void) { register HASHNODE *p, *q; register unsigned h; q = save_list; save_list = (HASHNODE *) 0; while (q) { p = q; q = q->link; free_hashnode(p); p->link = hash_table[h = last_hash]; hash_table[h] = p; } } /* search the symbol table backwards for the disassembler. This is slow -- so what */ const char * reverse_find(int type, PTR ptr) { CELL *cp = 0; ARRAY array = 0; static char uk[] = "unknown"; int i; HASHNODE *p; switch (type) { case ST_VAR: case ST_FIELD: cp = *(CELL **) ptr; break; case ST_ARRAY: array = *(ARRAY *) ptr; break; default: return uk; } for (i = 0; i < HASH_PRIME; i++) { p = hash_table[i]; while (p) { if (p->symtab.type == type) { switch (type) { case ST_VAR: case ST_FIELD: if (cp == p->symtab.stval.cp) return p->symtab.name; break; case ST_ARRAY: if (array == p->symtab.stval.array) return p->symtab.name; break; } } p = p->link; } } return uk; } #ifdef NO_LEAKS static void free_symtab_name(HASHNODE * p) { if (p->symtab.free_name) { zfree((PTR) (p->symtab.name), strlen(p->symtab.name) + 1); } } static void free_hashnode(HASHNODE * p) { CELL *cp; TRACE(("...deleting hash %p (%p) %s %d\n", (void *) p, (void *) &(p->symtab), p->symtab.name, p->symtab.type)); p = delete(p->symtab.name); switch (p->symtab.type) { case ST_FUNCT: free_codes(p->symtab.name, p->symtab.stval.fbp->code, p->symtab.stval.fbp->size); if (p->symtab.stval.fbp->nargs) zfree(p->symtab.stval.fbp->typev, p->symtab.stval.fbp->nargs); zfree(p->symtab.stval.fbp, sizeof(FBLOCK)); break; case ST_NONE: break; case ST_VAR: cp = p->symtab.stval.cp; if (cp != 0 && (cp < bi_vars || cp > bi_vars + NUM_BI_VAR)) { switch (cp->type) { case C_STRING: case C_STRNUM: case C_MBSTRN: free_STRING(string(cp)); break; } zfree(cp, sizeof(CELL)); } break; default: break; } free_symtab_name(p); zfree(p, sizeof(HASHNODE)); } void hash_leaks(void) { int i; HASHNODE *p; TRACE(("hash_leaks\n")); for (i = 0; i < HASH_PRIME; i++) { while ((p = hash_table[i]) != 0) { free_hashnode(p); } } } #endif mawk-1.3.4-20200120/rexp2.c0000644000175100001440000002032713611341423013267 0ustar tomusers/******************************************** rexp2.c copyright 2009-2017,2020, Thomas E. Dickey copyright 2010, Jonathan Nieder copyright 1991-1992,1993, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: rexp2.c,v 1.28 2020/01/20 15:11:15 tom Exp $ */ /* test a string against a machine */ #include "rexp.h" #define STACKGROWTH 16 RT_STATE *RE_run_stack_base; RT_STATE *RE_run_stack_limit; /* Large model DOS segment arithmetic breaks the current stack. This hack fixes it without rewriting the whole thing, 5/31/91 */ RT_STATE *RE_run_stack_empty; RT_POS_ENTRY *RE_pos_stack_base; RT_POS_ENTRY *RE_pos_stack_limit; RT_POS_ENTRY *RE_pos_stack_empty; void RE_run_stack_init(void) { if (!RE_run_stack_base) { RE_run_stack_base = (RT_STATE *) RE_malloc(sizeof(RT_STATE) * STACKGROWTH); RE_run_stack_limit = RE_run_stack_base + STACKGROWTH; RE_run_stack_empty = RE_run_stack_base - 1; } } void RE_pos_stack_init(void) { if (!RE_pos_stack_base) { RE_pos_stack_base = (RT_POS_ENTRY *) RE_malloc(sizeof(RT_POS_ENTRY) * STACKGROWTH); RE_pos_stack_limit = RE_pos_stack_base + STACKGROWTH; RE_pos_stack_empty = RE_pos_stack_base; RE_pos_stack_base->pos = NULL; /* RE_pos_peek(RE_pos_stack_empty) */ RE_pos_stack_base->owner = -1; /* avoid popping base */ RE_pos_stack_base->prev_offset = 0; /* avoid popping below base */ } } /* sometimes during REmatch(), this stack can grow pretty large. In real life cases, the back tracking usually fails. Some work is needed here to improve the algorithm. I.e., figure out how not to stack useless paths. */ RT_STATE * RE_new_run_stack(void) { size_t oldsize = (size_t) (RE_run_stack_limit - RE_run_stack_base); size_t newsize = oldsize + STACKGROWTH; #ifdef LMDOS /* large model DOS */ /* have to worry about overflow on multiplication (ugh) */ if (newsize >= 4096) RE_run_stack_base = (RT_STATE *) 0; else #endif RE_run_stack_base = (RT_STATE *) realloc(RE_run_stack_base, newsize * sizeof(RT_STATE)); if (!RE_run_stack_base) { fprintf(stderr, "out of memory for RE run time stack\n"); /* this is pretty unusual, I've only seen it happen on weird input to REmatch() under 16bit DOS , the same situation worked easily on 32bit machine. */ mawk_exit(100); } RE_run_stack_limit = RE_run_stack_base + newsize; RE_run_stack_empty = RE_run_stack_base - 1; /* return the new stackp */ return RE_run_stack_base + oldsize; } RT_POS_ENTRY * RE_new_pos_stack(void) { size_t oldsize = (size_t) (RE_pos_stack_limit - RE_pos_stack_base); size_t newsize = oldsize + STACKGROWTH; /* FIXME: handle overflow on multiplication for large model DOS * (see RE_new_run_stack()). */ RE_pos_stack_base = (RT_POS_ENTRY *) realloc(RE_pos_stack_base, newsize * sizeof(RT_POS_ENTRY)); if (!RE_pos_stack_base) { fprintf(stderr, "out of memory for RE string position stack\n"); mawk_exit(100); } RE_pos_stack_limit = RE_pos_stack_base + newsize; RE_pos_stack_empty = RE_pos_stack_base; /* return the new stackp */ return RE_pos_stack_base + oldsize; } #ifdef DEBUG static RT_STATE * slow_push( RT_STATE * sp, STATE * m, char *s, RT_POS_ENTRY * pos_top, int u) { if (sp == RE_run_stack_limit) sp = RE_new_run_stack(); sp->m = m; sp->s = s; sp->u = u; sp->sp = pos_top - RE_pos_stack_base; sp->tp = pos_top->prev_offset; return sp; } #endif #ifdef DEBUG #define push(mx,sx,px,ux) do { \ stackp = slow_push(++stackp, mx, sx, px, ux); \ } while(0) #else #define push(mx,sx,px,ux) do { \ if (++stackp == RE_run_stack_limit) \ stackp = RE_new_run_stack(); \ stackp->m = (mx); \ stackp->s = (sx); \ stackp->u = (ux); \ stackp->sp = (int) ((px) - RE_pos_stack_base); \ stackp->tp = (px)->prev_offset; \ } while(0) #endif #define CASE_UANY(x) case (x)+U_OFF: /* FALLTHRU */ case (x)+U_ON /* * test if str ~ /machine/ */ int REtest(char *str, /* string to test */ size_t len, /* ...its length */ PTR machine) /* compiled regular-expression */ { register STATE *m = (STATE *) machine; char *s = str; register RT_STATE *stackp; int u_flag; char *str_end = str + len; RT_POS_ENTRY *sp; int t; /*convenient temps */ STATE *tm; /* handle the easy case quickly */ if (m->s_type == M_STR && (m + 1)->s_type == M_ACCEPT) { return str_str(s, len, m->s_data.str, (size_t) m->s_len) != (char *) 0; } else { u_flag = U_ON; stackp = RE_run_stack_empty; sp = RE_pos_stack_empty; RE_CASE(); } refill: if (stackp == RE_run_stack_empty) { return 0; } m = stackp->m; s = stackp->s; sp = RE_pos_stack_base + stackp->sp; sp->prev_offset = stackp->tp; u_flag = (stackp--)->u; reswitch: switch (m->s_type + u_flag) { case M_STR + U_OFF + END_OFF: if (strncmp(s, m->s_data.str, (size_t) m->s_len)) { RE_FILL(); } s += m->s_len; m++; RE_CASE(); case M_STR + U_OFF + END_ON: if (strcmp(s, m->s_data.str)) { RE_FILL(); } s += m->s_len; m++; RE_CASE(); case M_STR + U_ON + END_OFF: if (!(s = str_str(s, (size_t) (str_end - s), m->s_data.str, (size_t) m->s_len))) { RE_FILL(); } push(m, s + 1, sp, U_ON); s += m->s_len; m++; u_flag = U_OFF; RE_CASE(); case M_STR + U_ON + END_ON: t = (int) (str_end - s) - (int) m->s_len; if (t < 0 || memcmp(s + t, m->s_data.str, (size_t) m->s_len)) { RE_FILL(); } s = str_end; m++; u_flag = U_OFF; RE_CASE(); case M_CLASS + U_OFF + END_OFF: if (s >= str_end || !ison(*m->s_data.bvp, s[0])) { RE_FILL(); } s++; m++; RE_CASE(); case M_CLASS + U_OFF + END_ON: if (s >= str_end) { RE_FILL(); } if ((s + 1) < str_end || !ison(*m->s_data.bvp, s[0])) { RE_FILL(); } s++; m++; RE_CASE(); case M_CLASS + U_ON + END_OFF: for (;;) { if (s >= str_end) { RE_FILL(); } else if (ison(*m->s_data.bvp, s[0])) { break; } s++; } s++; push(m, s, sp, U_ON); m++; u_flag = U_OFF; RE_CASE(); case M_CLASS + U_ON + END_ON: if (s >= str_end || !ison(*m->s_data.bvp, str_end[-1])) { RE_FILL(); } s = str_end; m++; u_flag = U_OFF; RE_CASE(); case M_ANY + U_OFF + END_OFF: if (s >= str_end) { RE_FILL(); } s++; m++; RE_CASE(); case M_ANY + U_OFF + END_ON: if (s >= str_end || (s + 1) < str_end) { RE_FILL(); } s++; m++; RE_CASE(); case M_ANY + U_ON + END_OFF: if (s >= str_end) { RE_FILL(); } s++; push(m, s, sp, U_ON); m++; u_flag = U_OFF; RE_CASE(); case M_ANY + U_ON + END_ON: if (s >= str_end) { RE_FILL(); } s = str_end; m++; u_flag = U_OFF; RE_CASE(); case M_START + U_OFF + END_OFF: case M_START + U_ON + END_OFF: if (s != str) { RE_FILL(); } m++; u_flag = U_OFF; RE_CASE(); case M_START + U_OFF + END_ON: case M_START + U_ON + END_ON: if (s != str || s < str_end) { RE_FILL(); } m++; u_flag = U_OFF; RE_CASE(); case M_END + U_OFF: if (s < str_end) { RE_FILL(); } m++; RE_CASE(); case M_END + U_ON: s += strlen(s); m++; u_flag = U_OFF; RE_CASE(); CASE_UANY(M_U): u_flag = U_ON; m++; RE_CASE(); CASE_UANY(M_1J): m += m->s_data.jump; RE_CASE(); CASE_UANY(M_SAVE_POS): /* save position for a later M_2JC */ sp = RE_pos_push(sp, stackp, s); m++; RE_CASE(); CASE_UANY(M_2JA): /* take the non jump branch */ /* don't stack an ACCEPT */ if ((tm = m + m->s_data.jump)->s_type == M_ACCEPT) { return 1; } push(tm, s, sp, u_flag); m++; RE_CASE(); CASE_UANY(M_2JC): /* take the jump branch if position changed */ if (RE_pos_pop(&sp, stackp) == s) { /* did not advance: do not jump back */ m++; RE_CASE(); } /* FALLTHRU */ case (M_2JB) + U_OFF: /* take the jump branch */ /* FALLTHRU */ case (M_2JB) + U_ON: /* don't stack an ACCEPT */ if ((tm = m + 1)->s_type == M_ACCEPT) { return 1; } push(tm, s, sp, u_flag); m += m->s_data.jump; RE_CASE(); CASE_UANY(M_ACCEPT): return 1; default: RE_panic("unexpected case in REtest"); } } #undef push mawk-1.3.4-20200120/bi_funct.h0000644000175100001440000000252612773320000014022 0ustar tomusers/******************************************** bi_funct.h copyright 2009-2012,2016 Thomas E. Dickey copyright 1991, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: bi_funct.h,v 1.6 2016/09/29 23:13:04 tom Exp $ */ #ifndef BI_FUNCT_H #define BI_FUNCT_H 1 #include "symtype.h" extern const BI_REC bi_funct[]; void bi_init(void); /* builtin string functions */ CELL *bi_print(CELL *); CELL *bi_printf(CELL *); CELL *bi_length(CELL *); CELL *bi_index(CELL *); CELL *bi_substr(CELL *); CELL *bi_sprintf(CELL *); CELL *bi_split(CELL *); CELL *bi_match(CELL *); CELL *bi_getline(CELL *); CELL *bi_sub(CELL *); CELL *bi_gsub(CELL *); CELL *bi_toupper(CELL *); CELL *bi_tolower(CELL *); /* builtin arith functions */ CELL *bi_sin(CELL *); CELL *bi_cos(CELL *); CELL *bi_atan2(CELL *); CELL *bi_log(CELL *); CELL *bi_exp(CELL *); CELL *bi_int(CELL *); CELL *bi_sqrt(CELL *); CELL *bi_srand(CELL *); CELL *bi_rand(CELL *); /* time functions */ CELL *bi_mktime(CELL *); CELL *bi_strftime(CELL *); CELL *bi_systime(CELL *); /* other builtins */ CELL *bi_close(CELL *); CELL *bi_system(CELL *); CELL *bi_fflush(CELL *); #endif /* BI_FUNCT_H */ mawk-1.3.4-20200120/scan.h0000644000175100001440000000322711500456220013155 0ustar tomusers/******************************************** scan.h copyright 2009,2010, Thomas E. Dickey copyright 2009, Jonathan Nieder copyright 1991-1994,1995, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: scan.h,v 1.5 2010/12/10 17:00:00 tom Exp $ * @Log: scan.h,v @ * Revision 1.3 1995/06/18 19:42:26 mike * Remove some redundant declarations and add some prototypes * * Revision 1.2 1994/09/23 00:20:06 mike * minor bug fix: handle \ in eat_nl() * * Revision 1.1.1.1 1993/07/03 18:58:20 mike * move source to cvs * * Revision 5.1 1991/12/05 07:59:33 brennan * 1.1 pre-release * */ /* scan.h */ #ifndef SCAN_H_INCLUDED #define SCAN_H_INCLUDED 1 #include #include "scancode.h" #include "symtype.h" #include "parse.h" extern double double_zero; extern double double_one; extern void eat_nl(void); /* in error.c */ extern void unexpected_char(void); #define ct_ret(x) return current_token = (x) #define next() (*buffp ? *buffp++ : slow_next()) #define un_next() buffp-- #define test1_ret(c,x,d) if ( next() == (c) ) ct_ret(x) ;\ else { un_next() ; ct_ret(d) ; } #define test2_ret(c1,x1,c2,x2,d) switch( next() )\ { case c1: ct_ret(x1) ;\ case c2: ct_ret(x2) ;\ default: un_next() ;\ ct_ret(d) ; } #endif /* SCAN_H_INCLUDED */ mawk-1.3.4-20200120/man/0000755000175100001440000000000013611425173012637 5ustar tomusersmawk-1.3.4-20200120/man/array.pdf0000644000175100001440000037575312367543027014502 0ustar tomusers%PDF-1.2 7 0 obj << /Type/Encoding /Differences[0/Gamma/Delta/Theta/Lambda/Xi/Pi/Sigma/Upsilon/Phi/Psi/Omega/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/acute/caron/breve/macron/ring/cedilla/germandbls/ae/oe/oslash/AE/OE/Oslash/suppress/exclam/quotedblright/numbersign/dollar/percent/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon/exclamdown/equal/questiondown/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/quotedblleft/bracketright/circumflex/dotaccent/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/endash/emdash/hungarumlaut/tilde/dieresis/suppress 160/space/Gamma/Delta/Theta/Lambda/Xi/Pi/Sigma/Upsilon/Phi/Psi 173/Omega/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/acute/caron/breve/macron/ring/cedilla/germandbls/ae/oe/oslash/AE/OE/Oslash/suppress/dieresis] >> endobj 10 0 obj << /Encoding 7 0 R /Type/Font /Subtype/Type1 /Name/F1 /FontDescriptor 9 0 R /BaseFont/RPJNVD+CMBX10 /FirstChar 33 /LastChar 196 /Widths[350 602.8 958.3 575 958.3 894.4 319.4 447.2 447.2 575 894.4 319.4 383.3 319.4 575 575 575 575 575 575 575 575 575 575 575 319.4 319.4 350 894.4 543.1 543.1 894.4 869.4 818.1 830.6 881.9 755.6 723.6 904.2 900 436.1 594.4 901.4 691.7 1091.7 900 863.9 786.1 863.9 862.5 638.9 800 884.7 869.4 1188.9 869.4 869.4 702.8 319.4 602.8 319.4 575 319.4 319.4 559 638.9 511.1 638.9 527.1 351.4 575 638.9 319.4 351.4 606.9 319.4 958.3 638.9 575 638.9 606.9 473.6 453.6 447.2 638.9 606.9 830.6 606.9 606.9 511.1 575 1150 575 575 575 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 691.7 958.3 894.4 805.6 766.7 900 830.6 894.4 830.6 894.4 0 0 830.6 670.8 638.9 638.9 958.3 958.3 319.4 351.4 575 575 575 575 575 869.4 511.1 597.2 830.6 894.4 575 1041.7 1169.4 894.4 319.4 575] >> endobj 13 0 obj << /Encoding 7 0 R /Type/Font /Subtype/Type1 /Name/F2 /FontDescriptor 12 0 R /BaseFont/JAABHJ+CMR10 /FirstChar 33 /LastChar 196 /Widths[277.8 500 833.3 500 833.3 777.8 277.8 388.9 388.9 500 777.8 277.8 333.3 277.8 500 500 500 500 500 500 500 500 500 500 500 277.8 277.8 277.8 777.8 472.2 472.2 777.8 750 708.3 722.2 763.9 680.6 652.8 784.7 750 361.1 513.9 777.8 625 916.7 750 777.8 680.6 777.8 736.1 555.6 722.2 750 750 1027.8 750 750 611.1 277.8 500 277.8 500 277.8 277.8 500 555.6 444.4 555.6 444.4 305.6 500 555.6 277.8 305.6 527.8 277.8 833.3 555.6 500 555.6 527.8 391.7 394.4 388.9 555.6 527.8 722.2 527.8 527.8 444.4 500 1000 500 500 500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 625 833.3 777.8 694.4 666.7 750 722.2 777.8 722.2 777.8 0 0 722.2 583.3 555.6 555.6 833.3 833.3 277.8 305.6 500 500 500 500 500 750 444.4 500 722.2 777.8 500 902.8 1013.9 777.8 277.8 500] >> endobj 14 0 obj << /Type/Encoding /Differences[0/Gamma/Delta/Theta/Lambda/Xi/Pi/Sigma/Upsilon/Phi/Psi/Omega/arrowup/arrowdown/quotesingle/exclamdown/questiondown/dotlessi/dotlessj/grave/acute/caron/breve/macron/ring/cedilla/germandbls/ae/oe/oslash/AE/OE/Oslash/visiblespace/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/asciicircum/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/asciitilde/dieresis/visiblespace 160/space/Gamma/Delta/Theta/Lambda/Xi/Pi/Sigma/Upsilon/Phi/Psi 173/Omega/arrowup/arrowdown/quotesingle/exclamdown/questiondown/dotlessi/dotlessj/grave/acute/caron/breve/macron/ring/cedilla/germandbls/ae/oe/oslash/AE/OE/Oslash/visiblespace/dieresis] >> endobj 17 0 obj << /Encoding 14 0 R /Type/Font /Subtype/Type1 /Name/F3 /FontDescriptor 16 0 R /BaseFont/OGVQKY+CMTT10 /FirstChar 33 /LastChar 196 /Widths[525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 525 525 525 525 525 525 525 525 525 525 0 0 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525] >> endobj 19 0 obj << /Filter[/FlateDecode] /Length 640 >> stream xÚÕ–Ms›0†ïý:в´Â:6qÝ™NæÖö@Œ3eLpÓô×w%alÉ$íLcû$“haŸÝw?gœ“;â÷ä*›Ì1Ìh’ݑ⟉53@²ÙWú9¤ ?¢XN¾mÿüØFß³O“9 †œÄB0“x£fÙÆ?#H©mÚ²^‡»r¸« S-ÜUÁd žp \¨ ŸN¸÷wNÅ ÐHœH–N½Y™„æ7• ~Õ·î”ô?†îu ÷’ 1ÂÄ"eFößäøM¡ ýˆ÷8íšÍ9-6Ënpw‡f Ó½· íà…§üÏÿ½‡±šÒãzˆX(f”'!³¼Ë]ô]t F`ÓØ£ìâE–¨“á¯Þƒði€GbÅ4쫘ˆ0&¨4}Dl”É€öÒ¼†›ÿúž]në ²y»rP ËÁH‹Ïizʤ¼ô=»ä(w[¾ƒtå ÝÐŽ¸O$v/÷x6Ü•ñe‹ž±|BÄór]DñT¨sÖïŽå¾Žu£p3[ÙËÓÀ9êv”ÎW©t£ÎÑ]mʪ(×w¡Róµ;eÏœfIÊn~-‹âäÄôÚõ1†¥F“v]Ù¼A·…9ç¦sˆ'Ç𒀇»Eë'EÝlW„¹­··ñ`ÓM¸8)—vÍt”GžY½¹©v+Û«­üÝÿòK•ã ÛÙ"Ýl~ùÀ_7KµŽtHÓ2ÇgÀ–í ²—¾¢\º¹¨}R):É~à©aà-êM³´a[›—Õñ¢vY»jˆÀóËj²[Ø Vöò$©mÂàÇŒÚ_—:!ÌûwÙ›?&ËÏ endstream endobj 21 0 obj << /F1 10 0 R /F2 13 0 R /F3 17 0 R >> endobj 6 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 21 0 R >> endobj 24 0 obj << /Filter[/FlateDecode] /Length 20 >> stream xÚS0Ð30PHWSî\ µ endstream endobj 23 0 obj << /ProcSet[/PDF/Text/ImageC] >> endobj 29 0 obj << /Encoding 7 0 R /Type/Font /Subtype/Type1 /Name/F4 /FontDescriptor 28 0 R /BaseFont/TFYXAO+CMSL10 /FirstChar 33 /LastChar 196 /Widths[277.8 500 833.3 500 833.3 777.8 277.8 388.9 388.9 500 777.8 277.8 333.3 277.8 500 500 500 500 500 500 500 500 500 500 500 277.8 277.8 277.8 777.8 472.2 472.2 777.8 750 708.3 722.2 763.9 680.6 652.8 784.7 750 361.1 513.9 777.8 625 916.7 750 777.8 680.6 777.8 736.1 555.6 722.2 750 750 1027.8 750 750 611.1 277.8 500 277.8 500 277.8 277.8 500 555.6 444.4 555.6 444.4 305.6 500 555.6 277.8 305.6 527.8 277.8 833.3 555.6 500 555.6 527.8 391.7 394.4 388.9 555.6 527.8 722.2 527.8 527.8 444.4 500 1000 500 500 500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 625 833.3 777.8 694.4 666.7 750 722.2 777.8 722.2 777.8 0 0 722.2 583.3 555.6 555.6 833.3 833.3 277.8 305.6 500 500 500 500 500 808.6 444.4 500 722.2 777.8 500 902.8 1013.9 777.8 277.8 500] >> endobj 30 0 obj << /Type/Encoding /Differences[0/minus/periodcentered/multiply/asteriskmath/divide/diamondmath/plusminus/minusplus/circleplus/circleminus/circlemultiply/circledivide/circledot/circlecopyrt/openbullet/bullet/equivasymptotic/equivalence/reflexsubset/reflexsuperset/lessequal/greaterequal/precedesequal/followsequal/similar/approxequal/propersubset/propersuperset/lessmuch/greatermuch/precedes/follows/arrowleft/arrowright/arrowup/arrowdown/arrowboth/arrownortheast/arrowsoutheast/similarequal/arrowdblleft/arrowdblright/arrowdblup/arrowdbldown/arrowdblboth/arrownorthwest/arrowsouthwest/proportional/prime/infinity/element/owner/triangle/triangleinv/negationslash/mapsto/universal/existential/logicalnot/emptyset/Rfractur/Ifractur/latticetop/perpendicular/aleph/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/union/intersection/unionmulti/logicaland/logicalor/turnstileleft/turnstileright/floorleft/floorright/ceilingleft/ceilingright/braceleft/braceright/angbracketleft/angbracketright/bar/bardbl/arrowbothv/arrowdblbothv/backslash/wreathproduct/radical/coproduct/nabla/integral/unionsq/intersectionsq/subsetsqequal/supersetsqequal/section/dagger/daggerdbl/paragraph/club/diamond/heart/spade/arrowleft 161/minus/periodcentered/multiply/asteriskmath/divide/diamondmath/plusminus/minusplus/circleplus/circleminus 173/circlemultiply/circledivide/circledot/circlecopyrt/openbullet/bullet/equivasymptotic/equivalence/reflexsubset/reflexsuperset/lessequal/greaterequal/precedesequal/followsequal/similar/approxequal/propersubset/propersuperset/lessmuch/greatermuch/precedes/follows/arrowleft/spade] >> endobj 33 0 obj << /Encoding 30 0 R /Type/Font /Subtype/Type1 /Name/F5 /FontDescriptor 32 0 R /BaseFont/LKJITK+CMSY10 /FirstChar 33 /LastChar 196 /Widths[1000 500 500 1000 1000 1000 777.8 1000 1000 611.1 611.1 1000 1000 1000 777.8 275 1000 666.7 666.7 888.9 888.9 0 0 555.6 555.6 666.7 500 722.2 722.2 777.8 777.8 611.1 798.5 656.8 526.5 771.4 527.8 718.7 594.9 844.5 544.5 677.8 762 689.7 1200.9 820.5 796.1 695.6 816.7 847.5 605.6 544.6 625.8 612.8 987.8 713.3 668.3 724.7 666.7 666.7 666.7 666.7 666.7 611.1 611.1 444.4 444.4 444.4 444.4 500 500 388.9 388.9 277.8 500 500 611.1 500 277.8 833.3 750 833.3 416.7 666.7 666.7 777.8 777.8 444.4 444.4 444.4 611.1 777.8 777.8 777.8 777.8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 777.8 277.8 777.8 500 777.8 500 777.8 777.8 777.8 777.8 0 0 777.8 777.8 777.8 1000 500 500 777.8 777.8 777.8 777.8 777.8 777.8 777.8 777.8 777.8 777.8 777.8 777.8 1000 1000 777.8 777.8 1000 777.8] >> endobj 36 0 obj << /Encoding 7 0 R /Type/Font /Subtype/Type1 /Name/F6 /FontDescriptor 35 0 R /BaseFont/BLBMAW+CMR8 /FirstChar 33 /LastChar 196 /Widths[295.1 531.3 885.4 531.3 885.4 826.4 295.1 413.2 413.2 531.3 826.4 295.1 354.2 295.1 531.3 531.3 531.3 531.3 531.3 531.3 531.3 531.3 531.3 531.3 531.3 295.1 295.1 295.1 826.4 501.7 501.7 826.4 795.8 752.1 767.4 811.1 722.6 693.1 833.5 795.8 382.6 545.5 825.4 663.6 972.9 795.8 826.4 722.6 826.4 781.6 590.3 767.4 795.8 795.8 1091 795.8 795.8 649.3 295.1 531.3 295.1 531.3 295.1 295.1 531.3 590.3 472.2 590.3 472.2 324.7 531.3 590.3 295.1 324.7 560.8 295.1 885.4 590.3 531.3 590.3 560.8 414.1 419.1 413.2 590.3 560.8 767.4 560.8 560.8 472.2 531.3 1062.5 531.3 531.3 531.3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 663.6 885.4 826.4 736.8 708.3 795.8 767.4 826.4 767.4 826.4 0 0 767.4 619.8 590.3 590.3 885.4 885.4 295.1 324.7 531.3 531.3 531.3 531.3 531.3 795.8 472.2 531.3 767.4 826.4 531.3 958.7 1076.8 826.4 295.1 531.3] >> endobj 37 0 obj << /Type/Encoding /Differences[0/Gamma/Delta/Theta/Lambda/Xi/Pi/Sigma/Upsilon/Phi/Psi/Omega/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/acute/caron/breve/macron/ring/cedilla/germandbls/ae/oe/oslash/AE/OE/Oslash/suppress/exclam/quotedblright/numbersign/sterling/percent/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon/exclamdown/equal/questiondown/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/quotedblleft/bracketright/circumflex/dotaccent/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/endash/emdash/hungarumlaut/tilde/dieresis/suppress 160/space/Gamma/Delta/Theta/Lambda/Xi/Pi/Sigma/Upsilon/Phi/Psi 173/Omega/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/acute/caron/breve/macron/ring/cedilla/germandbls/ae/oe/oslash/AE/OE/Oslash/suppress/dieresis] >> endobj 40 0 obj << /Encoding 37 0 R /Type/Font /Subtype/Type1 /Name/F7 /FontDescriptor 39 0 R /BaseFont/QLWQNF+CMTI10 /FirstChar 33 /LastChar 196 /Widths[306.7 514.4 817.8 769.1 817.8 766.7 306.7 408.9 408.9 511.1 766.7 306.7 357.8 306.7 511.1 511.1 511.1 511.1 511.1 511.1 511.1 511.1 511.1 511.1 511.1 306.7 306.7 306.7 766.7 511.1 511.1 766.7 743.3 703.9 715.6 755 678.3 652.8 773.6 743.3 385.6 525 768.9 627.2 896.7 743.3 766.7 678.3 766.7 729.4 562.2 715.6 743.3 743.3 998.9 743.3 743.3 613.3 306.7 514.4 306.7 511.1 306.7 306.7 511.1 460 460 511.1 460 306.7 460 511.1 306.7 306.7 460 255.6 817.8 562.2 511.1 511.1 460 421.7 408.9 332.2 536.7 460 664.4 463.9 485.6 408.9 511.1 1022.2 511.1 511.1 511.1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 627.2 817.8 766.7 692.2 664.4 743.3 715.6 766.7 715.6 766.7 0 0 715.6 613.3 562.2 587.8 881.7 894.4 306.7 332.2 511.1 511.1 511.1 511.1 511.1 831.3 460 536.7 715.6 715.6 511.1 882.8 985 766.7 255.6 511.1] >> endobj 41 0 obj << /Type/Encoding /Differences[0/Gamma/Delta/Theta/Lambda/Xi/Pi/Sigma/Upsilon/Phi/Psi/Omega/alpha/beta/gamma/delta/epsilon1/zeta/eta/theta/iota/kappa/lambda/mu/nu/xi/pi/rho/sigma/tau/upsilon/phi/chi/psi/omega/epsilon/theta1/pi1/rho1/sigma1/phi1/arrowlefttophalf/arrowleftbothalf/arrowrighttophalf/arrowrightbothalf/arrowhookleft/arrowhookright/triangleright/triangleleft/zerooldstyle/oneoldstyle/twooldstyle/threeoldstyle/fouroldstyle/fiveoldstyle/sixoldstyle/sevenoldstyle/eightoldstyle/nineoldstyle/period/comma/less/slash/greater/star/partialdiff/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/flat/natural/sharp/slurbelow/slurabove/lscript/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/dotlessi/dotlessj/weierstrass/vector/tie/psi 160/space/Gamma/Delta/Theta/Lambda/Xi/Pi/Sigma/Upsilon/Phi/Psi 173/Omega/alpha/beta/gamma/delta/epsilon1/zeta/eta/theta/iota/kappa/lambda/mu/nu/xi/pi/rho/sigma/tau/upsilon/phi/chi/psi/tie] >> endobj 44 0 obj << /Encoding 41 0 R /Type/Font /Subtype/Type1 /Name/F8 /FontDescriptor 43 0 R /BaseFont/ZDOWWY+CMMI10 /FirstChar 33 /LastChar 196 /Widths[622.5 466.3 591.4 828.1 517 362.8 654.2 1000 1000 1000 1000 277.8 277.8 500 500 500 500 500 500 500 500 500 500 500 500 277.8 277.8 777.8 500 777.8 500 530.9 750 758.5 714.7 827.9 738.2 643.1 786.2 831.3 439.6 554.5 849.3 680.6 970.1 803.5 762.8 642 790.6 759.3 613.2 584.4 682.8 583.3 944.4 828.5 580.6 682.6 388.9 388.9 388.9 1000 1000 416.7 528.6 429.2 432.8 520.5 465.6 489.6 477 576.2 344.5 411.8 520.6 298.4 878 600.2 484.7 503.1 446.4 451.2 468.8 361.1 572.5 484.7 715.9 571.5 490.3 465 322.5 384 636.5 500 277.8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 615.3 833.3 762.8 694.4 742.4 831.3 779.9 583.3 666.7 612.2 0 0 772.4 639.7 565.6 517.7 444.4 405.9 437.5 496.5 469.4 353.9 576.2 583.3 602.5 494 437.5 570 517 571.4 437.2 540.3 595.8 625.7 651.4 277.8] >> endobj 45 0 obj << /Filter[/FlateDecode] /Length 3156 >> stream xÚÍmoܶùû~Å¡û"'>F)RÚ°î’6Þܬ¨]ESº;Ù'äîdœtqÒ¢ÿ}Ï )Q/vƒmöIE>ï|Þ¨E,âxq· Ç׋/o^|%¹ÈÍâæv/–<|ùS$ÅÙRJG—‡3Gí±>[ÂssZ·U}g?ßüýÅWI·UÆJØ àÞ›mÕœ-u¢"~ê¨Ý–ÕáK_–9|ûâáý˜ $R¹ïÕþ~Wì³ÄFm‡@Eõ­#?š,ŽGx7ѧ†˜\,•JD¶aˆ<%p´Â Ü!£êÀOÚÆ`bC\&QÑ4޽ŠP7<͸eÔ´Çêpç&ÛÚíé ‚ëbWùdz4ŠÝ©â–6ÎAÔÍ~°gžcÄVKŒ·ÝÍ’8C&‰h­lNœ*›EÛ¢Ùò¨-V;"&µŽ˜ð{Îßy²Y#5[ ßVWÑðKux›˜øTÖ冗¯HÄü•,…h¬j_‘Pˆ†Ú=}mʦºs¤Þ¿N9`“Íœ82*úúX5¸ªÞmx†qÂàæ,ujsΦ¦{ÛO”н헼í¥'ÂèÖe§ÓéE¶\øòÓ¡ØWk^ü¤¶Á_®Ë¶¦‘0xCùóÏËåÀŽŽƒÒRéhtô© —Pý×õm{¦$(I%lË ¤ðí±€ã¿¦7OH¦£WïaDå±BN|ƒÉEÚ¡†ó¤¢D¹J%ÐlÝ›Ìs%&Äñþe¢…dâï›^mÁ$\·GðL§céNmÌë[ßy3:»àÇÀ°t÷Û¦ ”šÚR5˜yàŸ¤•Þ .¾ûîâljOÊ…I¼OB¥A?îé´Õ[Fytèj~cTV ©!à&)ù®Oc¬&Ö‹Ä ó˜ø;ÔL$Èê—‰AšÊ›¤¶¤s´yFøôÁ€ÛifE\7ìH³TØ•‘ÙƒÞËÞY!40%²eå.!G‚äëÔ©&÷eq࢔l©atä¡£¸á›’Å ‡ÙÍÐ9D,SÁ(™ mçí§û9É$z(gMioà ŒÃ뙈­ÜŽÁ¤"õñªð†e10ºMyëhÆã7¢5ÓÂz›ý#¬¬àFx´™w² ºéMÎŒ±À“ÑcDK ö’ t‰¢”hˆzÆ(iø+‚L…ÉíßÞ|ÇÛîÛ#/ü3 ŽÓ8zñŒßØZK¹Žîá´´nŒŸ YV*¾ RyKé¨=={1ñÀêßµŽ~<ž|xB§ýªtDÖ·ü,wžŒj‚‘Ãßç ÜAHkgq~ã­üqŸdìtÀH„qñl÷Eó~ϪjªÆ"玃‡ªÝòˆ£:Ž>` 2”ü]ÙNX®›òã]ì–›m}tÌ÷ Œ5O¨Fâ½øñݛﯮøEˆnòúÛ«Ë›¾åÄÖ~c„ÏØA;”dÝfaEnÙºÁÎxh‘çKô))º&F8’«s¨Â}¢pˆ_Ôª B2ñˆ9)ÆïkL­0KáWžN£SS:äüà™ÈÍ$.ÅLôq Cs’KŽÑ8h·ÇÒɉ8_×ðm’'½¡ù˜©çýeSú5ЦjZ°ÀSÕlK·Ì§gnË4œ˜ßñš¿'ãx‚Ày”M£—Zqð"òæØ’ÿ4qVÀŸP†Œ!ÖžM}cj1_©¡7æ’†bÖþ¾ œ4k_Í+”K<[Çdˆ«ØQnÚ) þRkŠ‡Ú“ª‹x Ž.Æ“KÞ~¨y‹ ¡bêásˆø#™ñ.V~óú@hèDˆü†_ÖDzhÉÖaá*X5':%…ôáêâ‡LÒ´Lä^t«Sµk—ÕaÁS¡üšæ~^v,#¤2$-{FŽ%˜ÞÇP}éˆ]’{{¬÷zcÛÓ;,ï©ÊI„Ê2'¦2†<ÇFØñXÔΓ–ÕUÁ]n Φ€Ò3_Rc$žõÄH¡Ž¼§ê–RW—¿aMÙâSQzKu+žÑu‹½âêwÌ xÊÔcÿÛ«««fNKaë˜ 4s9ç#ˆ¬FßþPP:PP2ëá ê…—qìžcfeÙ2ÔªaUë8ÅR%Puà3wà¡*8’á)2fC„͆lu‰[o Abpï—q/þyv¤ˆCñ§]õÉf•WÃÔÍŠ¼ó?U?Ïù?ÛK|r¤zÄoIeÏÞž],ÿ &ú¼ZÊ1°<‰_N$¤IŽÅ9Î'âÈfÅQ7‘˜ß¥}âPJÓ§ú$ÇöeûÉ9Û önºÜLƒÇ¶pΟ]½¹úAÛ¯÷ò¯¹u“aß#O©½0)(ͨ2NÐ-ú¶¿âÁIRƒç?I}ꈣ®Ž“ytyëææü~&”F(Æ- Õä¦Îв‡yZö¡â‘ŒD›IF‚0~6e{ŽÎ…r“1êÒÞ~½‰Þ“ÓûDAwãœz ¦>pê˜Â'Vû> JIÆÎ²aÓ þøîòÍÍ´×#äP0–sÊG jð¼ÉÓ‚1éD0Ö1j;ÁdÖ ÆzÁØ®×CäÕn›‹"å]ydYèèË üÌ8ë­_Qð)]²²ÑƒúÊi,wé­1žB¹uN‘LÌ Ñ•6eÆ&uY0¬[×PH5­kTà,ªD)ˆù8ÚqË´~ÏËO÷üœúÃ$®;ãþ ꌟgt{Ìú‹m·ÿ ðÅ‚ÖB{öPívÌŒOg°jã‘ÕºØMZ Vh„ÉïC¹G í ‡…*<º^m±k·õéÎ7„}“vÇ]q”¾¢´ð¹/a5}Ù¸ýL<~óÊæ&o¶h þatX‚.MåzÖë¢)±Rƒg®»“dâw(3ÍzºNtÀÏ| XÿpöSŠ9À\›\ZrÑÈ2µr¥å PZ]û+Ž~ æeMyt]di¹&3JºhùÀƒ ½ÆÜé>/ »€Ús"™8ïÃÔ#¢‰½R£1}\—åf¦1j쓹EÚ¡®’xĹϓÀE'aÀ»;Ötx©iûbÆ›ú´ÚqsPû»Ì« >ðtwwÖx8¶Þ­k³‰C9€…NUtA¥1¤(ã|üTï@gC¹ŠûTñ9P¥d$ßžMòŠ ë~åõ‘dòêfƒ?,”ÑØ$×q†áaïkY?±[\/¾¼Ì*î!ʤL iCPPË'j*˜u và‡°t kX¨B¬j†°ÂY«<ܵۙœºsj™É»lú¹)ì¹3)(zäàvoZsû\Q .ÆhMÐPýf¬ ©}ž£·„,Ö€$+t›n œM̼^°‹ú@a b& ‚Yjª©!GMCXxFåV0ëa=¦—xp³¡¸ôC™îPi ¡má=ö¸I.m" ˜êÉüuÉW“b*A£T³$>o´½…ηÕ!3Wx8G w-»Æ§¶$ÆÓVïx5f‡ØãŒ¹zzñ5·áaqò‹¹× –Gúßk ÿÃê Úk–ÒÝ vw‰¯]w;(|š™ß‚îß½8jÝu¬¦ŠÈ}†(ÄïÆ¿7­[CÀ³ÿçj€Åb·›Ò(O»JúÍ?_¾š®’Be}q™Å¦§“²½qì É(›Öá Q8yhœÌžOJpp.Ý{ØV|ï%ßâsÜÑÔ_¨*tý¤.)'"%hü¤ëÀ Éó¹êYZ <7³r‘MŠ=Ä2éfµ­{2a7+¤Œü,ÍlËbÿhÈèº:Ð/’²2 X‹ÖA(Aå3ytë³s0…ÞÇõ• 9×Q ¼¿U¬Ìsö‚AYÅœ¦½‡¤ ݯ(ãÝeáUè·ºpéà}~ײ?Ÿd•Yоÿòû‹«wW—o&]]mûEÓ0¡U‚îg^¦º:K¢- AÌ` Ã-»?Öm=o ÎN®'ÑÂV×`¦KSóˆwO-ê8,P»{RD]oÊàFjè½^ýup×ÚÃxÖ ß9w/9!þ?{éÿ·`‰wâ©¿³~ñ§4Êý©ûÑÚÒÕØû›ÿ–÷O 1íeH¡Sü© {XÝ]fô‡g–À endstream endobj 46 0 obj << /F1 10 0 R /F2 13 0 R /F3 17 0 R /F4 29 0 R /F5 33 0 R /F6 36 0 R /F7 40 0 R /F8 44 0 R >> endobj 26 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 46 0 R >> endobj 49 0 obj << /Filter[/FlateDecode] /Length 2813 >> stream xÚ½ZmoÛ8þ~¿Âå\ÌŠII]ìÙÛv‘EÑÚô‹¶›®µëH†¤´Íî¿ß _$JTlï½}DSÔÌp8óÌ ³ˆI/>/ôã§Å7Ï^²ENr¹¸Ù.âÅÊ üÝìÔr•¤qÔvMY}Æ1öeÛµfºh”™[/Y튲²/ÖuU©u§6æõ¾~\~ºùùÙˤçDÓœP ‘U»/«ßZ³d&$N튢ÚâÝÎr-+¤Û©Ïª ™¢Ñ3E‹ŸÅ1¡™e\΋FIâD#Ë•2úÛ2K"… +ÎI“ÅŠR’ ³Ãú^uå½B9ò4jÔV‹gQWÛçNµÊ ÝN`XØZN륞¼\®8å@²=,W,‹`åܘÚ?.3ŽòÉ$µÇ _©½ºWFy–x]õ"„4jªNc˜ÝýÕë7?¾˜ÕO6èÇñ·Ê¡DúºùÈDªöd˜$Q½5Ï¢šò1‘™ÏvÊ•å„÷Ó¨çS+ ‚ã±ðþXðtá%q†i”Òèu0âNZ3½­30çCŽš–fÈsúo0,ÏdØ~)ö¿˜dN‘רîXFU]­´Q<ì÷`Q ¥hÁ¤Éps¤YBrwekHøH#´N°5ô[ ~‹ûˆ…1xkõXãß´?¢_ qPÅËeÆ"­GVFŸÑØe¤*K¯¸Û+½•[C¨Û6̘ ‰tÆôËí»›·–8á‰]qWv†›ÙÈ©ºžveì:É2’0ß°•qÃ&D‰vxÜ’“Ü.Øi `BoþIM KN²äØñpBÝ®»BÚ•B¢:Ar@ЦÕ’D¨P˜…NæùàèOªQ2ß"ô:35jÒVšÉ“ZË’<±91·9ÃlÜjmÆkò”pæûÍî„ßXGex<;ã¨_–¹°/ê@Y|Ïm &9P“slJ‹‹ pk0[Õæy¯ŠÊ8¼ ‰&ŒÄÙqÝ1îŸÒ~R] LlÜÒòýR ™14ŸäMLlž~/ˆpÊØ×ºZ{#˜ûX*i_QÛÖˆjŽ–šº?E¯5y*Vj"Ž#VLå¡)#YGDùãôKp‘ÁÒ$Â*MáTG¡ {<(DÑçÛ<¬;c¾Vo”þCD棊³_ÍýÕ¦äÑãïô—ñ‰¯h,âè¢<ú ôõëŸÌgú„ŸZùPµåç M×îæ—»®@&ÑãQüó‹W¯`]œçÆ¿½u«@+ÿ4|MXV>{)át rÑÇ£ïùh¨öhdßÖfD×—f îì uƒ¬Ðå…¡|¹ï¨¸³4µ ⌼#ýî˜Ø&€ð~–G+‹™ÑC«,ðd¬°NDGA%'Yªi&…)åytÕ4Å2ŒTPY½9 ßCJQt%¸ °ë–i¡º}¨Öz¹ 4… wµu$ fcOmƒQlÑÕZ÷[]†ÎKÌ.¼cÀƒ¾°¦ o·eµù]½}{õ‹9Ë«Kó4&¡Í}}°see]gÝ(èv»/>\HÀ›9¨jT÷ÐèI¦“!x˜KíP\÷žt¶9‰‡˜„¥ÿ£x(½x"}Ý©°I“Âݺõ!Ì:aäΞpŸBÎíSØj]ÈÙ”*!±CE­ÿ0ÎöíêýS÷ÉÖAfÉÏÜ;vÝ ·Ó‰¤˜û¨ÅÞ™ =%±ô#)PÓ†*L0‘‘'Cò5˜“¡­iÈI›¢n-]¯gng’øìÉ|J íƒËþ@l‚3FX: "ÎUÇlÁÓKzl(üZv6C„¤›¤o¢ÊSäa$¨sã(ˆê°E:Žê¾c¯‚û5ä—ºÜøî½y;uÚÁC/¦yÖU£îk[Ød:ª'Ò&cðô52qà ŒMü?˜GÛ¦¾Ç‘°Gƒ"§bA6{Nšè; Ñà zßõÚtºClJgžQÝPXL‹éË¢£HЛïÓHÀé™UÁŒiAa&¸:¦¦µ¯‹ùÈÑ–W·.PTÝqÓº{(MÛš›þ%<ÚÃ^§Æ<óŽÐ4áy&mÔäéàZíô€)÷»ëÇ ¶1ä—ÏŸ%Ë˜ÂÆf,€sÏ*qG•u]J 0Ö¦jÚØ ¦³831Þx²þÎGk I½¸YÄP¢}]@¢ŸJ,6âÅý"$cæÇ~ñnñÃ7'`ô‘`+`ên+âÿXG^â/‰òwN§ŒõÓ¼¦Ÿf¬{ãÉ1«\ïUÑŒÍrƹw ‚ z¡;: ŸÞôx=IÏÜâd¨fŽ#ŠmHÚCK6¿ »ÛªO§1IóIÏqîÎ!³B¯ß‡ˆ’H"ŸDƒ$Oɽ@cª•‹‹1"Ô‡Û/j uìI`¸À3a‡AýƃÜ1Í58¤Ù\N•Ú ÀaÔY`fÊ4ãP&»“kí}†•ç|¤î¾EŸ,­Cö·*­›-ìÝ…ñp¼Õ¨6åZÙ÷36"½ëˆS6’k#@ õdXÕÛ‘Hžl£=Æ¢¿a1 Ô¸c%l`ÕþѼ { x£Ó_=™:q+‰¢^‰^4!Jyº½Zý é}ÿ}$bkå^&†à&KƒòžÎ•ò¡ìG`ÕŒ;-N/¡¡grõ‚‚i]týÜ© ‹£Ù˜—jö=´º2ª‚?ˆqs½¦c¼Á™:èœQˆþ¢!„öˆà›ðRÂo6÷váÀ}¤â>§ˆ?]bkÛd—A¸V…ùgü%§‰! ˆHQ­~«DŠÆ¤Íxÿ>ÿ¿Ê@'Õ»÷?¼{ñ—cÿJ`¯òð¹®ïX> endobj 48 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 50 0 R >> endobj 53 0 obj << /Filter[/FlateDecode] /Length 1433 >> stream xÚ¥XmoÛ6þ¾_áa@Ag#¾ˆ’R´Cš&C‡.:oÀP†,Ó±PU6$9]Vì¿ï¨#-Y²³¢û‘¼ãñ^ž{qF>õýÑý¨ùüLj²Sa¼½›ŸŒ¤Œ‡j°§zÒMøJ`Ö}  DçaE“D‚“zÌy4ñUD/õªBÝ“bÙW>’-ÎάÐUÿ©hä,I_Ó®w³#*:,þØ¿ÒÐÑf\ɾf“Üd}‰VÁ±pIö®…:â>ñüú'ù3W< _S Dâkð.‡O@–¨ß´Ad^Ë« ®X2±‹…%Cñ@,èþ}NcÙˆ˜®³ é)Hà1YZ‘x]¥­@móåÌU?Ñ-œÜ§A„ÞClàë -u™…ï:©Ö^,r›]¹Ñ#"›»­KjLoIûöš- ›š>›ªkÒ¤ÒÕÖ !¨Œº0`÷ß'oVƒâšêxv¤:Å”Ç]'*»OºÌR<@§ÃÂj©ïuiy7áÚ饉“ŠLÉ2~UÖðÐ —.p¯'ˆAA#é»j_ä:¦Ä¬­r&óÅã<{Hò¾QŠ·@‡jvÄ1,¢‚=éÑú 5gTÈ.Ü;žû¥Pd±ƒàJèªÅÆ.L•Lµ¦.›;¡õ™!¥›†ùÁüÑe# h@aUuiœÒ¬?gõziA…«,Õ˜ëÕŒ\ÝÝþqóëtB)=RÁçÐ&ÈF‰{ûÖ]ÀT¬(ìšmЈ°å˜ƒƒÒÂ0—&ù“˜Tá“®÷ÓŠï7ysà@Û'‹Ù¶¬[âo°=Ž7ˆ·êÁ­:·ÓmE0zA{çÊpýW[qh)WIªÑôÕ®HëlSTèN±è?‡´mSêxu‡!bÝ0^]¿}{†¥ºÛF›ˆšHt‚Ëwï.ÿDæËɰðYH…€Еµ«F2öúù*Oƒ·¾œPáöîõµ}$ÙšE@žUÙ?Uêe¶<ͶB.˜¼—Uö·FÎ/ðëãçÙ3ü~?ÔÛèu%žŸ!¯Î³OY‘Ô ØÌAÝt¥fUf ¨Ù`57’2Äeò°É––{W:ÕU•”–õáA—•ä S‰Ë³ó¡×K]ïÊé3Œw“•­}ÏÛØRA…I×ÎCéÖ{Y?nµ»üå¸Zƒ®æ¯ï~õöúb0»ôƒúd2¬Ú9¸Ÿ›ªí[GKH¯-'EÛgV㠦׌aÓß°Z(7Ѷ(ÁÛ^‡[c”} û™ðhÍ‚ÚÇD†:23ÄLuä0p‡?šéô|GjÛ»7·o¦Ç3 ³I‹ýn±3cµM…b—çs0Êî;á8šŒs 9’sOêŒ,0@&»¼þ?Š¢ß jgãoÑUÐU0Ó_;Úü3´°Í8I\úɾ˜@á/9³½è¦¥MáÓÉÞ=5K§féxáfévªûU„TÔã¤7js?9µƒoµy2øGÍPm‹Q%‹æ±ëéwÿ§‰4œ endstream endobj 54 0 obj << /F1 10 0 R /F2 13 0 R /F8 44 0 R /F7 40 0 R /F3 17 0 R /F5 33 0 R /F6 36 0 R >> endobj 52 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 54 0 R >> endobj 57 0 obj << /Filter[/FlateDecode] /Length 925 >> stream xÚ•VmÛ6 þ¾_á}9È·³Î–,¿`ë·­W¤ÈnÚ šÂpb%1š³Y¹C:ô¿OíÄq’¶û$Š"’)ÙŽO}ßY:vyãü<¹}`NJÓÈ™,ßñPüõ=™¸ 'µëñ(&Z6¥—•Ô+©Ü“··|ïsÊ™qÇùÆ»+žó5ÚÀCAôµ)„++—üRª£‰#ò ‰§óÚ?»,!Rµè.§•µJH%sÕæ—ôÑlûÈQõ¶*Êj‰¦ÈÙx¹*4ù$UÇSRÔU¢íAB“Vš [WQgºÎFÃÒyD£¶ò©ëz,æ$¯ ÔQ¡jžC Íò9DüØZÔ¨-êíl-©ë…,$£*;¾Àp)[Ë MþÔJ–—íP9 ‚†Î•–E{Pê•i Kæ8¨ž‡1’¯õ<¤BôzAú-2æŽ)ÇÐÈû4>»B|½•EDÑQæÓ4±v«a£Iاú_Ûƒ@Ð(EuÔ2Ìšë 3j,‚¼Âeßj»ûѺû}ÄQ¥Ñ¯Ü[µ®…½æbÁ%¸à m穽€ÄÔíuHÂ!ýäEŒ{ïNï6òØýþŸìÝãÑä%=ŸË!ƒ»"Àåê ׃ÁO¯ºÐe¥»&‹¦üdJ9϶’z«ª.Ø/¯Çãë©k|6Zý€Á½à˜3ï É~?W2×2[¬óeçuˆ pë_ì…yŸÍ»›5›u©³\©|Ô9t…Ü#@x1£Ï§ˆ8÷–°¯vèñ¯ñ¸Ëñ)ÿ(3ù´Ñ»}ô›½áèqrv Û|s4ƒ‹²*²Ù.R(°kÅy­æJÉ¢,ÎðŸ|cµá¥1½½nc"ѸçÖîùúöLwV¹ÂÓÙv±xÏ"ÿÃÅN¾›ü9z|Ób5ço/ÒÕlLT½˜ZЛ~&fl~üûá7C¶™f­nWñLØføTò%Ã\0À|/ô­9ê[óûvb¡¤Ü§c¿©ÇÞÉýýŒmäÄ4ñ×À<¹Ì, Ûß©•ýš˜¯À>ç))$nQ-ȶ¯ÕT¸ò~šh(Ì;nþ<8·Àö‘w^O¾û6± endstream endobj 58 0 obj << /F2 13 0 R /F3 17 0 R /F5 33 0 R /F6 36 0 R >> endobj 56 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 58 0 R >> endobj 61 0 obj << /Filter[/FlateDecode] /Length 1023 >> stream xÚ­VmoÛ6þ¾_¡}èÌ¢%J”,)!ÍЭè€ÎÃ04E@Û´%D•‰Nýï#y¤ÞݵÃ>éDŸ{îUçxØóœ££?;?mV7ÄIp9›ƒã9.ˆ×ïÑŸ)/.‰=ô´ 1â ¹A”æ™ê/>:œŠÈÊbñaóËê&h1}âu"¡è!+öwÛç»ì‘å ØŽ©Ñ[JÌ5±àj8«w ¡T¾G JYV·ê8PõQÍ÷§ß÷)ú(×OTÞŸ*8ÈŒc ^%Xjn°mn,n•µg°&õå}Á¼V¤×_Ç8 åÓÇ Õ„”"–Ÿ8·h?¦~‚C_«¥c§)¦ñYÓ\£ŒŒAPé)õÕfE˜‚WT{µùîÆX endstream endobj 62 0 obj << /F2 13 0 R /F3 17 0 R /F5 33 0 R /F6 36 0 R >> endobj 60 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 62 0 R >> endobj 65 0 obj << /Filter[/FlateDecode] /Length 1116 >> stream xÚVmoÛ6þ¾_áõà §#Qo†Èš¦ð–:@ëaØâ@ %Ú"ªÈ†$'õ¶þ÷y¤"K^Rôߎ÷Ÿ{Cg´©áýè—ùÙÅ$GóÕÈÙ8½¼µþÈy9¶=êYL¾UsV¥cY9n/å|sQÊEÃ׼‡qX¬Øq\®˜(êS9­Giª÷s&c:1;Íщ§òèó°n*Q®Ñ´‡ÕzØTO›bo Ê¬àxÔäz’²ZÏDYóª›r|7ÿUáº$öÏ®¼–+×#‘†Òââö•K½WwhóħÇ×6¬A–hRj±º2ñI8iQd€á¹Ä3dlû¾cÍsQ÷ijÁBs-cSò”×5«L*W:ë/µ6eÑ;’ôõâ¤î„¸¡ ôÏäÓüã PŸ±¶XŠ·ò†(æmŸF$˜tù¿:ô&–¸ßŽmæjê ÷åndm¤C܋ЯC¨L[±¢¦0 n›ÃÙÍå»úHÐQ -Ö\»J+9Ìpñ(š±n€}@ÙÎ ‰ÉTýÀŠ>õ 5Õ½Û1q'/ñ±áó'’VYu ‰¥¢Ž§l§¯¨áeç=Fú`í“IŒ ÀV°‘y÷¤Rõd£¼e¼Æ5+%÷Lë^íl”Išî*m$š4yPz5ƒ‚í3Q21‰Y‰2K–ûäe!}JÁà=´)äWJ‰:Ä•MÞwç áKù¤=ÎÛ:ò<“_ÕnàH´äð 5áëÚ‘TJÑï_á¡1 Ç Y?h ìG‘IãØvÃÐZÐÐïSsdáwêDÐÊÖ…}Þì·\.ë'P4‹1®þQ¹vÆ]g'èBƈ†²›ÊQ±“ã|¹×{š9?96Î4gú[îV«[„whüóÐb›ÎÞ£õ‰JõÐÕXoµY-”ÓS¼1Í“«óS¼$àºyè(ãÝ·Þ  è:A|túÌÝíÁÅ®4u /WzŠùOV[ëŠg›gü?åð¤kù”®ƒŒ7lYè,ëˆÖåï×ÉõtöÛ‰¹ jØ6UÒîxBR¿CYUœ·´Ô-¥þóaÿ¸5°ovUiÂRíµ ÉDs Ã#Ñð¢æˆXÒg‡Ýt}˜¶¿>\\_ß¼ÕAͲ²µÏbYh©Ë¡Xìó”1µØúx›Ìn¦³éüdðú5¤¯ë4Ÿ·)-Ľh^ÐG¶Ù@èôIÎê> endobj 64 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 66 0 R >> endobj 69 0 obj << /Filter[/FlateDecode] /Length 1232 >> stream xÚ­ÛnÛ6ô}_¡¾rf1º_´@†4EÚ"RCQmÉ‘ERD:YPôßKò”dY^:ìÁÐ!ÏýêCÃF¶mÜâóÞøcqzé JBc±5lÃðâ«ù9ÃífæFf^T·3Ë‹#sÍÏÚÊûØ|œ¾‰Ë]¨‚Àu†I‘µ¯gãÍ6xG²Ù·Å‡ÓKOkuù.SÎÕžÿýðn‚@¢qÛba]¸Í@A›á²|¸o&¤fºcsS`ZÔA3+´cój xšK 9Tþ¥5X,}©jÊÍ2,×±Q–ã $&å ÇÓÁE¶¹ç£o#?T.~Y}^Üì{éù(Ž$ź  ‰dtΡ€Ë¬8ä˜O\Ôt@w T›ºêP-í XÆ!†cºÃ%\ä˜äQ¼.%óSAsiž4‘×yõ¸B^§u•Aè¢y^?rºžUö$ÏÌÑTà}s[·£eÀv»e@L›=Un€‰Ž×#K]äDñۛŽ"Ûü1cï g£çÇ8!mFwm¥"8ÑA/¹ÈJ"¤Ë`Ãê®›f½êähœ˜.¯¬£6÷¤§Øœý”€7òû¹0 xÂvUú¢ ð $ª!‚KëôYä´ÿúâߪ­«áÕwu=…zQŽ…”÷ÊÀˆ4+3ªTÖr2Ü×òŠÖ¿nÖ m×ê2ªÍàò@OëÂ;äD¿T¦JÈõôBûf0Ü›îá€ÁS& `ñ?ÌÁƒ”þÈâ£-ØLµ\/.§—¡›žØýPÂÇ€¯WœL¬¶üCj€< ÞHÀñ× 0,å˜7ƒ¸ 1ÒFºJì"‡%˜-D|î%0÷Ø®“=†¤€¢‚¯ëâÑ®j §üø—·Tö`Û¡xP2‡=;Ͷ†/ÏÈš¶¦ìyÃwñF?zÄZ;ž¯‘‡üc{­d¯õíµNäî½^¶ØŠvØTOä‰-˜ÄæóÙ±:§êÀQéwUAª b,ßf Ö%ÒAºl‚µ”ÙËúÿ.–ÞߣÇÓ{§Fªb"¡ëÝâ·Ÿ…Õó endstream endobj 70 0 obj << /F2 13 0 R /F3 17 0 R /F5 33 0 R /F6 36 0 R >> endobj 68 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 70 0 R >> endobj 73 0 obj << /Filter[/FlateDecode] /Length 1451 >> stream xÚµWmoÛ6þ¾_a`@!Ç£÷t)àµMáÍu†ÖÝÐÅ@Kt,D‘ ‰Nâ½ü÷u¤,[¶¾ðõŽÇãÝsz1ŒÞ]¯n>ô~ž^\Y½„^oºè=»ïn´ëœõo§¿\\ÙͲeІMby”s\ÞJ› åêcßu5š­Y_·-KK+Ñ:ZÉ*V>ö-_c ®ðB´¶V- 1ý„#¾¤\õ:V˜NH_”>ÒlßË!¦2sf¹>ËT†f@›‹³¤iBúºãÚt©ÖŸÄrQÞËἯ ‹cº®ºÆ¸ -yXñ"í›c;Ä“JÆ×e^áÕ)j3tÈõtǰHèötÓM}żs¨IGðç}ÝËÑí¾aHlWÊ\t›E8 žÖ‡Ö'žSïYî+p‰«œšÁ£YƒëuÛ¶µ¸È+Nk§òê\ÌYZÂâž6Ü-OpÛª,xÁÅ®Í ] ;\Ãкoé[$PÁ”ž0e°/éßmÞÞsö]74‰´ýû#˜šB°×î›\O£á$ý>y/¦\m¦)ëæ¬ß×MÃ5´‹3\\WkšeÏŽÏ.ðx¬ïÖLJ"\tÓ!A}øg&R¤Ž€ªÀžŸcÇ¢²ãÎeÇÇŽ«…jÉt¶=%gºs©³ö¼˜ñæõ›‹7-uqð°‹ áÍpˆÓârL*€D“,Ú ¡Ó%¦ûbØÄ%£œa,Plrö¤‚c*‘ë‹¢ìD=d†£Â¾:”÷nƒ?Á¼Q1ЀGô¼#ñayÄl‡Çßµãà†^Øž^a¼\âKÿùq8_¿iÃÉõ»÷"JÄìëÆç[1ýMmz[XMì xÍEõ7%[DqÎ<¬8ÝW| ˜K.÷%—‡Mjb–e„oVlGêm4¹MFÓ£’é÷Ï´Á`žHÿb¸÷ 60—¥)WÜú>hû$)ÖóŒEP¢%­–§0ßoý^7*Gã%Íïj¬A½÷ûtÓÞý4OØs;w¯PËãò¥Â‡w_†ãh<šüz¦,€‹¬xyÜyò¼£cëïW‚å­îª8+YRìè0Û{õ–ÓPàßí|Ø™?‰Q߀¾‚‰naÙ È-`›áh kF¹Á!½ttma&f-M’¨âešßE´ªŠ8¥<…ÂÓa!ÀR,Up"št†‡Üç Ó0¦a¸‡˜FD”š†_£ÏÓOj»£vÌSŽ'Ôn6/¤êŠqÁ1lWû£ØÊ¨šHCöXÉÔ-EÉd]×X˜Ž/h…ñív>¨˜À ×ȱW_šf÷p³¬Ù€Á‚<³;VbÉÎÒŠWr7ÖlG[­9Î0 }Ë'Ögª'ªÑ¯Ë@×Ô{y þ Ÿ§Äé]bb9ÀHÌo%&‹uc ψ;l!$fp‚f8'h†sŠfø1üvšAâiŒð÷X¤ &둘,ûôiøUB€J'ýT¥-À€(|„A<ù2+”z ÷,b+¾i ô¼ÙÑ~¢Ž±¬’Ø£L”PÚÂ̓€È%úDð'ã6~‡gŒ@\^½¤+1w\T áóõbqc¹Þí •Í=áøÏ¿GSåQÈýGÈù¨Ze)hYÒøwè²ø.õØÕLK/×JÃ:¯Ò»œ%J^>ÃO—»ÕHîOƒn…>ÁŽj›oÒ[Ï—´§e*n¿BÝÎ1ÝÕ ò…/fõ«È¿žÑd]}œÊè•\è„Ñ0à¢"èG“¨ú4‹ëP&*z¦4¿@•ö\¤üüJpKª“{QªÑ¿:nÎî>pÝþ‘G8ÃμךßMÈv:üsÙ†—ÿ‹¯ø§rÕ_’¿ý]š7¿KiLëw‰~ïߥV9´Mâ¸Êêúg¥>ëýô‡ÿ¶©a– endstream endobj 74 0 obj << /F2 13 0 R /F3 17 0 R /F5 33 0 R /F6 36 0 R >> endobj 72 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 74 0 R >> endobj 77 0 obj << /Filter[/FlateDecode] /Length 1676 >> stream xÚµÛnÛ6ô}_aô!3›‘(ê¶ ÜÆ)²e º¶80d‰Ž…:’!ÉI³¡ÿ¾CRר]»í‰Gäá¹ßÄILsp?ËûÁÛÙɹ3Hàf«9#xvk¬‡w³ŸOÎiuèÇ q¶É†cêQ¸ŽmÛ6¢,-Ê0RÏ(‹‘Ø£FÌW…€˜¦1¢mó¬ÌJõ¼žÁÃ1M#‘Y-‰åQâŠ]r@”»7=â9êlN]†Çvu<¶<‹x>¬ ‰¢—I’Pfž"eR&è Â8ŰÀ¦È²¢4T€³T€‡€cøúÈb5¤ïYÎRÑ”V;î’Y„÷,ª•š­“Ï#á¬üŸ¸í»‚+IªD¢!A¥¬fD€Zž'iÚ„’!ŽÆ$ÏámÏpÕ§Æßð’“®Ÿ,¼¡½8[s þ™G;aLüÌV¸–xΤ?øÇp!M¯¦ÉhíýXòE¿B¡>¡®Â˜teòóÔÙm—6%ž¾Ç?oóž:qôÝ»‘ ýœƒ´~„j/ÜlP•2ëÅŸmúÄnÅ_¶|^ **¼0'# ÅwÓËK„Ž£í|ØË¥ÄRb˜íƒ?¶2CyCƒ,–gH{Êv@3Å–+|ёע& ´ }¹C\},LBÍš²@2è€~žíJv‚}Ï6#¶Vd•¤ñbù¼(¡ÈtxºÑ,³¼g`æøBâ†5­ä%Z´®`<‡QcFÂ2kÓu0<]WhU½\ÏXíÒH<ÙðPà?…Á ¼•”ê0çå.O~ÊZ°ãŠrZQF`•gôø©9‡ ¯Ø$…>ÊqMÄ–0»Ç€S¡œÂ= :|ó<ômC¦Ð`ŒšJ³`…—„Y2óR„’R­®” Ä{¨.T[ZbfQ)që\ˆVuAŠ™Þ‹ÂBAOkž÷“7° ó¿3{½¯d¯Îî»¶š™R_fÄ“ðc† ùECc¢l‘{2ê…,”‹“[‹Þu¹Ú&¡:¾„ÁûÑjŸ6£urûÊ¢¯ú„dwQ QÕŒS.—O2übl¾K™ÚºÜ†IŠe@•Ù^Ž;ÄÖZ¼”p”jïW,kkË'_¹>§ŽÇ7qѬýL×~[¥ _( ¬*éW×gÓãž}¬ZÒ  ¿ù¢MC÷'_oŒiž¯Âˆ£A)/–e—CàúŒ+KÌV1Ó ëô ™äX9Þî&zJ¨ˆéÎÂêÎÇ5Äú«KÛ©ý n‡[lP§}IZ"RÎc=\½„¶B,è€ã7Eò'GÌׯq5A: è‚Ú#ƒ OI­çF´¿)Ÿ·¯±†­Þ‹ÅH6ÙÅÙõÇ·—Süúée•÷X"ÎvË GFJC%¶#)±Oí m¤ÂRWãE™-.æF¬5AÛÚhs%Ä|Ø ¤)é™ÁiµõjF:” jÂ’ÉÙ¬*:GîyŽÒlnðY ý•¿ m,³?è»aV;sáO‡´ª#ß\{T*wrŒë=/µD8½#üˆ’ÉêdO(¬Ã1–»Õê–ºæÝ^¯}˜Ý\\½WôŠCþ-¶ D¹šK¢£¦`sãÝõÕoç¿ÎæCø2ÕÎÚÜÝIùÓeA/ÞUSæ¶u³9_Í«IS|)ðêzñîf:™MÕ÷‘Lß V9ç•0’l wÜ3ø—=åæKŸö¦ìOèöÓÞ-·—ÉW×W³ƒ™Œæ`‡Íq”î6›Eí›o¶ÉA¹Uíà«p·)ÿ½°:ªD!ÿvyÝ=òb[=ìº …[M¼“9È•pŽl¥ª˜#• ²U7qì=”ºg'—‹Ë‹«_Zªr\…û¼Æ9Ö"BŸÙ–ù^ßI"·!ðu•vGÕÍõCX|º# \ú©ÅI\hìžv ^‹ÇK•—ébØû ˆeÿÃ1KOˆP•A¤Mt5~Èꟕ.þõt-û¿z¶xØP¿gÒ‡²”ŠU¢ü$ë|Ô›sX=}÷˼s´Õú9iUiÓ^EiY2â©1‡$ÈžçÆ‘¸!¶Üøãüf:m†ì÷»*æQŽ/>üCt”c^ý’¥G›)fG[Ö2ãþc˜0Î^ÛQ`ÀV·Þß÷dåí{²²õ•eUÏQvùúÕÊ ÂÎÃ5ÃÿúaªìP˜D µEÈ Âä5ýð7–ç3 endstream endobj 78 0 obj << /F5 33 0 R /F2 13 0 R /F3 17 0 R /F6 36 0 R /F1 10 0 R /F7 40 0 R /F8 44 0 R >> endobj 76 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 78 0 R >> endobj 81 0 obj << /Filter[/FlateDecode] /Length 1518 >> stream xÚÍÛnÛ6ô}_á½drP)­‹….¼Öm³î:+º¦‰¶ˆÊ’KÉÎÒ¢ÿ>’‡ÔÍv—íÐ'’‡‡çÆs#¶eÛƒå@Ï¿ÍOžyƒÐ ýÁ|1°&LŸ¾3Òáûùï'ÏP½éYÞˆcˆ½„d¤"Cs47Cw0§¹XTdI˜ c;ô\gKœ'€ÈHµaùÐôlÛpl ¬9?´\Å‹MÇŒk什6ªÑLÇó,Ûá£c…žÄþ,pŽgùaLœrkcbžUwk"–žqz ãämôú‹óùõŽÛ–ëÁq¿EÕ³Ðh—¨Ç‰Ò-Î`~vêÀäèÆfë×Ó=¯8'àlž•ôQŒ‘m…¨Í".ò-aUT®3ZE˜1|UETᛌp]€Šk<–§Íã$+•¦µÁùü1 'Ç} ó¢R …Ép¾TŽO€Gß_Ü2ÀñDSJ/hžD7w‘`ÆÔ°VÓÙ«èÉåt2Ÿªõ# M´™@A»}'Í•âµFûÜÕŒ‘U±Uò/X±‚Y•6 \)\,z{4£eÕÑ\øÔ¸­áÓ«ÉEtq>{©Ðä¥(¿Ò7]ã·.|]±=ZQIäݵ±ÉKºÌIm¼6Ïš‹:ªi¥+\~xoqqóÞò@}ܱ×}±^Çߢv¡åèDP ‘zg‘+\D.!Þyà"e4y¤ãUˆT±¢±Aú îÇŽ¢Àý¨GßYÁXí­ÊÔS)V¥º9™Ynúj¾5®…ÛÉ'ÈænÜ @’eQBÊŠwׯ‘°ª}Å/ÿzv9¶òá¦OHÌ Era¤ª/¬XãP!ª,Ò'å:–§-åØÉN– ,Ç;h qîn¨w¤oÒJ„vrï í+ €tyÊÕ6›§ÒQx­ˆ‹¡‰B®9,ì›’$ ’ÃÞX}u¹dh$( ’Ó­ð/’Cá©Òb³LÁAn‡È7TAZ]’°\ž¹À—MuCFI0‹Åá”æK]Д÷Ó‰´Њr†¢*̬,4IS:½Ä* äjï’lKcb‚:¬ÄÖ>w îSµÉîW#©Hö¿Y$#Éî="ݧGó˜>Ð ˆpŠ7õco÷0™½z:…3ÇkUŸŽ?vÒ­}0£ëLçyü»W#ö¥úôPª?Ȧ[n¡Œfï­²Wºéê6¥¢•PÇ®«G¯¤vµ]w‰ugï#7i›£ö¤Žæ>j^Ý£šWÞ!Ý万´¾/¡#$z=¿<Ÿ=ï»ÆÿÝxOüâœþxqNÛqïĹky~;ÎýqŒ÷öç:ΛîI;ùìÕ<šÌ¢ó?'WÓ.ÐÿüIô«~ÿ=R}x  û"—> ÜÐÒ°¼Ie³âÛðÙÓñ™#ß'‚aHq™Â†zt`Šu ÐÙÃLFì­àê£1Nb)ÇSA¾!"Èy`ÉÞ…ÃÛ½ ?Út,œÀš×È jÆ\†B‰›2i[ Ó:hQmÕÚ½¼'Æ|d¢ÓB¶hÑÉ9FRä¿Tz cÅ­/$Fu3ãM©ð‹ ƒÉrCʦòVh±"EÕ(›Áb“%À¸Ñ”ïá%0pYiú %])È¢`@~U”;mú(t›.{òæåNn7m<^óg~Œ+Zä%Êtyî´;]ø ùpº•i’1{$\Щ[4¶¥©Ð‰„&k³JÙlÊ‘1,vï`Éï±'¼ø_i„Í®..ú ŒBËÕ©ÿVú°à+ï_LÀ‡ùeÆ-†’ðajÆóP,tK_Ú®F,Ѥ¸1d˜-ÜLÒ•Ž ‘ÊÚÑ~^ƒðú–âDÿ_I©ˆjÄãbµŸ[ÒyqŠ3Þõ“d÷¯«ÜÄ1w0ºÕ¾ÊKšü«oïAÅ»yó~ó…÷}ó®¦!-ÁÞ\mššuçÍ®‹—ü¥’v«¿¨êWð7Oª0Â[©Ó8µÚ43ù¢IÃH™ÎúÜB endstream endobj 82 0 obj << /F5 33 0 R /F2 13 0 R /F3 17 0 R /F6 36 0 R >> endobj 80 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 82 0 R >> endobj 85 0 obj << /Filter[/FlateDecode] /Length 1481 >> stream xÚÕWßoÛ6~ß_áG9‰‘) ] ¸]:tK·"1Öuu`(¶ls“-E–“fCÿ÷ñx¤$KvVtÞtÉãýøî»ÓÀ#ž7XôãûÁËñùk:ˆI,ãÅÀ¸(~÷Ññ‰O†.¥Aì¼ÜÉl.7Ë¡ÐÐI6ø•e2ô©ó¯ÂyÕ ®‹LVdx3þáü5«uÓ(""TW€òÑÐõs¶r]d)Êy1tYä¤eRÉ|ß|Gnq­Êñ}V¦Ieö'fOf°Ì€Ïh†>´JÑ¿¶1ðØÚðþÇž1ñÍjQʵ¬äýlêêq.*<$æzÿœîêc‚ÐÀ(TÁ\8ce•x3˵¿sóZ­’ %ˆC¨â°ÈËõ¶{3¥ ¹QyðNß#TX'vÕÖª7÷2¥æ£„Lz~³¸ÌòÛ$Cùv7a\¤eÏ“µ-˜Þî‹®œ·]ç-ד,ëª bØPAJ§°CEÚ„·åÉ|âŒÎ†.gJÕ¦š »w N˜ÕµÎ˜Få6ãÞ!`œP‹M¥²]B#³œfé:Ý€Rˆ-Så±(óuW¡`D|AÚ )Œ÷rM|^L÷(a~^pk¼’ÆA|RÌ+ù&{Ä¥‡!NÑ0 Œô³)#xÍF…þf Ù3Pø$°X}˜^¿»|3îªjE/À"µè²öm9Ï Uð6 éJ„½«¾ãÜ:.1 ªT’°‚ÏœÅn3þP7pÏs(MºÊ©G›ÔÈÚ-rN»'CÚµ A¨§Ø…¶±zŸË9â!ØÕÀ¦œˆ¸½wtu5ú€›¸a‹×ŽÙVþ™N«èÕ†®š¿kuqy‰‡Ofi–AxwžáãüŸÛ*/“eŠ/Š~P}¤„¨+oðõä¼mï'kÕÔS@²ºåfž~²"ð9HÚ”{Š»8¨ïx ³,Õí@ajWàSc„ô“ÜVºyù~°×-|h"sü^”i‘”æˆÕ•®‹ êÅlFºÅš ŽÊz0c‘B}¸³VX¬PØÎo•ÀyŽñ˜è¤¨LcÜEUÚàöR –! {€Éšý_Y¹èšê?Á”1ñ¨eÊO³4÷Z˜Ï›:z;úõ0k!ñ,³œaÌ¡xPÒ„«ÓÖ"÷RÕ¤—ƒø`ö«¼Û|šƒÉü÷ݶêw4A=î“„µ…ÒÛ¡„MÃí'Ú§Þ~ÿRu5qäsï™Ä\}[çÊT£<=µ9oŠ9j«À²‘7¤z,LµšŒ¿š¾}y=¾úé(Lê£5–ÌɦI©Õöq·u=BõóêùŒÎ E”qˆŒ¨ÂÀp'²ùu %ÆUfÛ%ÿö …Ø ÔO¬á7îÐ81u.•À¼„Ôþ1úl‚°®ç«XÏWðŠŸ¹³Û¦FL?ZKzÃªÒ £"úû~¥ú}w’Œ ZÑ{£ £fÆ9ëM _40´ÊÀ~nEÂÙä€õ(tnå…t“ï–+”õüEÎ*Ïæfõ~¨‡ÌÇj…ܨtèŒÀnMJ8P]¡®.µYßsPäTøEíæx¯5† £Þ¼<Í狀L»œBPÔL7\ýeèáæýýù ýCóWìh;$sJ{цÍ `Œá“\gÏ.Ó m’Òƒ¿´²§VÄ-ºÑõX[¨­KozW1ŸDÖ믭MŠ=v©Vv¸‚¸›¬èÿ‘÷ƒš÷ýãÈTmºÇûÁ¿àýðiÞç5ï»TˆÃc!‹=àŠV’Tp5õOŽSG¿ìQ­Þ3ýù3ҨܖֱNÐQqwtcO]kB±Jê)Å; FصŽ68víÃJf©–õ)ãàÐ'λñ•½·PCÖ=ü Ñr·w´Ø²÷stç¾Èäæ½¿½¾º¸˜8wö¶CA<==Ö›[=¸ãÚ¦úçÐU7ÿŠf«~ÈzÍ–±$êQýc¹i«.Æßü UŸ¸ endstream endobj 86 0 obj << /F1 10 0 R /F2 13 0 R /F3 17 0 R /F5 33 0 R /F6 36 0 R >> endobj 84 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 86 0 R >> endobj 89 0 obj << /Filter[/FlateDecode] /Length 686 >> stream xÚuTQo›0~߯`/“ikc‚ºVê¶vêÔ‡I‹4McŠhâ$Ö JÓuûí³9C´Ow>¾ûîóÙŽG<ÏY9ùì|˜žß2'"‘p¦KÇs0¸Ÿ~¢»¥‹¹ç¡z-ÁIÊ2qYˆöî¯é—ó[¿;„†ú¬9u ›‡”aÌî©Ê&S©ªû©…Ný(BI¶€øƒZ#³|»ZŸBDw†Ž„3¥ÜVª>Ó Q®¡åNUr Ϥ\Øt¹å¦Úc4OjyD4“;€cÝ ƒ'~ä`JI4ÍÔ™pD4žsô½aêûþ¡´ö…š˜‡vàC,_å¦Zï€[M?ÞÜßWCÍYD¸°€e^öjðVõ&r ì£3cGDË|k.¸Û¬Ëd±„7½MkU¤²£ÛXN€TБÂt8˜1„ ±õµîÊ·¤ç©L²A嵄ÒòQUµÊVÃ`Ù.JY$e+ofnŠº³ƒ¼Ÿ†ëé ,ÒgA¼vÊ•‹©QÌÞf!%bÒ ¥5 G1ºÆWõ¾f ·—`¯̾}½¿›ÂêùÙFñUª6†ŸY½£mV©U&± ‘yV·îŸf2i@Äh0÷3£h© ˜£‹ìõýŠ]¾V1F­ÕµÁ}×F*õ$g¡~ë‚ág£/s(êòˆÁÓÆ<˜yÜñ;1UòeÜÌ~쾘M´ÙZ¹»tÇjÃ!<íLõ?2о"º~u1R—ÞE{óCÕѽj¢¦© »wzªa&/óHDûÍešÎ²ªË|#à$v²uZ«c]°/ˆux~+œD!¼O=ÂL›0(6]›Û8š›)B KHÿ¸ ÉÀRšÑoÄ&ÆÃ\? Ÿ5™)kHÝLßü/g¢Ü endstream endobj 90 0 obj << /F2 13 0 R /F3 17 0 R /F5 33 0 R /F6 36 0 R >> endobj 88 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 90 0 R >> endobj 93 0 obj << /Filter[/FlateDecode] /Length 1458 >> stream xÚÝXmoÛ6þ¾_a`@!'6+J¢^Ö¥€—&EZ/RC[,Ó¶PÙr$%©;ô¿ïÈ#e½Ø.ºý°OæËÝÃãÝñôœ{&1ÍÞ¢'^öþ˜<½¤½€no2!_|4lâþR'0FyõmÓØö‡–gç)rÒÿ4yõôÒªt©I £!”'K²¶gÌï×q™dk”¶+iææ+áà··±@ ÑÍÍè}È,Ç…ýî!. ¥¬å}Ë7x^í3lŸP-;j#yÄU[e†¦–l»w4xË"®¶wôþöúÝxÜF„ã­gÔ7æ9çâGiŠkE™åÑBÑÚ>8šöÀÑ$`R÷¾à l;Ž1•uLq‰º–O\¦öø—˜oJDšg9Êeçj®MW”ù}\¢ûeXÚø®K¨§„“²àé’Äñ\ˆxR¨³tÈålÁKµƒô͵ >wGÀL,Ø:¦%ÿR¿²ËŒÐ RüqÉ•b¤EjƽI=q­93Íd<ál·lÛ¶À×9nÔ¬†õ…Pƒ¬*pšÝ—j0Gé"Î6(¡àD¼Å 4,i,Èð/<¾ßA¢ª½/V`ŠP!ýûu'ëbÒ*BQÉW½4h#9 i+ÉOyÉÕSjC:”øZP=eVmÓ$–~ô‰eI™e€¦õ²|ÅÒVåMð3MƒÚQû Q.\K#ìA×/÷´­éOï…–ë´]0¤`º~óâ…N6;¹Û#Žõ6™£,Ø5|^n7%ÏΔ…ïoßþ5¾šˆìóq~ýPxè¡¶IišÏðW­þ®ð†Ï‹ä+×{§§Ê–I«Žó4½q¨ Ù6ëÎ/Æã“°ú›2?MÐGÝhØQÿ** ¼ˆª³Ód•”Ê'ø#¬Éæˆöõ5lçžßºäi¡²]ÉÚ®|²óääæ;~|ñn4¾_]¿V6–Ñ4å ·†;™ †·<˜œ3°J%­¯CtVÁ-WQñ¹¤–ÕÔÜàý•º´ùcò‰i²þ|ЪÇe’B„6:’°ïØ WŸ©½;H­'b¤DJˆ\]¿ ¥ôC”6óÈ<œO@A¬QøpysqÈ­Üì\éÛÑõ†ÉûÒ8¬t _¨ÀUZü`³Íâ«ëÉÿ,‹ÝcYœüô,>~âOLK÷P¶ü´´\ñUÁK€ íæ YµOF{a»÷zzéÂ<ððSàׂ3"o¹  >Ôi‘áÈžp襑ù¸Æ DJQ21XfDª{X¢kÀÆDÒTØÅ €%á—™fßLqTdEŠ!5%øÒAƒÓÒ9PI¡ßf®…æˆìôm Í °#ž‚u[¨À"vÕ±Hf ü s|hr.>¸æQ0ÞH°f½çháL ÈÅÀà« ö4 èKB*~ö=tÔýNããV½z\ÐvBë©û2ͦ‚‚[ß°çkþ Ö#S|ZxÁ´EGˆ6ª\f÷‹¥˜‚MoQ<-X’Üj×ÓLÁ.#Õ4ŠÛJDÀHÔ¦ìG¤/\Ü ŒXH.£õBIO±Ýã]ê© ŠnÂ/ðL‘¨­Øûñt¯÷+H&k^tú—øº5¡ö´Ãò½]ö$GlÜGòÙQ’ï@o×½«,Äò´æ·’Þc…ªDMf‚¼âZ_W³ŽÆã7ça­ïeØ#„ý9ÐÅmÏ®¬vGÊ™¨œíj×´U°ìf½bÿ¹^ÑY§²X–üsbÈ(q|,yØÅä—dœ‰# endstream endobj 94 0 obj << /F1 10 0 R /F2 13 0 R /F3 17 0 R /F5 33 0 R /F6 36 0 R >> endobj 92 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 94 0 R >> endobj 97 0 obj << /Filter[/FlateDecode] /Length 1301 >> stream xÚÅWmoÛ6þ¾_a`_ä4fDêÅxhÞÖ4u[1omÓ¶PY2$9i2ì¿ïŽGúEJÓX:ˆNäÝñž»{ŽrÏe®Û[ôôã¼÷Szr&z KÂ^:ï¹½‰o~w.d½ìD˜8œäª9r²ÈHZ¨†„iYÔMµ™6jF “¾²…;ˆœ»¾ˆUÕYY°þÀÂI—™q¹”ë5H°_˜•¬ gƒ¦÷ø¯$oZ–èë¡ÞúQ¤<ßÓü÷ÿH>9󶘼Øg‚4µ’ÕX­ÖÍÃX£"å]F{À9Kmrˆ ÁcáH 1öôeáârUIÔ6¯åœ´HQFŽjÈ}—ñØ8ü0¾~uÕŽËK˜/ŒJS’ÓÃÌ™¤S× OE„:M±I,j0›¢™P<mØXó¬&>ÕYcÊ™3£#é•*Xš‚a¦ä1JX¸ŸN<Ɖ#è1SªVY½ƒï¶w<ð¡ÅEÝaRGÞt³'àÊÌm:¼I/¯ÏÇoÛ9ŒO/ÚH¸+˜›,÷ËlŠÇ¢GÕžT3rY-TÝЋÜke¹Ð¾ŒÛºöM3¡ÓzWw÷×x‘•±¹Ïò<+F·´ÏNlŒŠé¼yY)Ó&„h¯OTk?7y<Ü5µ—8¿.U‡îœG,°¹~ÔàºlŠ|£¢>M•šÕ©° Þy¡i¹ñ9‹=£sŒÑ%»0)q:rÓ5°¸¨JLØ}M;H/|š–…mûÀê¬ÜLò.þUZüÕ)ž¨ÚTó £Ù¿0`<0:ºã== ’*U+M«ÜòÆ,²¦_ÙÑad\¶R‚ˆ…bïr%ë¯xÛO ˜H¶$×›ÁÞp÷8@6á2?Ñ:ËŽØ’æzÎ:S™Þ}×XoOÿç5¥@3R[WeSÒ@64×u¸/Ûñ(b±…=Ë«¶e´KïH„~g¬ð(dQ¸?W¾‡XaPA,ÂoOJ˜B`èõˆëœ¡Vàˆ?Ã?&yµÁ‚ÒRÞ)’€¿+«Y 8‰G'ºÝýN<8û©vðÆ_0ÕU7åX·ëÈù4êÓ¡#ý¯¯ø¨ôÄ  ø¼k‰Œ9õÌ­S\è—a–4Õ±=Ï®åª ß'g!T%‰(ýP AW“BþpN^—$ñé1 B!˜!"!pb»•XûÖŒãR·®„¶…),LúÒÂý)v4^ZôJ˳©•q 'F$d‡=è3f.ÿ×¼±f[Lڮ〉a|Ìñƒ¯ p×¥®ø]™ÍLo·¾ GŽÎ"ÜÌáÁ4¼¹~ ã!Yw»*+RiÖ†'¶¡,¯à#ïò:%¹¬¶k·éÍ…þjÇEÔÆ dlN­ÉǶQ©®ùúå|ä¼y?¼’\¿µ¾îÂYkø;§õ²¬kµú´½fíƒöøù¼­ù2Û³mÏ€C_Ï#Y7Õ¯•ZÁ6rW2ÏË)àzõ Å]óÄ¥}ŸÝªüýý½ÏÑ?°ŒŽ¬ï˜-‰™{Ì–/Ììÿá:œ>uz⥮Ãßu_; 4çM+µGý×ßtØËo9ìw¹"F êÅY@ ¸Îjï4ýî—zH endstream endobj 98 0 obj << /F2 13 0 R /F3 17 0 R /F5 33 0 R /F6 36 0 R >> endobj 96 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 98 0 R >> endobj 101 0 obj << /Filter[/FlateDecode] /Length 1256 >> stream xÚ­WÝSã6ï_‘§ŽM°°åÏ p3éWz9nÒ‡+f2ÆQ°8ÇÎØ‚ tú¿WÒÊŽí$†kïIk­´»ÚÏŸ&2ÍÁÃ@.Ÿ¿M.ð`„FÞ`º˜ȳ[mšÝÀž§å,!… }m­cO‹th/À‹`?‰Ê(ݧÈÂJ â<+Yñ32‡ ªë„d-Aå*¥ Ȩ("¡Ni¢Y:öµga)”DOc¹ºÕcP¾P[BÀËŠøÑï¦]ص ÛF¾Í=!|0þ6»¼šÂ‘—l Ù¾:€éÖLÃñ\d +@¾#$Ýû.r+©0;Ðâ(Õ Û¶µÅS3ÊÝ¥®ij–uåò±ºM{$»}今bÏé¾Ûlä »-4rå©’EŒÆÜìhÏ9 Êþæ~ŸÉHÍD^f,ŸI7‡Úøúzü ŽC]è9µ‘ù·Ü²\ä`ríãùdŠb’¦%H8…%”ì.äV¬úx[ÃSVÒ‡ŒÌA­ÎÉåèÖu”~W:ê޶¥ý9žÌ&—WŸ•u*›Þ¥ûñ-Ý a»t—ô•ÌÈ"+^f)]RÖò wFcó¸ó–¼¾<œFŠ%ͤ!K!lJm;”˜< ïÜ(›Ã^”Ö©ÍH•Ìq×>̋͵³¹‘’؇›‰^äqÍJž„ðjÅI#˜·ô¾h¦Üœ('gd ˜Þ A®ŽGj¥)-Ùþè,ò"Ôè©y¨‚}j©@«”;©$|Xñ†Ã*7•4ÅŽ¯¾ž+­«V¨ÿú2žL¾~ áH%fG®¸ÊgÑPZ5t3½¾¼úTW‘Ùwn_¿ÌXu5¬ž8„ÅÚi‹W Ai kGi);·nÉHÝ>Þ¡kÇÝ]Ç”„ÕÞKÃa«VUåþº)²d•-¥ÆVäþÙ~=¿È^V2¤#eŸ)¯‹‚ð>*}t¸Uû"—òtÄPo;Þh´Õ†IGïý#_V”Åk Ë“6 §"*×å•›–9Pnt„_A¬˹„«ê\ìxª_+ÅÓDŒkÁEñþŸ°íjO%QD•Šãíj_ÂîQ 8" ˜p£mcn¢ì4©U‘³¼…ê¹{ßµÅòäô ^§gð:}ƒ×ò}dÿœÉêÇ}!w÷…ܪŒ«»÷UájAÅEu6l¨X‰ÜäÅýÏ΋LÅ&Â>ÈÔ>tÃ1ý柲ó;f Æ˜ Äk±¤ûø35׺D„ò@I˜:¨šQFE†µ%räÙ‰(öMQ^ò›éøzÊ;ïì÷/ã›ÏC«û–Àßà9é=e]Òçù“œP-K¤rYò¶ Ókc™õ4ݲÊFn¥HM%Ȱ“.–èX8‰ÌÙw-ŒQà¿ï¾…3…3ìmœálp†ý?qï*ÞîZÄâ­yÜèýuoÇto/o‚³ú®”&êV²ÂެžQºN¨¬ófè>´#·-Fo¾%¬·ONêI^Mö¶JɶªlÚ –Þå‰ÊŽwMµwýV4tùÚA4•º!u=Wk¼ßƒ¯6? õS–dÉûE¨½.E>Æ!×ê‡ i©UlõÖN\j[z~}~pæÿç.ÌD·º0Æ  ËÄU/¶\iÕùô—Ë0N endstream endobj 102 0 obj << /F2 13 0 R /F3 17 0 R /F5 33 0 R /F6 36 0 R >> endobj 100 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 102 0 R >> endobj 107 0 obj << /Encoding 41 0 R /Type/Font /Subtype/Type1 /Name/F9 /FontDescriptor 106 0 R /BaseFont/VPGVOI+CMMI7 /FirstChar 33 /LastChar 196 /Widths[719.7 539.7 689.9 950 592.7 439.2 751.4 1138.9 1138.9 1138.9 1138.9 339.3 339.3 585.3 585.3 585.3 585.3 585.3 585.3 585.3 585.3 585.3 585.3 585.3 585.3 339.3 339.3 892.9 585.3 892.9 585.3 610.1 859.1 863.2 819.4 934.1 838.7 724.5 889.4 935.6 506.3 632 959.9 783.7 1089.4 904.9 868.9 727.3 899.7 860.6 701.5 674.8 778.2 674.6 1074.4 936.9 671.5 778.4 462.3 462.3 462.3 1138.9 1138.9 478.2 619.7 502.4 510.5 594.7 542 557.1 557.3 668.8 404.2 472.7 607.3 361.3 1013.7 706.2 563.9 588.9 523.6 530.4 539.2 431.6 675.4 571.4 826.4 647.8 579.4 545.8 398.6 442 730.1 585.3 339.3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 693.8 954.4 868.9 797.6 844.5 935.6 886.3 677.6 769.8 716.9 0 0 880 742.7 647.8 600.1 519.2 476.1 519.8 588.6 544.1 422.8 668.8 677.6 694.6 572.8 519.8 668 592.7 662 526.8 632.9 686.9 713.8 756 339.3] >> endobj 108 0 obj << /Filter[/FlateDecode] /Length 1904 >> stream xÚÅXmoÛ6þ¾_áO…njĽ É€ é¶nE ´†¢ Ù–c5²•Yr³tØß”dIμž$'yï÷éË\wp;Ðÿ~üp}ö£7ˆXä®—w0&òêƒ#˜Ï†cÏ“‘s•ïfYº¹Ž%œr•ñ.ý¬©ÐÉ—´ÓçÏq±¢…ëa¤œx–%lxsýËÙ¼RŽ€qQ×5ŠwVy¦IáÜÇÓU”ØÕl¾Ë ý s(-Wf[ZŽÒ"¡/ÈÂi;:\ ÆÃÃáq¹á= rÒŒ²0èDFUBÖ Ì„K¯­Æsk=Þd5*¡#~ÇdjÃ)ˆH˜*•Ucû Ä„¤8Å/UïÝ$¦Â€…Å›Ã²Ž‹;Ø(0ðù&!bo ;‰(wÛŽ¯€ÆÜ …Êw^dÉl„ü”Z„O] ÛužPdfΘª…¥f²áàL‘T†¬h÷§¡°Êv íYÅxæ“.wZ)WiÑo!ºì6‹+GErn ]>:IƒZO# °bú‡¡Óë•­à°Ôk9 ;L­•I°F&á’ Ðù„+ŸÈ¢Ôþ<â—4öÙGv¼6Ô¾z×y³±fVáØÆ·‰•“=v½_Ŧ„Û§œp/\ê¸ø&.…9“·ÎRdø¾izöåqZüKê‚ nÅÐeÂB"Uz{R¹,´Pö¡ÓÉ,,f¶ &…áÝ\¥fô&Ø•VDÖÖT ƒ\™»eRÕû¢í«pbßWáÂÕÊÿ6¾¦‰É­~€ì9,9Z‡E×aÙ–ÈÉë°áu0ëxíqæ‹ý6oôªtñöÐli‹¾Õ =µDzt÷’Æ1}dZæSÍšÔb ±‚Ænþ› õkNÇøšáz§ -’ÐEN”ŠO‰,Î áÉJ?”hEŬrƒ#ÒÒëT_€?ÇØF[ú¤eåìŠÄГþs³¾nö÷ÿ3lÏ±ËØ S3ɲ  ãaÛý6/sý}¤·s]÷ ð‚gÍa —O½| è½ `â+‘~2|þE¹ölf¹ÍµšÙ졜в¢¸*ƒšš‘uAÌö Bý/aà=¬à]tà]Vð.Ž÷ºùÁÿ@&¹¹k4aà¾Üîuóçm‚ÖÍ'†yÚˆ#˜‡'ønÌ—“zúM†§4³…Bé % D8t´ÕP•õ„®ÎŸØãµ;½ƒÿì„$|N¶9mÒ8¬ì5×` ÷ñÖððǃ‘X{ÛgñÜ %!9R'g]Õëd]$€Ï´#±¼9%£Üã½­§{ê .‘½…}ÔõÐð”õð}Ù?7ûB8bn6o‘yࢠ膭bL—”2Ý"å㽩…g¦ßOß]¿µ9:ê"›Ú|êT¦Êþ~¥ÌZ×kfÀVG«¯Üüñ_ÿAñ6^¿¹za®»÷½ÂâìÎÀßp:¶'û^Ùå6N3#Üh_æ¦ëðLÅÑqòKÔ«b¶K³EÑ£n›¯Á¿(]ìÖëGÛìúÃ;XàÖÄI/\/Ð`,6¥s~Q™6XöhdT}衵7:þBÜ(œÕ7ýk:äÕ4ö¦}=nw³iæ9 ”²êLsLÖ¯˜ökÁ^r;OYO–(> endobj 104 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 109 0 R >> endobj 112 0 obj << /Filter[/FlateDecode] /Length 1464 >> stream xÚWIoã6¾÷W¸—BN"F¤6 mH1 ¦‡éÅ—b<È3‘%G¤ãÅü÷òñ‘¶6g‚žHñ‘oùÞªI@‚`r71˧ɟóël’‘,™Ìד`âãöýWïVN}–2ï0e©Ç[û¼|€/ê嬡W—’¥jDu‡ûRH…äƒP<ÛéeæÕ¢6Š7Óoó¿®?†Gñ4ÍHœj-@þ©'åbÂBK»F‘§6Eðç]Ã¥uÕg™hŽ‘ãè¿Û<ååÔYìý†KÅß7Û\>ô¥Ñ€‘ ±/Uþ`P°Ô•Å£^㪦,p´qÍÓ4Ž4P{.ÉÔXè}^ƒ€‰Æ ‰&>¥$‹ k¡Q )ó„„U›ò¸a«ê¾5qJúŠ5Úç­‰² ï°+Ðvƒ²L9€ŽꞈWœ±˜^›ÜQYÍÁ1°© ^a?¥Êljrk}¯9i©EèÝqe/lkö TåiPÌš[ü€À2–’hÖFöIvŒÆÀËÕÔ–-÷¯Øi=97A§y‚hÃòöAKD$ožŽq£_ÔM¡ƒÞle·Ô&WnÇíCY-…Òñ,ñ ­u I-2¾ª}Mð׎} PĆï­ö4ÞpD* H” P˜émM meRïKmrµÕÄ9yÆNø6nHœ§õAN8‰æ(ßaæóª0nšBÒÏJË(‰Ù1 EÙw HFOŠCf<Ôg3#3çÇÛ/¿ÿ û|BJÂÙ±¼ôSD±¥ûíö%¼ŽHæ^çU1(lI’6:&>m‹ŸøQÚhÄ3ÔiÄ.Qñü£mÆ8 ÃÈkx;6ìŒ)¾¦¶è[­e‰ÞÔt/X—è}UäÍ ­êªÀH$¨sÜî`Xh”Û 3'vˆŸÚ¨jª'è`ú†QÏ&ì!|®¾jx®N:VÖŒ4Mï?ÓÞ¦y_QÅ$ËŽ¥Ì§Iâ-XõÝä3톤 ù¿Æ4&IÖ>~„ry7¶øÚ˜0¿›A;¿ýwRcýÐy´ÃÅ~©|Yò¯â9^ìqŠO 0MÏ>Ð…¾äøbáíS¼x²ªS0ÅÉ ¸ûZ¯t|~½qö•w/EœD™åú×mýÄí …ëÅõˆGAkŽB=:ºð#  ýÇJjVõÇóœ:/º.~ÑÝøàǘÓû±q´ü“10X /œ«‚WÂ4¸?«%ã– !½þ˜LR’¥&ÛtñȘ¹™fæÊ|c¦ =:­ ýd87èO<޽½4ýN*\iR~åѺ³ˆ¤‰å©yDº.õ~‰/ ¨©x°*$SÏu ;èÐp*ŠÄ­x‡?ç+U¾ô^Ê|kEðçß)GN, HêÚBÖo¡n\VzÃwe¾ÃïÒ Pƒ·fµŸ1iPº‹Žlò¾ße£S—Òõ'Jh'xOšb3Ó4 u½TŒIêôó^!÷Ó†ò7¶a»Î(aèN„g›\â q}ÊÀÛƒ(Rs×+•ãS®-s'®Rð¦j Uت–} õh ¦µZUz¦Ue3¢vžcù†Bë¿S/;Þ)Þ·ÿ|ÿüe>ìue —Ð.ô÷l‹k}üíÀÍ™V]γ¿+{ÓðßÀÞ”3ä}±e~ÐCˆe?¯Ý߯ûq”·jt•ž°®[%yÉa†㟠ø»&6±Ü‹²# XqM½µºl¬ó—ùêáMFa'¹jõ³í@›µðÄ ÞÖ~¼9þv^R«± ?nzÿ¥Ž|yiEÝ_^ê˜ì%Á +Žeyt.gn¸lM‰Çár4¯mZ·'Ìh0a2¸3fΆc&üIöþ˜;Ëzõòµ–8ûÿ1tD¦ÿ2¨›³üÉgšÇ~˜ÿòµ‰É endstream endobj 113 0 obj << /F2 13 0 R /F3 17 0 R /F5 33 0 R /F6 36 0 R >> endobj 111 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 113 0 R >> endobj 116 0 obj << /Filter[/FlateDecode] /Length 1976 >> stream xÚÙnã6ð½_á>´Ó˜©EH±¶(v6@QÔÅ‚–˜X,y%9Ù´Øï ‡Ôíô€<"‡s_äÊe®»º[é¿7«ïo®^«„%áêævå®6¾üÍÙ¯¿ùáêµè6x€{k9²¸_oÏI«¢1¢ø¼¤Ó46:í(ðÎMØÙdɘ[çúÝû—¯.¬«Üg¬ŠüqVΖ5Kfš]½WK"nOhL$½Ùç äsà;iµÞˆÄÉ}Òràœ•™•’þy´cÓ"äb&3Ohšo˼Íe‘ÿÙ•“뺖X>ž¨tüˆ¬b§:6TdÞŸL=:¨Ñö²Ì›áÞV5!e HZ‚y»'H}Ré©Í«ÒÔº[Zn÷Š€¦•­:(¨^¡µnRxä²£!fQ¤…~[¬XhpÔí{=Êâ«×Qw>âL$¦ÌYNm3åâ'̳XŸ§¦£s†Ú7<¦ª€vq#§ÉÇB±õÆ÷ç—u,TÊ ¡ÆdÂX®Ä¿Øy@û©´ÕVL°ÇTe?d‘-Í?ßüôöÝ›‹©L^ÂÂÈ h‹¥&ÿSÍìç pƒx½y83Z! †Ñä•$/“ઠ÷@séDÖä¬yŒÊM[S\ÀÒ½F}"< ‰¼ÂÕQjž·R!:QuJùaÀø0¥ÞUÚà‘âÉ– ,â´¢¦ü"Vûë_?€¹gæA„°Ë5AoÁi"bapNì…sûÈQÊÊÈÖ(Ýàc-]9Ïeþsd­è{ÙdmEdw:úŒ%ÒJg¸ –êV׋®4’X7 ôÐû‘éÂFBC4•§F, 9Õ"rØ9ËL}š™)d±ßM3}‚ ”b”[#ꮲÝÙ'é£_–™!XÒ?YÛ€:W++¿ñ¥p”)£¬Eƒ`–@ƒéíÚtm°0øÂù9/SEXÀ{BƒI†¨Ní¬˜Å!ãü|ò™[#FÚˆ(—´[è”K’Ët»_MÛǺº«å>RYÒ~V µQž:™c4Ð48¡ªÆÏˆjÕÈa ÌŒUÁ*Ô°ûÁ@‹ØàÀ`‹œ +^ ÈÆÁè¡£HõY!àÐ|„5V%¹5ƒ×LP¡ØÞ7.‰‰Ž–e¶ôÙ´yQ„úŠRÕ÷ÚåIä¼jSüab€ü€ìº¤ÁCcjz.Ô‹Þm´ÒÖ2S†m&[i¥ `´íC“‡œ¹£‘¯‹A â»<®èA‡ƒ±>ÙiäNÑ #°¥³m[ÒŒ€ ;vžB!×Óh£{^ä¼74%ýybCÕÏ<507 ÖjŠíÓÔEºN‚CäÔ1"éGî@Ú ‰ÝŽ¢S5È…C¬W´ßgoâ2/ÍÞŸÀÄ\ Le‡ª~BººJ¡ÝÖÖ@@ûÙÏyxpø‰R!ç_d•¥€5¢5ä ¦94_ ³Ãn£YÄK=׋9Yª™õ\Ÿñp0Þ Ñ‰ÈZ’ Dá‡vÐ^ŠœBÖwfWODzQç¦ÁšfŸ3á?/2Ì&Þлq@­ ‚ïÅU´F\€›©Ýã¾*Œ,™Âë%íÃ-µÂàØ‘T6„MBšM¨84±@N³´~  ü‚)dž÷Ÿ‚ÊRu:ÒXÞèp”NYø¦’íVwU ÃüÁtâ>F°÷èѹ· X¾oº*BÒ2I[³uk6:§×GeCÛÆx@ŸOÓSm¶òr>@òÞUHø‰¥³é2wä+`ŠÜÖ§Ô”Št­Õ¤+J“K±(aý€9©Óú{¯ÍFPx2ï8Ì,•)¸Tåæâ¥+Ýð¶´ATÌãÓ÷˜kk‹™zÔŽú ŦBp»qè¦õÏ/Yöµ©¾¥øÃ‹à©ÔÖkì£Ónʃ»oPgÆ›õo¦'#Ùæ·øJÅÁëî(ÂqZ€ 2×Dó°BüV‡£¬ÕÖY~fÑ¡@'ª<3o2Ååü`ûÔò}ÿÌÓ™¹ä ¨™§!9z-ÙDæCØÞ‹…·Ž³Ôwÿ•zÝS0Ý‘z­ÚS]]0oz8âCÙ…Ü®á¶ÙÖ—–øÅάl×Ï>0{ 1–RæõCºEäí. H,À¹´'ͰÂi–æµD¸’uêëŠÿñÜ"„œ=·¡/g—>‹|M™ÇšÛ«›/þæÛ¡€ endstream endobj 117 0 obj << /F5 33 0 R /F2 13 0 R /F3 17 0 R /F6 36 0 R /F7 40 0 R >> endobj 115 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 117 0 R >> endobj 120 0 obj << /Filter[/FlateDecode] /Length 1086 >> stream xÚ½WYoã6~ï¯ðîC!Û#Q7Üp‘ì6» $Š  Y¦m!ޤe§Ùbÿ{I©ÓNÐ>ì“Æs|3ÎA÷ d½uO|>÷~Ÿž~rz ÜÞtÕ3z:Ú¦ÿ8ýrú —B9Óà²8écO+H¾ #Ò×- k«]qšÐ¾î†f!ØWà¦a"+„è¶” Û–ò”l†]ÄV)ÖMÃ@ŽÉ¾& ¡v;½¹š| X0ØÖÂ<_çÛ4Íæ{i>Ó8FÏtÔÍÆ77ã{°ŸÄ'óäþ#›õ…–ÞAúç°ƒf\9`Ž6ªûMÀ½3ÐëçœyÔ$^ú¬©yƒÅ*ˆ*4¿kí0ë xÍ$À¯Òýýœ…?ë+œp¹œÓ"“õ<¤4âPÜ?3V£n Ë#Ÿ)o*%Êèûs¸Ý¦Qy‘ˆtU*VŒÚuÒÈÆæ [¥9T- £>v•nUR–‡\G*'^\¶Áp€l·ê†–¹Y«ôq7¬úè„GaiÙ®à„­¥ äè.¼«Vä mÇf דb3XtúÐC¦ÓlÃZ/a#@¾s¸0Ö¤ É~¦}üë«Éýüîöòæö£ºòF'w×לgc6NÀ\‡/O@Eés.âm\¼cp õhð„ÖÜ~£i^ÌøùNå/uªBñ¡"…›œÌú#Ù mx†»Ë°iõ¡^ë ¨ÚÝf«ìíEltðcà¤Ýe“-ð`„± ÀB“3ø¤ ¼6¼¶4ÊZœ(Â4CEY@9šé/¤a²!*€Q` ÓMLA1|hKéØŽ¶£D°  @õb3xÉ JYbÏÐ^øv`hØ €·Oð+å¿öBœ§Ø0Ú„tT.¶¤ÓR–ü Þ’´Še"Ë«: û˜wV!‰ãkvW A÷á¶ÓOz£ÕÙáƒã½W߈©ž„ð‹C§ð“('Ï,(•q‹_9Y‘œ$‘L[”î@®˜ñüV±M7r¨° ÍJW0o %RÕÌé}_TÝN.vQB…fülHј_àÊI* ¨ä%äE™”¡r•2TŠMnFûï¾<¤? ’âžÜîϞܖšÜöOœÜºéºGÞC>#­7Ÿ#®<¿|Íä¥\N/ñQ3q¾‡ø±à…Ô>6žÜ–OÅc#åú9k÷y”Ã!˜¿¹üK¶Ãÿ¯Ëòì2ö¥³Ë0ö9¥cŒ6eЍ.§¿ü Û2B¬ endstream endobj 121 0 obj << /F5 33 0 R /F2 13 0 R /F3 17 0 R /F6 36 0 R >> endobj 119 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 121 0 R >> endobj 124 0 obj << /Filter[/FlateDecode] /Length 1979 >> stream xÚ½XK“Û6¾çWè”PÞLåMªÇIy“Ú¤âÙÊÁ㚢(̈©”Ç“­ýïÛø”4òr"€è××ݸð™ï/næñãâ»Ë—?ðEÂ’pqy³ð+~ÿÞ“,bËçAâ½®Ê,mu™¶yy»\IzßÖuº”Ü{ÄWå½-7y¦¶üpù¯—?ˆî@+¦b8O|[Ò²ì—9‹#»úíï?;V,t_,W" ¼´Ä§òR”/"”ÓúÓ®ÖM“W3 gaàD¼Ï/þø0•"ƹݑ7ö¼?÷ùÇ¥y….—"öZœ—^[‘øv«Ÿ¼’2fq¼²D9ùË•÷î?ß½{ó+Ž•7W(ŒX24;V^Î4³ÃNt^nô'RË©mפ—õ«JZ«n¬ îûv[k»]ú팼¶™Ú!‚˜ù.HùTWÅ„ìT| Ñs~µð¼Ý–›8b9¹œ ( À§—[òBï:ÌÓõMUßks<%X’ ƒ²¶0’‰õŸLBïf_fí FXåT>^ƒ›§ºóÃ^¹PúÞ/%k\?.cyÀaŠùÎ!Ín– s@FË"¯Ê]ÈàlH‰–žmµ£ =N¤ôÚ´i†Þu«SÏr§Èë7?ÿÜLu!ãª3qšrÌwо.gÞá ]è2]NûZÓ€¢Vílô6VÉ+¡BBΔ¢R©"‹!âCËL±ØÐ Os&pu«á³šÞ½Kk·8HLAH&¢Ó€V#@›Ã¬rʃ:±/ZšDˆâÜnßl;©¨{HºKÓVºJÓÛë)F)ã¡b&£!¢ °€H¨ÓtŒø1ª›–^îq#(•¯l1Á­F7XÌçå:ð™ :€¾ç«¬lgåKù¨ÏÐ CùEê„“~@N²d Æÿp~« þV@­Û}]ÒJ8 «Øë±eVî•úf†ÀAm«³ÞM$Õð++)òÇhómL©0¨÷åªÍïínmûÉÞÖd&㘂ªTÃðÛÊ/·N¨uZ´¾MíÆ²j·Ô•a¶'œÜØçCÞni4è—$¸Þgà'mjöýÞÂ?–Ò+ªÛ<³%ö rf“)?M¯k󦋪¼µ#Ê.ELÒÙ¾Õ,;U8/HêzßÒ Ö÷i^6ô‰k…Cm·SyÓV5*ìö§MU6ìjIRTߘy  T92y;o/ÊÕ([d¡¤™…˜ë ò}OøéT÷vˆãMS9xÿcúeÄ"·v%Â`Æ*¸ï3ŇñÂM´âE×’®<W$PÉ‘½ÍnûÐÛÒ2$6yV§‡ü÷ɳwDm^ô•ï½|Aïiq×ÐÐ$ ôGŒŽ0îhøâå–ýñÍ~ û°ˆ¢ÊÜyYµ{¤ö?|i‰z~$í"œ|„ô¶ƒÁzÌ;ÕƒPÆ‚ùñÐûMþ—¾¶h«6-®‘}¶S—·˜ÛCó î_a31níyé}a¨‚“£ í89©zÅ4vkÚZQ%¶š£R²mZ;)i ]÷°Aë}^lævà×v%ý11ï.{ûï¶;P)¦ÿz.çY1v"@†`±Ýéùý* •°„²Y%Q@9ùC˜‘öárNÂU·³r¬z\bègmܾ堩ã¦*ÐÇÚ·³üBväRҵͣ­©WÊ`ŒYËßî“q*Xô\WðyY8¶EÀ”ŠÎ5Æ¢•Ú¯¶êlç“ÎçÌóËVÔ·´ùE¼kW&y¦„K±8éì\Ÿ´0d±8;j…NMŸÝï.,#›£VL…Çq%YqÛ“A“\|–\pÓVáÑúŒiÆG&üö„Ð¥“ˆöÀnaz¤ ßã•Z¢gxŒäú‚‰pžº‘¤‘òx¼¶Ýq-IYWç„SÁRDeiXB4LÙ+´o´= /é)D:û1g ŸqiÎüo£x ‡+Az‡q0oÜÜ9¦ÈΑG˜<ñê©{~àÐó°Í iÞÒY0È.ÝÀä0·‰ËEŸ¸\YÜeLìË"¿C­ «!pm<–˜Mõ»s냈CÃT ò¶4nƒé”& Žæ†„ N¯-²!æÁˆù€–Ó|Œ?qUäLÆãô€¢’®¸g1ÔÏã#=Þ1G“ÌШ?¼ ˜ ‰Q|¸ëBuŒ¥ØÏaÛYœaºýÕ“)øœ ñSv¨ÕŸåþS­>¶zùy­þxx¸ŒX †ý{]¶{¼ò¾$%.†ÿÈ÷®;:¿¡p_‡µ;KþI××C†äÄ<å×muÝt‚OÈã&ð¾âepÀê›´Žbñpꔿ 2ã¢`æP'˜Ó®A›|ºM?Núß*§8›»¾[ÂâAƒÿa– Õ¡y™û&§úIWaê_ì=0I[—ó¿c|P‘žc\xÂ8s×> endobj 123 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 125 0 R >> endobj 128 0 obj << /Filter[/FlateDecode] /Length 1224 >> stream xÚµWmoÛ6þ¾_a$À&'MJÔÛº躥Û> Cj`æÁm:Ñ H‚Hµð†þ÷ER–(Õuº þ@™<>÷ÂçŽÇFÏfíðföírqçÍ”„³å~†g®úüîwgùÈæ,ZÜùݲ‡@H.‹R¤ù:g…:bù±ÊøÜõ}߀Õ~ðæI~P§Ü[+€ô ùxÕ²ø ‰ÆßÂVO½ÆEÚ€´Ø)ä Ä0FQxt‰ é%ˆve•1 VZP£È3ú› g•å“ctZ ºE×OÅ3—ÄGÊ<ŽÂ‹ߨ’r¡,Ù²<7¡.•£Êý÷ W>UÇ”zˆ~ò\=„GRÛv"£lî’0tV^HmM.I@.€‘ $°ºG—rœüxö[‹ÕÜÌ´‡³š›‰+5¨8€Ày!uJ&UìËzåT|^évÐÿ¾Ñ«¢´–¯¯Ö¿[x 0é«Èö ~åèî­8TLêáõúíòþÇŸßh4 ëžØÓ¶:¬´y7JÕ€‘ðçfš¨gz{Ï›§mRE¢gMW5žkÇd¹qGáCNEkq¥ Šòý ü/íªsµ8×­Ïõÿ˜ýƒF£Èï $NÍDSêûÝv¦yÓ.a‰n¥Q!jJ]£Ä—jUÝn€™ =¶¦z_³twP“œ 5»-ëšmE~˜Ç>\Á.Mbç×yì9Ú”?®% Æ4r{©Â̾fÚUª`êØfÀ¬6Å3Ú:9j‹¹:xãÅŽàš6úoÆM¬ùôã‘ÀÇædÜPxßNä,ã"§©ndV^XÆá©c‰âÁ±@17Ç` eukÛFGÄ“e| È'ëÛ³/ty¦º¯ú™s¢.LnùRU³‘7+WU%¬FÚå~X¥M:š‰Û©f"ÓUÉy¶Éµ(/ÕX³NáTiéãw‘⿘ÞU©Û§×µý²¼73·ÞäîŽ2Õå‰þûòDå .û¨Å¤P¡‰ó¶lê­Ä‹©s—匟ÕÔøS¹t‘Öuz@§»èÝçö†ñ  ³´ÞþaÛtl<Ù•åM½Ñ9ëZ!tï…llF‰ß·í2Û;¦äW÷÷¯~[ÿ0fÄ%ˆdJµnN8’È ²ØæÍNK_\ìt°-Сœd9ïNe–ûTXdxe‰<¨)dI?}a``¿~¾ÊÒg_gEæé¬=å¶ècó²%éZŽû/,èå¯7Ú!‚Á¦=vÊ™¾ià™;`Ì)7³ö¬Þ§mB€«U]B£Ú÷—kzŒeì£8ü(?N¬;ï’;ó€ZègÝ€†È½^@ ‘Ú ‡:ZO¿_~ñeß6Ì endstream endobj 129 0 obj << /F2 13 0 R /F3 17 0 R /F5 33 0 R /F6 36 0 R /F1 10 0 R /F8 44 0 R >> endobj 127 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 129 0 R >> endobj 132 0 obj << /Filter[/FlateDecode] /Length 2071 >> stream xÚ­Ymoã6þ~¿ÂØX»ˆ’")i8 í¦‹´i®H½8݃A˲-Ä’ INêß¡ø"‰²ïŒ¶ÀGÌð™g^é`„ñd;iŸ&ß.n¿ç“Åb²ØLðd®_?þ6ÝÍþ»øáöûÀ}䈰C}{'«JžPòNï¡ÝŠ03›(•ús§Ÿ$Ì×l6'BL¿PÁüƒæœ!Ê'sBPÌÛÍ·ßÌæœ²©9V-øô›[_=îÿÍn„­Ã¿Ú«hÁP®|5Œ#æPްaúÍÓWY‘ìëT#|—Ë·´k‰âñöÕ§¼9Òk¶æi^V§kvn²t¿¾fã*[¾Êª6[ÿ‡ûr6§Ñ4‘ûÙ<‚iRu#‹ §M}£dtºN7µzÏk½íP•MÙ¨]§(§i­A’}ZÔ…K(Phæƒ ˜P?<üÐb(x ìˆCD¾ú_ödzZmd’jø›c‘4Ø¥«1BL }„¢zB ùÿYÆ=x\ŽàE ‘¿Àeˆ«< Õ§¿1§Z g3? /óG±üõOcëýšðvóª«A„ë7Š ¾%ô–`ó%ü€1üÓ«¦ÌõËýïýòµ;)T)®NJÊéʶ»FE1Žo”Úý‹]™ËÚ¨Aúù1K^ÒÓ´§ŠÄ1…QõS–ìdº7:Œ®o«´( ¥F¸»¬Öz2s¼Ôº?ßýz² ~ a4{~Õkϯa€èÚjè_6uÄ;ÿžqkâ'YçVâœ8׸à!¬{sNï\íŽ$Âý­p²X^ã`Õ=–‰l|*Yˆp¯úÄqlWS¬ŸÀDij܇†ÔýÛl;)W—Šó cRpá>•Õèî"N/`$xm‰ =нª y¨’Gˆ\0m‰XàN"r©ò›â1òMmrü#Õ(ä,ö`åÁ„;"‡êË ¬Ã–_¸õq'pü)ŽŽ.ñK óN‹r_ÊK(ÏÓë§•ÃR´…Âf£•Â=-¸„Qè[£Çä¾,Ë×4iÊQ$D×±_Ð{™àa…¾BÖ u`åbÌ ,V'¥(Ž/¹=T0÷+ӯˇ§…î¥i^iòü a†©úñJ¨&–OTI ÜÚ rB7Ã3™6˜Aè ‰kHÐйÎñ¬yúüø82§û®+´öÏ,Õ“A3^0EÄ.MN&PLÎÚ%c¬!WNbýåçLJ÷Œ¨ªw%ZF¸rBØŽ_yؘ9FŒ:E^€ì¶£¼_ŠÎ /D•Ï Åó_ ¥r˜öBI¯½Pаâ§gÃxDéŒÅs3Ç…¦3Š©¤,à’Ü,ë\Ò–:¹›rÙ´·. †àgdX…ØîMBC&hÐþÀ6ç1CD r4rᆋNJÕ|Ð#ÚìØ& £† Äß=ßß-î¯ñ•ß…Œ¯n§ðÜ›"·¶¾²B¦&“óµˆÆ¢_Û×å(]­f©Æõ C»ˆ<†]Dý" é^j©JÈ•zm³Ä á2àTœá”@† ãÿãç»ÇåãÃÓWL'þÆêö8V[óI#Ò­ @+¤ƒëÓP^3¤Ÿ™æF¥W½%­ŽÌçFsHÅNÍËÕi™½Ê½OŒÙ$çrFYæùTª«`T…!xZs·¶ž´B¬’©OTÏvýÁa›IêúOÌÿã˜#ÿñ¤È4ó endstream endobj 133 0 obj << /F5 33 0 R /F3 17 0 R /F2 13 0 R /F8 44 0 R /F6 36 0 R /F1 10 0 R >> endobj 131 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 133 0 R >> endobj 136 0 obj << /Filter[/FlateDecode] /Length 583 >> stream xÚ¥”ÛnÚ@†ïû{i¤z²çCïÜ–ZB%p£VUµ²)IQ0‰j”·ÏîÚ Æ8R¯ðŒÆãoþ™„ct‡ÂÏ}Ì/.2`$Êoq¥uøùWr»Úü±å‹Ýþ+Öƒßù—‹Kº¯•”@8Ô}¤Æ˜„•ï)c,áExà‰,šŒ*üûh˜»sôŒç€ J &P…ˆp±ˆñÍÙ>¹ç Íh¢Ê¦½)¡Æ:ŒưÐɈðÖߪØÞÛ݃]¯ªÕ®;‡b@cŒqBx— Є2`ÄÓR ÊÄ8ÒÆ¤û09à2×.êBÄ¢!'²èAÇ´j£WÅýÒ.«ÇÝ‹ÝåzÙ…× ¤ìÐó¨¹^ºê«0@¥ŸGºAxŒã<1É@Ëãy=윧5{]}ý°ÙÍÐNÆóÜN†ÓQ~ÕÅ7Æoûè†Nµg®«ã¥Ax.ÁðGИtK¢¡WU€i[ÚÍòÙf³Yö³ åzcÙb•EP* ¯ŸqºÅ¨jR ”zI¹ Ý&š~³ŸfÃ,žAÄŠ^ E€x´©bØ59é*iÛM&º‰àž›ôåâ˜2·ÙÔŽo²É÷R©ÀècR}â% ÒIãN+¿R‚AèÇ•Æ$ñÌ­ÛÓ{+áž#4ØÛ¡;ϳY>žŽìÕu6ÿú?Öwût÷s°~w¬o˜í-ëŸcøíîiµ¹³‹‡ê±xZž¬Ë~`‚+‚ÀîÉû¸Iì‘cV€8’˜˜ú \'6%„Žž¦¬ùØ»W Phê endstream endobj 137 0 obj << /F3 17 0 R /F2 13 0 R >> endobj 135 0 obj << /ProcSet[/PDF/Text/ImageC] /Font 137 0 R >> endobj 9 0 obj << /Type/FontDescriptor /CapHeight 850 /Ascent 850 /Descent -200 /FontBBox[-301 -250 1164 946] /FontName/RPJNVD+CMBX10 /ItalicAngle 0 /StemV 114 /FontFile 8 0 R /Flags 4 >> endobj 8 0 obj << /Filter[/FlateDecode] /Length1 721 /Length2 9558 /Length3 533 /Length 10109 >> stream xÚí—UTѶ¦q îØ8wîîîltãÁÝ%ÁÝ݃»»»»KîÒ9çÜ{{ô¹ýÒ£ßztU=¬9×_ÿüjÖ|YTdÊjŒ"æ¦@I{0#++@LAT›•ÀÊÄÂ"ŠDE%æ 4[;Ø‹›€|V^^6€$ÐôïâïÃÇÉÁÇÂ…„Dspôp¶¶´hÅèþ¡âˆØ­ÍLì &`+ Ý_3@ÍÁÌö`D@ €ê?^q¨]€În@s&$$VV€¹µ` ´´¶Gbþ–Œ½…€û_isWÇÿÜr:»üåÐþ“”ð—ÓÜÁä0Z 1+:ü­üKó ö¿áúwsIWHÑÄîöÿlÖÛ7±³yü‡ÂÁÎÑ t(8˜íÿ]ªüœ¨è¿•‘›€¬ÍDì-A@Ë¿RÖ.’Öî@sek°™ÀÂäüghoþï÷OfUeYEMqúÿø­ÿÚU6±¶«{8þ—ï?äÿŒYÿgü·=ÎÖî=–¿ýeý+ü{ÿçÊàߪIØ›9˜[Û[ÔÀ&öæ&Îæÿ•øïT¢¢ìÙ8ÿÎ+€—ƒËûUjØ[;¹eÄœ,,,Ü\<ÿÌš¹:;íÁÿœ„¿ŸüŸ±…õßî@3$?5ÚsÚU\\£rjÚ€¹×â0ÿ îwàjÌAsòŽW ÍÝÐZƒ-’Õ+'fƒÑñMÅËǸ¯,c@êx윷À©ÌjÇèϠȊ57+©¯™ÈŠÆŒ–©fÍ^¡ÄX]æNÔGmoR-ph›¢Êë/Ú°&%Jå%a’–¸ù›âj3•QòÀÑžÆ q»µ±œµô° EwyÛžè äOd®6.p’ š‚*ç‡ãøbçU¤zòØv•<«öi« ËÖû Õ$z SÉßev®§Fü(\pµÛµàWGjÖ± wç “wÒ~ˆéOEl s6KÉÑaK.†]?ö³jž€«Xúv“ÁßZOó±I›üîâUŽå^Æ=ùd?SíXµÌph(Ùhc¹Í.ž—T Âè÷nÿ¹’ÂB¦Û“æ?&~;L27ÌCA¢7Wï}“LÊ–Cò˜`§«Þšº£UOvœŽö“Ù" Ñ¢`v Ü2g¹ÆÞ*¡'ÁZ0øb9’ï¯CP$bZíX*[•?8¦qê·em÷ÒG²à…Zò ÏõW¦¦¡Å嵃×;Ù4ªc† mxµ»X”âá5„áøc+Žï4˜*˜_Bøšþ€vô…,/Uf•x,ß{±@µ¦‚‰XqÛës¼èÖÑ[¾~#›n¢ÆÔôMÂ-er[Ÿç´œ‘—w‘ïåNk?ûÌ(—tSMk¸6²Ðî`²Õ£Oøaö„¹Fj¹¹ÖªQ× ò.¬°C‚kP†ro_só°UIÄsízóQãÍÓÏ\g>D˜]/Q6c’‹7ªäýŤܼWPgbغRûÏ}öò²q:Ê&1cDëtOhö3ËlF‡ LØ%¡¨ér5aÁCD?d0ƒtÑ ¸÷¤øNª(ú´/ítPÜðwrBMI÷îÄè†gó£&Å5(›HÅ 㱙ÁDæh†"A–ÆõÖµšÕ-,$qlKƒN•ÀX&©³ã ñ«ÓÁ*=Ð2|5ôÝ\¸ÃgnJ™™!»— f4Îá»Ðk ¥¡HþŽ#ªÌsîy=gýÃõmÚ6© k¶ÕÜRH¯Ü1: q²nì™ÁÒþO&ˆ½œ¨Š*ÝC’ØÀÕ{";|™î¨”ø+Bu\Kû(XŠ[•¼ÈžiƒèM”Ÿh9ç@ÜêÄpWÞ'ÈýÂkßì½m†röÁeWpë/à`&lõgéÆÊÜ SzÓfFsÐûE!úÇ»d]*…fKqîúï|W! Ç•ªP—£9ò¾Ýç,4ߨïkj9{_ºãïn;× ßéL°Qõ¾â!Ô¡c– ¿asíB'9Pù0d ¸·~[ìÖ6ùüÒ‰}çªö“ƒŒ«Dê›$×G[5êDˆ>y=±^Dܽ¡ÜtMÁ‹ lêÛÊP…3„‰©|E~£u_°› ÉS·UO|z}è²Åϧ6ÊÈa°ê݇mbþ¾¦Ð°1nšˆ€×ë+ íP'ÛmýÑæ#/¦U<Õã¿zÈËÅ-ò÷›×ÓÉýÖÁô‡¥2Q:Y_;¶„¶w„=×Q—½Ä›({޽PáõÉJá4µïẩFå¢q™Y­-ÞàHîÐ}÷4ªqø„㲂1YògXÙ^ݘD„ÆÒM¼=(^‚ZîØr—=ú"× R¨®°‹rÄg«û®_<šwòɺèŽ9”‹éî[y}¿¡Ñ5a«MÛrÎÝü×w2öîÈߨvC͵—QøÚó¨ … ä~ɦ_ã~ͲéHíVÃð÷_~üˆÉOÇÕåv'°'I=ƒL~ùÅ&À¯öÞ"ÆwíÄ(‡Ó|ù\Ïï?¦(ǧÉá†n×OžZ?•=éÜm"O…¹1§Lrè<þ¹“HÁñ5·ïæ”_F;eVa×£9꿟H’ÛøBk7 ×vŠ×C_äþ,"é"òw™ßPº¨¶Ñ ëF§+ö×vû×µ³ò,9kC+uªýºúí\:vÎÞ–ìú?–sù•:v0R¼ð#bÈ`;5 H“ÞÞ–kì•we4©Ëñw¤y®û÷Õ¡ò çI‚—¯\E(ŽÚ¥—¾l+ÅœMj² ®.X–ábˆ³µeÔ¯µÚy­G Z ”¦_0u¥¶9x‰>üÜžÃøéüUýnG™óÏ[XÏ£@ îa¦/R:qÞª`XÄ20[÷=n0¿%AR÷ñ¢7v»§"iœþ% RãV}ýÇ|Í·A]®!Ìú;Š,J[B:YH…x¹ðsš-ß A÷Ó—VsÐ?ö,ºѽ€•‡M.2 õÊrʇ!“k8ø†Õeo¢àíóP x§'ƒÞBY+R]_Iˆ³¶uŠ«Ï†Ï@nÈñ\U§+C–ý ÀËjÎ…¬ ʆÓIð˜74QBTšs;^šl6»6¸X>œmå‰x™Ã?§…hX#|°•gËOö,™+ ¿µ©A,R$øÕ±%P†p…TÔþ¬ŒãUÿK¾ï¼àlÖÅ©9YC¦[e¿ï?D_v5¡AêëogœènwA¶Õ&¸°øXtÕåŸ'üøzœâÛ;D E‹ûáçUñGûÕ ®™ê"u©øŸ=J6*¹ÙĹœD¬ ºÔ[~åäâž\Šì¥>RË÷0éÿ£è 1F”Éó§äLÔ„¡?jn×óRš·zÂÚÕ¥¸”QUU`ùµ¾/,_ÛäUQÐäFçv ÄßÅx—ÜZAcy0¥–r{w²Þ…Ew‚¦ q—L/óÀÚw_ØœÞ!òÕÕûwùî¦w×J9Hn ²ñfЇÂ`½±€3‰`ƒåþY(Ž=õɬó <@²ùëf¯²Úe*-v[ùp—[V=‹A(0 £gÅM&‘Ü4cÍr45&¦¹„KU¦OJqºÛÙ¹®ÄIײƒ P›Ls¨Ùñí‡h5 )SÌ;uûKüb—@AÅ !ô¶Ê0Â4{Y1«ßöl„¿CëwA¡ÌuÒ8ÓiDؙ¿Ò’®Ï%9EÄ™¬j/q°¹eùJGïú,i޽¦Ê•Íö¨à®9®W4ƒâ‰èxŸ——%®ŒÛl¸bFÌBð£_´7Pøú‰¿Çpr#_)7¹mݬ٧?7ІsoEÜýz I–Aì›}Kâ èÒø*„e¢F0œßÆŽ)°‡èçÀfI3ßýµÌT&Öé@ òaÜÄM9£^pܦI«sò2Y‡npeïç>±t?ÕB·žì`Eµ3ÛkÕTQã!Qc©%hìµdÂCìIêºpjM÷ñ Äl¨°è³õÐè¯ê!"ºÎ‘¼ÄÃÅR{º¦]Ò.FB…½zKc¹õx—[ˆm£W}#k®E¦TŸ¡s0[’í·’kÍ \8—•ÀÙ Á?ÂjÜiN“ Mng.dytñ I˜I©üpÁ¹/ûZøÍdòéHå¤å“ŒêŒˆâÝ­á,ªyøQ£³g23¤¾`‡óŽLÚ¢òï¬Dûøf£îŽ}z|ÏÄXþU-äx!b“qµ†¹QžoA-Ã%B Cá $ ûJ!?¡ˆá—!`D;‘¯ûbáð‰[vþüÇò'¤e·(è(—D ¥äW•Ôáz”[„N¡6¦+okWbÅ£ç¥Ê±DIã+®©Z-EN'ÂãÊ .»ÚŽJŒ°ÞÔýÑ®½Zj[W¢h'S{>B,‹÷Ë=Ψbôs—ÍoÖ^ñoßUå¥M±Ug×OWîç©àÈébYó"%9P]ε2߉ŒX>ÒðÊôkødY8l[hÇ„c m%ß·¯ äÍDø´åæbŽo¬lPcS$>‚äº52Lˆ¦¬¦EZFÐëpwq•ƒJ;íY“Á~Öw!šSQFÁVZœ‰Ï%ó¥Û>«í?Ð7’Æ:䱆n®Ö»~l\ÄUbR¯Ý|Û ¾wO=/`‹8îÕrSÅdÃö+ƒ,'d_Ý™¹'1é\~eÌÂÀ™ÉQ‹r¿Çx._þ’–"7}îLÝïÖœHzÎé¨Ivn_Úôa*—V3’<2/‚Ù•­D»ÍÖšÒgìïtãíé¡ALÊílí—ñ薣Ǩ¡3§Y¾B¤õJ¾…®Ïz(=˧nuì¥Iÿ l5cÊvú¡pæÁFzW^ùl"‰_ëÏ#5÷žÃ€ŠS’jÍ „ÜÂ>pÄX0lÃ0sŠÞ̇|ÄòÀùãºlÒP˸¨³Ã£Æ:RQ]<~HÓ¤ŽQÇŒ»î‡ }ñI g‰ý€¢¦ëxXÐä–ñeÌï_“N@ë­íÔ1yŒS)îÂC |U2ó8.4¥4’!rTNbhÌÍxSæ‘L"Yö¬Duœ6xx$ÃÍÐ$Jà[BHŽòH2€´Ô|­\äQPžüß±I¤G—¡ ¿ÐíEb Œ¯.½UÙH ZÒö„6*éô6Ûž©Á+ÉʾÀèà:Q×ç”kGª¾È×ÇdR*mð}rþÓº ‰Ç»kjû±îiœ8"Š(qñã${ˆên{—Ò™ Oεø‚ÕäÅ?bž:¨5;ù´Ø—dXJZ!†3Û3 µŠlBÿQ¡›øE²×<àÏIï` ýTÎkŒäM³’C ËÒã–¿°{MË|Kt{Ntan-¾Y° H-õ¾‹¼M©F¸³N=—æƒO…ÓÕãù½¦Âg0ø»Ÿøõ0íYI•îŒ)’r“ý£YŽ>Èx-¤l¾K&ì¢Ã«É s|ìÎó`t¬®¢ž±Kß=ÄÉ•Žîèwä½Ål½×øpmÉâ{Dâ‚à!ï¿RÑR‘à5ÌL ¶Ï¢|:Ói¶i‹?hâPS8GpB(WZ<0ÙÊ‚…945B6ËFÐR2ãiQ3]árfyH?Ž*´KÑe¦mÐñMØì#WÁK5¶E[f H»6Â6µcuè\.Äò`8‚­¾xÃWå$·¥<:N`‹Î¯'Œ*|F;Áãí†À÷PC*¯4d²ó”8l¤[:(Ø5Žû*ëG¬CunÅ©[B$üœƒ…%ƒtk^o&Ï|F.CŽá,ÃÚP*Øú`±pçâwàŽR¾E ?ÇNKrøÁÞgQ+°e´®æ5hŒuë"^îìTUOT·M„~ž‹ÄÍO‚Ä—aç`:.¶¿ynp6é~½F{ ŸÒ4{éqy=”N„ËiÅl.A;\»ôÎ÷T€ÙàøHSÎâó$ä0Ÿ:ÔÏ#”¼?ÿ™`HåQóx^"Žm†Q§þ,œÌß<â’´%¸Kźô(M˜&¤Éžs±¾°){ÝwwÕ§m™^üã˯ߎ½!ÉŒ¨ŽJ `P´âêöErÃÍÿÜ”ËøËh¾ÒÅç²âiF´Æ‘\;wè?lYf'J†dX®TÓßl*·-Žhzò¡Lâ%rSò¯«°ÙÖ}<7ýµ#8ɺ­ªÌj]Ð{PúIB í|C?Ç{±’Éý×ñúºÍ.YãøñÁgO&@æïà5kˆÐÅ˽åjxNÉ)˜v’ðÏ>ãb¢mƘ‹¿+“ÃùÕ• Æ*ú"Ó©;ÖݘdžOŒWì˯¤T¦ƒ~;‘̨ñêÉ;•ÛDjs!îÉGù#7>tiÙ_:GžR×>,™ü|CmÅ ç¥5 ^¡ë·‘`MQ¡Ÿ Yˆ´+¹Åq׳pTZ<%¨u€Ä\Çdcã¿ÂÊ ÍŠµL)d¹ÙÏÍØ•óè`Vê(v¬mÃà`¢Ÿî®÷BŸcYs…9Zbr°u³(°3øµ˜œ§IÃfw¿ûs* &Çø¨¢~?+žÔ¶¹KGÎ@}äÏØvg÷rlŽR€½T™`¸oLâ6)Q %h«‘õLô¶ RºMŽq3’ޤrÃo!Õ0¡¾&|SžDgg5SÕYbSÿÊÝÔÄÊ s`«‹ÃŠH–dhøK¸iç9ÕKÙ@îù¾)Mù7ÜTáÔîÑÅUˆê-ÍÃIõxXK4µµ$K‚º×È$“Á ‰Ü&ÞÔfü°x]Ygs•†QŠK\‘L3»È©åΡAöÖ÷;ö¡ *oТæí‡1ü«‡×ç;¤€áÎd£}­_Zœ\Obnúý_Ö¸¨`†‘­Jå³ù³4!«•¢,w¥~_;éÜÔª½aPf©­´XÄÓOe©J]ÛµŠÔ‚³Ó<L®¼äëº$Ÿ´›1p‡- ¼á’‡ð†Š ”ˆŠ|ΠlXÉ -dLÈŒ"²¾7š‡ £ýkêËQñ,"r &ÞLôɉ3÷™D ]—mÍÚꯨµYµóxÁ‚rFËJ=­ÜùŒ o|—|ž˜rGER‚¨<Ž‹ÅÂÌäýÊo=˜µa#Q¬Æ[·rÕù;‰1N¤XIݵ«IRȤA¹;¼ìLx ø ¶æ§ÔàÎê‹ÆŸÈm¿/ȧÖÿ|UÝ~"éUW¾çså3¨`N\o[ÏÇcLøþÇ7{ñ\?.Å>ÄGÒ§ÓôºÐë!ÇÛƒK2°Ûq 4·ÍÆŽá©’°AÏÏ÷ó#9t2Ê¥˜è–<‚æá$)”ÎIàe€ƒ6P¸ÑåCëØ„¦p®ÖÅz°!¾yaé` ûBô©ùûÿWˆ»V S5MI¯øaœ¾\GÜIªo”Tu— ñÀ'!1ojQï"°˱g(Œ†Ÿˆú´ÉLÑ[ºeh9҈ʚðKDŠ-£4¤˜ìpyÔ»šžó­"×EJøÇ¥•؜ʻ5¤iÞ¬j¯}ÕÇ·¶9 í[îäÇoÞš#+hEJ2&Ðé’-+™s3’N¦9–°?ušpõ/Š=Åþ$gƒÝñí0äi=†|”0cäÉ–ª‹˜Uô£¼¨tQŠ@ùCû·'ùË{ç[¾ŠÈñ‚sŰ‹µ«['ƒV¨lÑLWŒG.ât¿Jež4‹V@_|£ƒj·ôÞµ”FWØp¿Þc\H©ýæê¨åeˆøWQwYö^#ƒ=/=ã­.bÔ1CÀÄ·\Â(¥ïIñ`¾6ãæf¢áLã`ÇnE©ó?PŒz»^ßóE p•3›´×¶®ÔQkH÷¢rUŸ7:áóOQ ¤¬= §±bœR*Ìs?l>÷ž£\7Bɨ¥lÿDõ{CÈ”,ÈÌ0]òÅÖùPǬoFòb›q (£g¨Ä›PWKKĉDv}•Ç6î;(EP¡ÞOaŒû,v7Pódë¶¼bÔ¡›…!(9í}gWe( î«H至&qÌPMäñýèzx¸ŸÚ¤ôY>]q~>~éÕ·ƒ?Zqš‘A +>þvþaê€Ù3(l\7Éá4×jo]:¬†w£äŽÝÜÔ×8ÿ¼ áú$˜€èûŽESöå‘|v€Õ5b5 g®´ÄŠÆÄawøèOb½¹gÊLu¹#Ù}¥ØhM„Ì7O‡nûƒÊuî%žBâÙ±7`8NÍ3UýÝ]R[²¶ôMí…åï5éUð!‰yÇ™€ÔGèš·¨w!ŒÀ["¾Wž3Ñ‘;µY†üÏOêhé¹ ¨Ú¹–u¢>8Cþ/Ìâ9›<Ëç‰Ð™®æ²…‡A½Ÿ 7J`‘¨7òÝ™KÕgu :4÷9ƒÛ-Ã÷qLš­]…è|,B[T÷Q„œ½¿þù´*Mþ6­ 6c_ô%Î/u|ôVâfåXçJ#ñù&B‹«•Œ>J G¿æ©¼•¤¦o¬Ÿ)åít¸ÒÑ4o³ï´ä³B¤"¾»xߊ F¢lé6ÁÊh1æ’áhWÝ8Ù`(F©zbÏu¡,/Ý¢GGbXÎ~Oc–Tª†c¡QeªåE§Ó¥T&ç½zÜ“[n:[6K) w—Þ*tØwù±¿„’dñ”›ÑÜüA¹&>^ôÖ²,1Oj/ÛˆR-êˆ@ÓP•vßì¿¥Xºz BK¹V"Ї~¿»ƒi²™°# æ§ÈúªW¢³$VõÖòݪ-«Ì)“ )Qæ´Ëu…R” Ö8fF¡}µOÖûn|àã~¢ç'À Çî°'ÊÒsÞ׃|´¾q ‰À+Þi¬£œV,k§‘~¢²Õ†Qî+<ù›*i!ÓŽÔE"Ýž£hiGÆJAí»¦çc\ÝÉG¬†BSÄI „†… ÆCâi`,ãD·ˆyÅ&gù{aÜÚöÄÃçŸOÅá‹Ææu†K\RdšP˜\n“(é³ ì³œ*7¾“ÔP˃fà/4æXj¬qœŠTÇÖßaNÐëáM?;ÜÉùÉÓöL Vû¬ë9PL%pD°S˜ø¿BêW.« ºçÑ[Чée22§¯©©#òbæ­Äà­J­Ÿ–®¹(7NIvm°¤~ªûEàGQÞÁ×¼et$€±jÈY|(ølý#tq÷ScJߢBz±êï¤)ÑbÈ&bÛlÑ‘´H—$ú)ÿKeÒ©ýíØGÆM„´ßa1ü•†`,ãvç®ÚhèHsçþp”exI}“…«8­öŠ©]>‡ŠQ¢Ž” Ï@”ƒ€hô y¸ðHý¬h·Ãµ—}šL WF¿Q§ù0åo$Êà¨;´©+:4ERç%K²VÙØ|îfس GØópšæù2áQ¢U Ç*z*n6n)Ú%ªp”ï­Ö#‚§ÇŸ[Î:|I·Z=«7~Fœ}e- · æÌ,{]Lùøvï1ñÇ–"%%#!ãã ô¦Wܨ‚i|½›(ÓÐ[˜G."‹\ÊÜ"eôèz”™³¬Ä}_’²1qÖî\•X&ö<‹Áüw›åݳmœü5}~ç´zÛ‘² ¥ Ö _ÆÝ„vÄŠ®‚<õ^¯ÍèšÛ˜öq„ÊÈMKiÝÆóI6]`ŽK O“jTûTâž\]¶=¦·—á‚cc]ñ¶ù DŒ¢ §èТ¿M0MÁˆ¼uy7ë‰gʇ¤ÊsËoš,’1ܧwZ#™F1Ío qFÑLƒhßǼãÓGÉ×±¿yÿôí›z?+°Ïm-â‹ ÝTUÊd_ˆ+²nÑÀ dºb(h3çeûê¤ßOÖîÿ2îF;¶`°¾ãzØvq…}œ7Ö¼`"ìl3œJ îo™·Ò ”ÎkQšîþ˜n¯¬Á1UË5EÊÊËY¥ 2NA—9âÞR Ï4ß+D&"e_T³O^Ãy ¯R&mÖ¶ Q&ÿfUª©iØZêãÁòy!ýƒÿ' Ì@@g°ƒ‰³-ÒÿuœÓ endstream endobj 12 0 obj << /Type/FontDescriptor /CapHeight 850 /Ascent 850 /Descent -200 /FontBBox[-251 -250 1009 969] /FontName/JAABHJ+CMR10 /ItalicAngle 0 /StemV 69 /FontFile 11 0 R /Flags 4 >> endobj 11 0 obj << /Filter[/FlateDecode] /Length1 720 /Length2 13442 /Length3 533 /Length 14002 >> stream xÚí·StfßÖîÛV%o¬ŠmÛ¶óƶS±mÛ¶Q±mÛ§âdÿ×ZçÛ§oŸ›ÝöÝigÎÙf£÷g>ã7ûè7ƒœXQ…NÈÔÞ(noçBÇDÏÄ ‘Sfb0Ñ32 Ñ“‹8\,ííD\€Ü&..f€8ÐøŸÁ?7+739@ÄÞÁÓÉÒÜÂ@%Bý/@Èèdibd3r±ÚþcbbdP±7±ºxÒB66å}â P:Ü€¦ôppLLSK€1ÐÜÒŽá_TRvföŽÿ„M]þ+åtrþ‡ @õoRjÀ?œ¦öv6žS ƒ¼ý?ëÿ¡ùßûáúïæâ®66òF¶ÿ²ÿW­þ—´‘­¥çÿ%°·upu:äìMNvÿ]ªü›ÐÔÒÕö¿g¥\Œl,M„ìÌm€Æÿ„,Å-=€¦Š–.&3#gà¿ã@;ÓÿñOåþÀ -$$,)MûŸmýORÑÈÒÎEÕÓáÚþKýï9Óÿ=ÿ§ Ç«ÍЋô¢éK¤á–Í,¯ôÑHÞ¦@†©¸*HØ¿ôPVg¢”.L4ñ»uZÔvsrs3ë;嘸˜?á!^} Z¹ÝÎU¨g(ÈÛP'½_sH¯h[®"oÚ5“Ôyó/¥†|ŠN|éc aq7ík‰ƒ®ðú¥ÿúá..!â>“ô‚ñ ÷¾¼ùå® ™àÕai’îg÷A'ñ¦~UkJ¢‘®¬î?tckï8èPu? äÐ-çÕ Hû©0*23 Ÿ<ëæèÒÔ?veÙG˜·Û<ú'íÊ|ÍãBncl¢„äs$‰î™¸ï…£J½EbÉ3Qˆ Ñ,1!n6R'ÓcÅ$²Æ§Yœ.ÌåÊy>˜2. /È2Íz¿Î`ÿªüãS3çæçiüò$±V‡ K´sð¤ÅolO48‹¾Bø ¾hpôt¿+úÊŸ¨³kœ'•’å¹¶;oûõ½ia`jV©NÚÑw5âïÊI Πªµ#Ȫ²|RwnœFO2âEmà˜Ív½JC Ua%,¹3´¦”ÐR81Îù~Hœf7™µ©o‰U¢¼0ï‘Áˆ(:-ÎexÿMBæõ‹S螘{.b>}U£òš% QÉö2xQ¯ÕÀÅ‚qÿ9°^5êa3¢È«ùÔ}¿ÅÜ2äjlQ´—=eï+•­‰EF1áK‚ [Òþ¦“¯3:OBY«gU¿êå˃õAfÆô,þ‰¬8Ë¢ ¨÷(ÇSóùMCòyó ŽN°Ã$\Õÿg¿;GÝT°ûJØZ÷bzYfîÀÀ:gímˆHŒgÊÛ}ÿ¤ºŽ£;µÿÏŠæÃòu ¼ÏyƒÂlÝ2±=Åå;²‘¦]£BÔª‘]×W’‡c8Ù”ºAœdn¦Zþ‹ adF}Í9åwè•?³Üx ë*º>ãý¾mÒêfBªÒžcyàýn±Æ"ô»’ Í*’ D)oA ô‡Õ#4E/(嚥K3ÅcÄ·q /nè'D䪩êí¾•¡! Wg—IpÈ®êùe›‰”£f‰Íéã¦Ç¥­ñ 6JĨiDIœÊC{·¦òE{]¨[5›>+ÇÙœ) 3ÉAœ^:~i{?yœ©y€N¹úÞ1xv~²#¶5¡LÄý`DÅàÍ? =ÖT7‹ÓaÛÅ€ÚO38ôÉÄ:\´km/ëz•®j6ôìá:N¨TÚç*ɱözfq‰¸j7´HE¸ÎV=á¼?™%”Ø"ìD5%—ÈÀr=>üÓØŽÚ"gY¡˜¥Ã‚ý}ÍG/`èÞ+,H1Ç@X}Ô+D7­8gÇnÉLJ弆ÄoìÀÈÁÔ[ú©ç&(~½h5ª©VA#«áŒÙ²S6íæã—p*x²>™´Ä-™ F¼ƒ„O×›"ÿˆÑ¡ÇC BýôÑ{NYIʘ¹@òÊšeSsš?Ÿ•l(¨»Óžugäý“ÚëÉ8Y“Ô?:å©[”î²I®dõÜÌp&Ww>3¸Rõ‘Å~ÌDz~²›,Cq±lPe%aÕ;ŸiLpì‘›áÃ%ûP–2aÛØ'ßÅ•Ëdá8-YÊV­vÜþSòâ³1/²;&!‰n¹žx¹.sÃë„»—fE j<ÜõVÁµÓ—‘›gq_i/É+ ·ýÅe¤"ç}L¥oðU)¯0üqÞCY7ÙSÈC—îV¾6;E¿L¼ç6¶Œ¡ãÈaC¬˜•r9õáäB„±ÓFŠ“tËÞýgîþåâÖ™¢/mÐÉEë*â µXŸ¯a„O"ζäé$HŠó† ?™¼œÒåpâü.>§—ø:„Ÿ²]V¤)ï@¢}?…Ó4ŽÌ–YE£Pœ]'‹}ËbzõH.cÍÆ”ØðÁaK¯"Ùèå#Ú€ )Ç=žÝõd¦}jzà ì,&3šÜ BoíÙÕ>yêÇä16÷Ú¢Ï_R[—gÑvŽˆ«žõ˜½jËŒùRócbOŒ?¤©wmpÉަp£a1þ¼ýÜt(a°öHG‹^¾¦ tAÇÿ­;“áM69#O “UÏW~³H£´9í´Ó猽å“t"[n?Œ—þrvѧO?®äí|d¿©ÿÃ]Ô|8õ÷­÷ôX^A°Þ•ü*Œ¬Õ²õ-mKvE1*äá§ P‘qîcKÒ5Úc-ûÙ„’÷'J×—qLÞ+]’n+Ó# ß§Íp²t}_h×a~#ÝÛJ!‚ûtî7Di׉Ãÿ"L•œ®Óߪ‹šÃx,¸eÍaù–¿~Ù…~f™;ìŸï—䆢o0« âõ'ÕqÌ\#Dé˜þfA›ÝwÁç¶‘k h¹ –œ#K#»ükóUr5ÀþS£ö)ËŒìpòÜø½qè! ÃëXƒÛ’?’’4b+Ÿ6.Ê#íZŽ!‚Hƒš¯a©¸û gä°,wzÞ…é2¨¹€e†kÜôÔ©®v˃ž©†²­:ë#“¡¬­%½”ôè`Ìå2/앦ý}L"9ê=é¿ßïeƒòe¨Ë\T¢mH£m\·LË[WùÔ¼Ÿ§*)4ëæ©•HDþŽ÷$þðâ‹’ªÛÇÙ€¼t¦žÂB8çìÚS F‘'cñ.wNÐ}çzbXalþêÑÏyšYª­v0„ „¦.V£Œ•¦Ñµc®úeR ë@˜üh}nsÕQ›â,™/ð|N§´ïjWfTŒ¿Á:¬|{’|:Ò4F;êéópÅP/Þ b,ø‡–ì¦ÔîVyÆUÂi-ÖäÛ¼Ë<ÖµKó÷cÍ©fš,õõ”QzÑõðMuệæ®Û¶xg…cY[ üõ.ëˆÒîáÀs+ piIÔú"hJ%3TÁ:…•TqÝ«Ëd9願$(¹_Š}Há4·\Bê›{yˆaÝK6ôvÓ¬¨'ŽÍW£ŽêšPË—ƒp«SôŽŠ2¡Ïo#,­ÅmDQ´rfÙ´ùN Û<ØsæjT¥( áŠîxkÌÝylmU0*"Å¢ãs‘ìþ'ÒèÝHY¸›òʈÄno.Ǥ( àž±Ñ40X$$xP*¸þ2|Ë«Q'“PlYœÜ®ÉÞžõ`6Ê–‚óºû^dò‡8GÓ²cøû%3)”³é%«+•ãSݭذ4Àà•„F5­D#ZµÔ‘•º¾G\X‘’ŽaÉh½‰=f\2š…CQÌjûPH[ ]Ó šÔ\ÆHK~ÐXMy¼@2xhRj™ûµ{beØ6±nÜí$"ö ï1kxem†?°5Gõ¼ët«¢]þïpJ]îcÙJ’tb@+1ÄæÛbvNÖÛêÜ>Ÿð«³nv&„ÍTGɳÓ9´Jš¡œf€™bÏÄ}™ä™h‡æéËr 3áy´‡Qÿ…ƒÀ¦àr*²>Vè'E'ã-;÷Œ ãìYYÿ³ ³Q(ö¶6,/Ø]˜ÓOo bøÒ ™2Ô#œX>GrºhKsˆ˜9d“ϰ‡C"‹·÷Xž¶ðóÔýH‡×=ÝFShCY°Àa¼[ß!øùö´á£Žj5hællŠòÓQIp­jò”¾XÖøþ:ÐóVn8½æ§æW[s¥:ñ26R!-!uè¬]„yOÎ<Ï TœZë£ïR„JEYZôÏwkŠVï¤É‡A-ª0Ý’çZ=¢c¶(ñö2ÜSN»/wÛSy„xÇ\™z~jøófSaQÛ*' Çq{Ȥµ‘°„\7 £'Òjäj¦Jv#’&!¸›È$³6AgAš Ä »Ú±\{0.ä@@ÓÓ…”BŽ/g5$ÿïfoÌíÁvxÝÎfúOæ5ö¢v®cO"ѰEöÙY³úž”1baÉcK;Ô>î…+À¼Žv¤àS5°„j)ÂE$úNݵ«¤Ò ëܹ€ž˜aô·ôÌý‚ªÀ“–™Æ~“ÍpžÀÏßäK$ÍÂÁ½`¦¹)Ê/0°Þr]ØøBóï¿&ùI¦R±oò.\ó< »†ò{LÓ¸<{È4èF`ô¼Æ´¯Ëÿù{v7/8oÿE‘8 ؼl›X:RQÛ”8ß‹E¿êuÎùªs,hšF¤Á ¡‹Ž|ýÓ'IþoJ@G†ÒŸêLòG×oëN‘V§æXÙÈœµwœW9릴ЬÏ2ÚžNŽ»,˜³§ß ~eà‰•ÝäæG³§Ÿ^XMÇ%%y?Ý»ÅJpD_ONŽÔZi¦`„âáo/½¹o-;Hçà0d!pÆPìvÇÍmD¨ô9â\e5AÙ˜ÆeÁ‰¢Ø(õ.ÇŒÀB+ï׆ b­ÃQŵhmîV 2ÈA¬5öÊ–¶;½(¯–Ý Å­—‰®­7>̼&^apYNõ"¸qfuká·Pàù’€LpiwÑvŠ1êß%$“¹Gz$ ±B&«ÔÉ„ã=d(ï~_9]í–Ú)¢þÝùµe~ù©–ø¤¾MÑ囹éןóМ£-‘m4H b¦ž×ð•ž5‘ (±ã¡í{²÷óáö•‘TäÂΨ`¶ »C$Éh4½bѨ¾ ï¾RωÆï¶Û/.é¤B=oÂLZõú©$²¨Žì6ÈQè^A %‡Ž(Œ«ùí­ý;rpaá,…låJ ‰^å”ñìçôß3E‰ÇKÐë[ÏLɯá3B Q¨ü5ˆ?ùÝmD¤¶a‘«Ï殢vÔÚ=tÙüýVû:Ç‹X…BuÊ:ØnÞ›§yhåqejtO‡öN¤¸èpT»'eåf†Ú¯²Ô:bºëíî ¼çO+¶0¢ñÛà0¤…|ÞÒ6ÑP&nç45ã߯:ªÖDj—vûÝgŒûæ$ræs/.eî3wãêŽôËÑ“Èõ‹Ánýx`Iô:öçØÆc±ƒE®ÐµŽo°»GÂp(`ÃïõX9ý ¾‘ çÒl¡G˜ãK<ÇÂüÉ?dnâŒ1¥‚®¯ý³ÛQXyÄ‘Ak®ÿ8kø^LBð?ƒº>~”÷ИB…úVì`·p„×÷Z„ý¤ÙºaEk[”O±~a×ÛÖ—ÇWåRppp›˜î„’Æ‘¹ñç‡'2uq°5Ü›¬ñud­Ó#\½¾ïÒ)p\úäÜës/àµýv³}0`•Nã—å8]©¨c‘FËßy㲺õÌÆ¤Ùμx÷Üó—a#Ïãr23ž$õç(Úöd°b)ð&/} :¶„–ñ|¥R­ªQ3MY´`¯lëÖ‘|V÷ù•¶QXÿ0- ÿolwÖ3K{ T§˜»õCЦhO=û+‹(m PYX³íÓ›·?˜sºô“ tÎ)l¶zBÂLX›ÎÔ5&D6ƒ…Øúq4)òŽ6JuýdæÕk‚`òæ7Rdfgʤñyà*exƒ܃£BWUÓðŠ®‹ÿO,õà\náïO•ª­™;÷š™¹ó%ö¾¡cv!˜q«¨Vv>«ã¥ÏzûÙüh¢¹ ü ˆºSå°…‘šv ¸®Sg3 L>¶ß‰7¢XðXz¥ÞÚLÚÝË5n›(¿˜ú{+ÂlCáܸÎàzB, É¢·NÚóÿL—AŸuajV\_Þ¥<Üçôò½6ªçvü¾¾C½Ä rïÝÆÝ§OÈ…aG{:|ܛ齚0ÍúùqHÍö{ÁùÛzá³0üÈk¦æ]šègl«¶ÚΛuv5¢"Nv{š·ÂƆ&ö•áŒÓÁÕn܈Õ3qð€s ºþP¯w‘\ }‚¢ú±´æøyYKÇ™A…’ñ˘¼e­‹ã¾0£÷&–?×ÝC<¿Sê»â5Ò”)ÒE\¢…{S6P‡sôŸ‰&Þ(È/D}sîVEÝÿR…ÉèRw©çȲ—ŽKïë ±kÞöâªuë¶û)òn1œB—Ö×müâ'ç*ÿٮ९ÂbûP?H‡Äc ^Ré=/à³ïŸOS tÛ7r,YZù¨,ù~zFÈÐm~¡Šªš©Îäu}â—h[ÙwâéFÌ5{éBbšäÚÌwèºöùÃÒ;Ä›YGÌ[ÔÀì ®™Qè¶Æ”H&P9§+ãœb‡Ü(“ømHzù&=/Ö— ÂØ&H”Ýú·êKÖ_YÔZöyŸý†¼E«IpÍQäyÓ6"q‚z,ˆCm0¨˜ð?¹ òí8ç¹¢)ÚíÐóò c&îüávJ±5@޳ׂèó3[1á“s" &§õEšíIæ”OÊOÒ‹VÌa#¼y¹­œ7·»ÙðQSÀãÝiò:@ˆ…&WN쮪ûÜKO§5(Ü,&ÕŸÖ#½?´¿àŸÅß½ µ sj0 Ë6)À¸k|ZÉe•¢ó Ëgd@³ çûô‹ØÃFü•PR»DD‚¨jÊš…6—ëu7×~ùFàT2oUø'o5ú´"ºqןð¤”G½%Iê3±Ô=X€ ylàcß;è,©Í£mé-ñ.1‚õòyO%Š×@:´¸¿ à9£ˆÔ”g\Ñhé5Þv ¤p¹SAøý$ˆÛ«¯°Gp™5ÅLÓ¬»ÝÎÛn![$ˆ°à²Ql±[Lî¬óv•uoÊ:Gß,A.’•R÷‹c«i£Ý3€Ýa@¸Ô¨ïJ¼g0_¤”ÝÏ*tàCVÂêQ€_¡E½î&ä…&£¾µï†Nå-_ËÜÐÇ7§&ò·WõëH›NŒbqaœÍiÕÈ|–2׎/k«1ˆ6ò"îlè/­•>ºèWàÄàp¬ÿv[(ÈjòhªµQ_+d*på÷¥<^lTª£߯¯¾g„,ïsñ¹±8RŒ´Î†ÊSK¾ÊìTEEèµÂ'µ’„Jóâ@îX„.–³åõ£‹²;ê¯`æ+4v¥)ÃÒƒΓ•·¯(ÍÊÒŪö©ªÕÒRºk »#±šA…¢¬mkà]®4NoZ±^÷do—.G!¢O£Ã@,±¿¨LÜ¡=è±ÛÁY5ð?:eóz¡&iQ±óµ²ø‚¤eÖ‹S°·ƒûzrÓ±á>l0_\Ü ^ÇŸ˜ž^»=Tš¹Ãµ®rð†i´,¦Öv#¹ƒ¸v9 ¦€¿¯4É=}nš¨Õ^Ú‡/)/zžqz“”}«¯h ‡GçÓ®S¶q§&)œ2„8.7¦-§Dõ°Ôê¼?Ptެlßg‚ìžM9t¿¡f‡´ª^—2·Q†)AákD¹-4tjÒ÷4¡SËv~4‰e‰´Ãoçùæš5‹mÚf•øeìlWŠüù®ZYàiÿ0ªâz%~6ÝkÃÉO°MæçÊ‹]LÖ^-ìÇYN²O@“ šè\úœ¼›ª‡h¶¼ÌKp%øä½‚qZo³†¯Óß7ÌAIƾƒîÊmOrl˜VÒ í¬sbžCº-ùb÷³ò5žÅn2÷ÑY,¯½‰ª‘Øš=óÅÙkÑ ’Ç•ëÈêbÎg›S8ù§\;ùïþ¢žCé¸r­OÃOÈ´ÌUEÇ•ºLã[Í—*TÞªsÝO¿VV ç1]óXø¬ØÏ‡º3Å㹿oõx5Ûr—2 B{¹Ž·úäìÌ^wl‡'/±Qn^mhÅG‡=7Êrù&©ë…_ù~j²OÐraz&Kô¡©cÛ zID*;>o(á>E«a 6 ôs¨£~•¤Ó‹òjŒ¥î(f`ÊBýZÎô›z80J'€LGP´ºþÀÚÝ¡áá’b‡ƒÊÎKÒc`Öªä[d-üÈ%Š•$v?_—•£ÈgP‰äÈB™ÑZ¼žVâg^÷L·æJ]V‚,"ÝÍm9#ìW¿R5û¾ó°AÒ4ˆ58.œx×°G…ïµÛüàØ#|œf8$ˆ{dQÒÓ›]ÑQbxƒ±b JÓé'ýº°›¨riÛ ¬àuÒü…7¿@iÎ!9l–ó¨VðêH5A‰: ‹4XîP*Ecq£˜Ÿˆ«L䈔ÂHüʆŒ7MdFÞÑ$"XŒiɸ¬5Yo1´3á郪ˆîëÃË ¨æ|õ”3{š=iñHÒ_fœºo>|ƒÕêˆtÀÄëP#?ÊËsðè9© Þ®oppVªèó››Þ¾h"h™$´á¶9 gЯ„ßʘ-!o˜é-V›P°V÷’@¾èÙ9 ûÿà]_S˜¾ÈôɈ"î’úõ ×ÅgÆD£¥åÌZö3ǘ_ý‡óÅÞ¤;Go¾™];ô®ëz+ºF®ÄÜ墎Öm¥ºü¬UåŽÉŠU9ª»ü`üœXtÀŒ©.Qf $-ÜÝèl ¬kO7àNô`¬ó$˼̉¶žy¾)BÀ‡¸ÕHâ· æHM9NâÃWb?Þíýžl2VY·ÂŸ0fטÅÓm‘§Ìq_ µCÝ¥ÀäYa˜^{í$_g»ÒŸï ÖˆFdˆ(ÌÍa¬šþ·Ï7W{ãÆ„çÞ¤ãËæ¡•ÎI¾Ýö£É?‹^!ë´ƒNÚ¸œÈW4†8òÝ7y)Ѥj´á}3ÝCk° m÷Òï‚X)yO9u•J€"סqD©×F’ˆ¶!ÊÅ‚çN(g«Vžö­]æ÷Œ< ”VÜÅHV ‰úúc!q&J–ûk•Ÿ)-?ðöý­Í>E<»†_’ÐÆÞ$&@k£¿‡¦?bÐ!?ý;‚%ìÇŸFae¼$gØ¥æ•D(üô=®U’Œ8ždö0>‹E˜5êô _7£!-/µ¤I¢8§€=÷{6¤É3±…¥Ú6 B+‰Jgû%¦ æ_¤ÉgüЃÔkX'•çž[j›„žœ4²mI›¹ŽW~õÐÞÙ˜%B Ÿ m2n¸~©ˆÚöZ½­¬eV‘÷âx‹?—9Ëeb¸ºÿø8Í´=/^xV~°ƒþÂÈ¿mÐÖÚßY¥##o)y¿Áh `±—ÄyL`ùì74Ëk-¨/âñ[óYX:Þ:; )‰G¡Y(”抰¼zWY­¤kŸå×YîD:ቻE‘Œ1ÂÜHá?™€¬æU¯½¤Gº"nBñàZ&²ç`¹«?«çîx™¨…CÆÉ‚a™Tóð?²™f‡oÒÝÅ{ª´ï™ñûH¾£áâAøÐØñ¸ÈÓÕQëüÌið$º¥ì òflËTò¼¾©‚,&Ü7OÓ$†vìc!‘àmÔ_üÑLzzü›ºNèv‘•ÏÌç¨w×ê»ÒÏy»E:tÌ÷—D¨²+Ø1×»oeG™v®‹‡å¾½¯G…}¦ã{-q:+,C²Æ0ˆI󥤯Dêr„Ú9%¤@…} iqäK“Br‡Cgí¶™/Q~vŠÒC^¬{£„°_w`šÞˆXEhe“ÀćѯÎéëõ²Øàc à Ï>fÑ,f6:ËžEÂ2×^zãQ­k .IÔ”|ÁŠÆÍGg¤oœ·…¥|;ýàóÁ¦ÊfQ€<éÁüðáËtNüíw•u˜š½D0‚gjeâ&¥þ«.-$… œ¾Ò:ÝT•Ó…;ó‡¬õ÷}o£BÙ &²_OÐ%2»wî`ãó²z1þë~”×cŠ’<)K¸ÄQ SfY¹ß*¡Ë¶¯a´fÀq läRä3Ú:Öqä¸Ûd-o¨à˜æŒ1&RÀ5î>ï ×6·R°Ú剥$Mk<„;»C]YɈQ[¸Ö®zs3iVÉ/ÿßç¯ï«„7húrÕ¬0» djL€”å É 2ôegí«ºÆuŠJQámÐN­†‚¦«XøµâÓ-(µ‰{xÇÄÙ¾ùFÌã Ù E¨€¸6 (¹[›4~`ó‡4•&5ÙáOî¦ÖÏNÚQU •¯=Ù•Ë1,÷úâ@ÞŒcGxMßœK 1w£m‹û™af¨–{+ÐCMåñK/¥tziüØ"ÍÑ×'²¿R!6Ä5¤{òЏez£¯´@lÔeaO.]º¦T³8>$ÅšÂE¾˜ºSjéÞ÷¡©¡ÒCl¾Gà=m8ö3¤">á{âê<Â;˜ÀCÛÐ*ÛíN•驲.œ2s£ó½³qÇl­Ë=ª:çUð÷›¶Kú#å<÷ÒcfàͳÓÅ=Hñ2q>Ã)‚ˆp–ìB—p=­éÀA ×JðáßÑõ¯Å/xEŸö®¾ ÃÕN# ½ÄKûn}*Ž{ Ÿ¨+™†˜Zhné`äó¿ÂÜ8f+ (ÎzP Ô›÷›ãÔsÜešút~C”#¢§~&ª±µÈ€Åg½üÅ2å¹o56Óª;ÖN·ôœãuŽæl^ý…þ«Û6âJÒøl¼ØüÞ¬1[qu¡eŸÄý×#¼( °ßzÎl‹K—õc!áù‘*å’Ü¢CwÓ5¼é§o³÷Ú'ãÏSîúò;¤­[t¦…¸£ÎÑ1Ü >ëb•”纫<ÈŒ ý~uËã=’BÊ<â§B¢¹ˆédêŽfå5Î3süHÐB‚Q7ŽÂ_è³}'~ôàš3KØ:QvU Ú%skËgá^5T¼„ÞÐnår…“—ÊËÍ=ç¡>ø”¥4VDñ®æÅйÈfÄ© DDBu.Ót å5_âoÆhÖádžÚDâ\ 1·´›¡ÚíÔ%¼ðÞª"T@à•ì‚@¸'µà[î/÷<ˆû_Õâ}ƒ/üƒŠãÖVÉwMŒûÞ üå¦X}aØ2sò=LNE² ºCæ³ãt½è5…óíOŒ,éV<ÝüvBpp2 ofÓ|“èÜAìÔ½P>ó m™‹c£¨’ŸÐ”PfÈ‘¨z©51ŵ9ÄWÔ8C‡ ÿZ6;Çö7¡@Ìxî×µ«ˆxd‰™Z»±÷5¢qÊ:Jÿâc¼ÝÁU“‹Ë¸]i ÷ÃhsreÀºÏKEû÷Ç1¦hv¹îÛì*ÜÓ…ëtCË4fÆ–™JH³nýŽz_q‹Q ±×}¶fÚo“Qæí"ˆyU_áϰZ†ó6ÓÖXÃ*1 ¾ª¯ÏTN1ÿ\ãwX_æ,¢PÉ ¿k˜¤Òîä dizSŒ€ž-_OfüÖ<ø{Óƒ’\ ú6<޲@€‡µ½Ò÷»ðÄG!ˆ¼EõwìÑ)¹c´Gôzfp*{Ú­1¢7ÜOI¶žÂ£^1"¸–Ðó BHb™îü_ÕÂÝÇaµ9Ì¿Nš¤Rrz6[¨êÒjÉ't?ææçN²pÂ4‘4£Ãny*Æeéq šŠ¬ÏØÁ¿¦Hæ³ }†Å´NÙ׆Áæßjár) F÷‚êÜ 7P§”d1³#‹Øµªs§¤çÆjÄa/!~—g¥u´i@ƒŠ'§èúUbC &ÏïåÐZ¾êAÂwC¡¤ìÄÔÔf»R<ŽXT[ÐÏÚ¥Ðõ­šÒÈ:Ï76»%¤±ß3ÌíÑ8È¿W §æ†÷¶XA—3§< ‚_Ÿ`ô7Lu¨]­æ †¹†PÏlH@ùÚY„=NC­ñšsK5óõ!\e9¶1¥«]¸&LÛüDãré;<81*ïñâkÛ × ¡§àåFìi[ó;à¯7ÇóQ@L¹KÁŽW÷[¬ }JBqÅÁFf_@7Io6pù38µ™€ƒz=œ¶â®ýf5.¤s¾‰ñ'Ke³‘FPå߯…ÂW¯„l¸x•´¯©Ñ‚þRÙ{m“(üƵûàm8øJGGºK£”?Èd‰.g_¾€nk}’°Nq3õ#tK^ãÞé 9X±]¬¨`ázl§<¢÷æê©zßXYF$8>¬ :¤Çš¬_Ÿ¥æäÕz`¦9.Lˆ= ­>Ý.o?¥ê ïÑLjxÅ4€æÙ…h¿Ó±´òÖ—Úž‹4#56„4naG=õý×0‡bb#èùçw ¡¶œUîcؽoÑgu=äì ¿‡ˆÿöä¿*s‘·*ÁTúÚÊ}ï3bHùl´§Nô‡€ASMÁçé²ñÐ}ŒV ??sºA²úSøb=Ó¶’DŸ¹¢1§¼WKľ×È>¹~rÏAi¦RØ ZÿMç¨\H´îŒS1²ò·,È Kéý:öøãY«#åÉVÀÏbâ1õŒÙþ¹2j(HgŸ·æ !Ã6aídÃåþ³·Ãà +Ó&áPhx\jN}‡9o¼zÝ{Ua˜EÙJoreþ8çk#”|¯è¡©~ºkênÊùqI›ßHÏêAÚÌ*x?Œð@ñ3v§dÊðÈBƒâ$FT{¤ñJ¢©‡â驈þEí—?a=Ï‚›6˜vSçS°Î»®ü#‚ÐúŸg¹âYƲÍÝ S**FÃóo¤@Á÷0ˆyeeF |OÌ uÂ`n/ƒ" $B%üÚ»¤žihµ¡Lľ²Ã¢«âé“Z—WÅ‚€üS lâãúX®`®r$ºXüÈœ2/,ñÚ¿Ù]"ç KL^O9\g­wEÇ ]¯ÊV>å Ž·!Ì?çÖ§÷X’ó&ëî£ËÇ”ä÷vײàhH¨U©½d„í0÷¿†nϵ±0 ô°ãjï§ Ö×`ÈQ"+,p" ËUÛ« ³2i>È–æP½3"ŠxÛ’ßѺD³yz®—gÀ ©ø3f|Ž_Túò'hÚÅWK³dèðŠý›*MW«¯ `{»É¸I»|¡ð.ü嶆£-FªŽÓ ’—bC„_ùqHCûhÓÈà÷”hóz`€VH£ÂÖ&)]pjN. )Š~‡¸¤Î?—ÄÛýÅÖÿ©:k7Û}ˆ#jË^kSóåWñkêöç² ÁÐkó~Žñ…õ;ENÁícÒßtqñWOg«´‹‰ywý3Q›‚…~îÅzá¦Æ<Ȇ¨¨±: u%Üý¼éµCg¶ÿO™Üzz—ŠŠ~±‚:ŠvNF‰ôNjA¶ToÔl@låÒ’q¨Krw˜q6uxDÇ¥F€èÜìEMe€Mº¶CO Ýœ^(¶ÿ|¨¬ué™å–WÂÙ¢léØҲð²+)”¡n¦Ú¼@ñBÝ” 2ýÜ`ðG)Žt³²^¸ Oÿ•„íV2C™ÿñÃ`S«wNú9ÅŸóQYaéVSôÎ\MŠLA¾¾°ö²blʲcÑ6Pà…éÇé]݆_˜B¸9¯ÜÇú3êWë¢Ã¶’è×$‘núx¥¹xà Ï!Òý£Ù¤ŒÐÌØŸØ²ã3«ùJF¢uæ½»ÌY¥?ªyÃó9¹ÉJéŠü1Y"åË<…;‘RLÛÅ ­¤ÂlT柟xDò›ÅÒÓ.…Šç(U Úa—,1ý>Üž|€´½èSRhñ-ŽÏç3øÄPßF^ÀB†j¨o“Öl— ÙEWôɽ<…oMd­Ía,B~P/7›-ûŠó)§9®êZßÊÁNt3Üx:Ó)Fké´™ÑËÞJJ*6‘v›E6nU_wFÅ„tjù`$¸Ä [Üdeû¤ÃîH‚hLÇ%œªj—}Ÿ×tsÆfv‚êí¤¹±8ýeò™Žn×j¥†™\÷tÌDÊP£YòãhSŠM£pÄ„È~d(`ƒR½¸dKdHQ«éÀ—ì<;iÉtõ ì›<ýÒÞø\½Évv„©M”á½+œ¸ÐÚ'Æ»ñ„«W‚„ñ—Eîê‘ã@„Ø?Z Т1^`GàˇW[ü ‹1_nBî¹i¿ -jÑt2eõúâ Õ˜Ï#1ä’Énp¡ö•0t¹æë7ÞßüQÔXMXüŸFãߨå^=öè êhCˆ)‚›ZûW"¡Û¿ñs “FÂp°òòI‹‰ú+„Á¡ã Ýœ£ÿ6bÖ…·uÓ¡ãƒB7å ¡M2Ó=(Ï6aå–냮ûª''ï œå­¦ ,L˜2îqzÒý¡p=sO¨âQç8ôweÔ®¯X‘‡˜¨\²¸¿?Íx;B!”ˆM ×ö3ç¶Ètð†kEš±6¶ü^ez:çxOÐzÍ̶´~Ͻæ™ïrÒtHYªí=“ä¸L9C—OXwé^5²PëL©¾Î@2O9âÝÛàò»™×0|<:C%·þèHþ&÷¢Î‘} À7yϲ¡¿d×ë’´•%v19IÓ!'É% ì4hëìž·ùL¿àLÝœÜiì´rTð넘pä{þùÖpcz‹;Ê™µæ æÊ ¢!< õôçW=…¬>£Q­ßœöÇùó¢4)ãáëŽ1ï{°°ÂH¹Ù(¼Ÿ‹ä MŒ§ þ›øç|±1CåÒ¾VšPh€qé®xùÇ»B©ëãÿá÷ÿüÂÀÄhääbokäd ÷?\ý•# endstream endobj 16 0 obj << /Type/FontDescriptor /CapHeight 850 /Ascent 850 /Descent -200 /FontBBox[-4 -235 731 800] /FontName/OGVQKY+CMTT10 /ItalicAngle 0 /StemV 69 /FontFile 15 0 R /Flags 4 >> endobj 15 0 obj << /Filter[/FlateDecode] /Length1 719 /Length2 14581 /Length3 533 /Length 15141 >> stream xÚí¶St.ßÖîgÆ¶ÞØ¶mÛ¶ùƶ3ã™dƶ5cÛv2cÛ:ÿµ¾ýíÓöÚûæ´swÚ©ª‹ê½?õŒßè5Z"'VR¥6s41—ptp£gf`æˆÊ«©13˜˜˜D`ÉÉE]ÌݬÄŒÝÌyÌÜÜ,a' €™‰‡åŸ – êèäåbmiå ¥þ—Š loîbmjì7v³2·ÿÇÄÔØ êhjmîæÅÛÙTþõˆ+@ÅÜÕÜÅÝÜŒ–™`fmê01·´v€eü–´ƒ…#€ó¿Òf@§ÿ.¹›»¸þàú7)5àN3G;/€™¹,£‚ã?ã™ÿCóÿìÿÀõŸæ@;;cûÙÿ»Yÿ[ÝØÞÚÎë(í€næ.yG3s‡ÿ”jšÿœ¼¹™5Ðþ?«ÒnÆv֦–væ¦ÿJY»JX{š›)Y»™ZÜ\€æÿN›;˜ý'Ã?û7£¢¤†²¬6íÿx¯ÿUU2¶vpSórúŸ¶ÿ’ÿ;fþ¿ãúãbí Ðeú§ÁÌÿÿ9ÿûNÿ?Fw0u4³v°¨º;˜»˜ýÏÄÿN%"âèéCÏ gaep²2¸˜˜üþW™ºƒµ3Ð\Z ÀÎÄÄÄÅÊòï¬)ÐÅÅÜÁíßëàŸùþwlaýOsÌÍ=ÍMaU•å©.¨Ö1™0 +)¨‚>J#ƒ‚ùÔ9¿ìø×ãÛÒ÷|ë(G7šma}É?ØQ› Oî«Þ¿'d¸èƒ3&üøÎ¤×»Æ“B½o4à„žQØêî×2Ø>²áŒ(í3mý‚© |:ŒÝˆ/Z~Dšn¿Y”?¨"[É0”V„Û.Þ—Öš*ÿ! ïk™³ß˜XÃØÈúŽ Uð”³}æú¾&O ´u…’ ÓàW¾¸®˜‚Ng¹¥£f6M#-Ò9‰‡ç "$ÂQˆEúžù3Õk¸—“sögó”! €W–Ë eÀ¿ãFøÀÇJ=æ2¬÷ê¦(¬þPè[šTö®¹Ð(ôÚ%<—»¨ä™ã‹ôÕ¢Œra×p=¯ýOùðk$Ø7;x´#çó»£ÐÓ3æ!ÐH- ÌoƒÞ›j2Õ/ú„ðwجi˜]·ËALN[•Ñ:ùìÓŒ`zMU7*ù»°oå~ÅèùeUêÔhl}êÎÕ²™¹æ_mnø«•YãBÇYpéM-<`TgyŶº4Îû×Jn,Ÿl;ðzX¼ öA+®Æ$„ÌÜò1àÿ)żè—x;á+çaÿ•cÞ ´Š|¦l÷WE‹@s»à=/Š…ÏYwŒÅ¼¸Ìz9`g‹¶¢¦Âs†“ûÅìÚ´ü€ËNNbfùÅ”.+Â)˜.´†“a¯Ò1{ßëo’ ‡‹ ¨íþìÒ•QÃuQV8^ØÒÜŸÚDŽé3¿a.ÈÜ0n€DÖ›‡*‚ã»ÊlL8{܈¶KO:7Ñà8]ž=V;·Œ Ú‚N~£¯ÔÒÖé_HÁ­7¢æ]ßÝk›vwù´e}“Ÿñ‹jÃq÷œqX¾n³¾³¼7¬—ãuœÎäqùuWU˜ë­“Ÿ Þ9óÊHoÔcI…ò\7ñÊØ²™¬JDõV)cês¢_-äè~eåbFð¤H·PɆ­Ë_¡ŒÙ@þ ¡fDÜX£{r«X®Â5|µøð,1’Ú¾„d7o6xêjë¿{òdyIÎdc(VD›—–7U*—ñN¤(ï·ÇùR} 5mƒüTµËÔŸÿ}Ž×IÖ Îså²5§}wRò"(ètÎ1­ÃUʰԕ²ŠÛ´~ß%2zØi­A²Ks±¢`/÷å¢*Wl’ømÈÂ7Õ.•™!hÁÕ²%M–±¥‰Fâ‚ü’씽ö·–2@õ`z@ÞN6vén’¢¶f:&¨6'—ÕŒ©$S·Ìl>ߕٹÜü5Á%ys;Vð 6¼hÁÉJibPMhsž‘ÉÅøïÓ[á†Tö«×XóY!ÅP¡­R/+¿Ä2‡~Áµ“Y,g¹ê«cÍ2…Ã¥êùÀÏîäÞÉÖìAfù\5J¹@‰²¡Iÿó#òí½±Е3äì§uQpŸ§@ýšßö@Hnœ?ÁÔò% ; ¡»7Er¶PX1A[¸¨Á<Á“Lj VTm\ˤAV!É$ªÛŸÙBØ:o ÓS¶,`ãWÂúH•'õ:˜Ó’Hq„u«:ˆX•£nÎR,Ù1ü;ˆ‘pM±–ÿËÖ£éHFóA 𤓑¶0QÄ^÷hs\éÄs"ìÓ´3y …Lúã*¨Ðc)¬Íaû®»®Ž;„}©9U°ÿ™3ÆyÈh‹¡v9Œ÷¶êMfYçÊ8ì³î¹˜]Xk¥¡ U …Åj"‹%E„£þÓ9;…ZÿYйΚƒ×IdØc LSGˆ†ÙbíßZêÙýíÜ<Úƒ_b7͇ÀƒUȪHNU@š„÷ùZí<`ÂN‘5OW!œyU<+Pö½c§r CHøn‚ÜBWn0òîfe…Ň &üf2{â•Î/|ô-ÎA<µ'\”·}ߘfhá¾þ;‰ñsýe,ÿµ„è*Ùì8ÀØg Ì‹gô‰‘t¥dˆbjÂÍõ.ãÔ•žÓôîÅÓ f!bXdŠ15Žö8ÚLɇ¾+ßg"%Kv°‰²ï¦O¼Ø&öMöîç .¥"¦ v¶Ub|”Òg²ËX·GaòØŒ¢¼£%rí˜UÀ?:sk¨ýø)ÐIRpb·OóÕ…@L©­¼Œ/‹sW‘‹©¸Øûš¿þ(Å àC©tM«wºõ„èfq‡ ªNú`†AO§Þïèºy&!SÌ¡:[íšsö©H0&ž„DÐãܾö±¤t 0RGÞá㎮–jä¬n\9 t²ó®ÞÍ`∮簢d`eˆUipa.áºÔŠ&zQB­Qb‡p)'•§%ò]5ûÅáÑ" =ï\kî©¡³èòìcBí£‹ÕÁóK± lc¥ òëN8D¥ÏÄG^×°ÑS'NÃËû»Š¶²ŒëÌb©r£Ë~¥Êµ|g+)ΛÂyûáO¯é Ö-üÏØ’à˜Ü?M´-Ф§³"Û$|-÷öŽ~Ô˜S?$±˜è`yöMÒCZz¬í¯Z”ÏÐ!äUGnV¿2ê¤#»p¥Ì:š/jΠñ ݘ€h·±Írû$EW¸z“ø¸w[—É-”H Å`” Ÿ¤Î¿#°°z~Y:@xOþrðT E‰Ú Ä2˜W_„IïøÛà'ºF‡è1µ–ã§Ü&Ù•zƒzääcÖ^Ê@µṀ“y¿â|þ†¶ ã+kuÆN `îJ½{ÚÿB¾Å§HOè 0xNä>û^CV¿EO½n–d^÷fOV_¸(ív&ÙrOسá/ऋþ=ø5¥ýò÷8õ]‹þáÝ•r.³Ðb{2ƒœ°ôgQçïÑþq—‡a°ñ3ÄË6¢*½üø„#,švIOƒ×TL ±xšõßD!~åë™ßâäâ!fɈÀˆ¥ /U-|2Ιå80TŸ<´ïÃ*JÝÝÙ!f*ênÛ¬‹;ŸVS]¬§\ÊÉ»ˆµ½²“TVüSÔy>½C¤ dÖAyqmÉ1#s>ÉÆôæ|#÷RӨ׋Ž_ºÁYæ˜}êõ©Íåq‚ÊÞ|ìõWú£'tªô¾5¿­žhÈ)ß1Mïћמ`ÙÃð hê^§ So:ëÅV V3JQ‘“…ò¦ø±•Ü«õëFKðþ£ÊÊ ‡hð¾2 í+"ÎTRBi"ü#8±|ãj®ÛÞªíØÈ‘ ~Ó)ך¡YúÊû¢j<‚íL–QüfòµkÝ}øLãb2–Óq³•P»âN§æàÙ¼/\Á“€ˆ†§Ç‹ƒ•ƒú/"¼ú_üšã NeCin”t°~{‹Y¬Eª·H;\ÅŸjO?‰KFü€«¥™mÁtJ,…q TLÄü-бâùM›éÉ’„ž2¾Ñ3¬F¦yeO”!ÿµŸj½ŒðN±*‹Ê{5 Ü›žE\{–úÑMmÍŃËçã3¯ÓPNÅÅ:MÌ«Næ¸H”´¿»ìÄëT„6Ù*móÏEˆñâÀ‹ï¹¸;¹Å‰Ô’ÝUƒÚ]OYþž×—–"‰'?ó´¥%_ »Ç`5ñd¯ÓÅæU|ë‘b=%èƒë€B¶ì›¥XØ.ËÒ0|hó%îªKƒŠ¬`ë¿å–ŸQÛ¢2áÎ0ð_®£*¢…™¸ß€­¿’½§[/í†{j(æ‚ÛvI+~,è†J? äZ(70{ôe†ˆ¨W˜›¦fàóõqÀÌž,Ns°~ãK…´kšO,ªo’'äû½/VÃÎàãIVÚô‘šßñ]«Êö~³N&pçª?BB¦rÒÞjKÛtŽƒ‘ƦÙìyÂ[‹1x³Ô†•î©@ùŒŠ¸ö̬¼(ÎGƒÑé zx ÙˆÏs›:Ï>'UÜ…Í!¿m©.`úóË&“úBú%¿×úO:ì€*û7ḷªc6MNË«³e]y!Gµ•ö:QT IgÁpt¹Ô½»%ØÑ…—È`ˆú1*±“À×õ•|òGã˜Ëý,»«?°1xO©ÂˆaUœÅé’<7tÇðä-*ºÆžvyÀI{ÍÛÁsi•gê÷\•8rV´ˆÝè„Y¯•=ºáD°ÍÇ4òjè7-úT÷•1¤ƒÖß*«Û"u_;ìì(‡Ûoª$ÈÝv^g)‚¤KdÉ~b ¥¦‡ÀáøŠÀ £¿>ÂÎ26Òl=ïN¢¹ôCí•ÈTQ]Üo¿~³qòÆBú¿@5£d@3Á§®muÁxÐ寑B‚PØ’܉ÂßhÂ0¡ªq¢à^Úõ9²å³ÔTh­ï1'oÄKZT ÇžàLÅ\Þ÷¦â„âmñÁÎJ¬'~18Y%ô¹_‡]Ý…¨b;žbé:Z”Á#£ -ÛWóæ…á—øÉŒ¢ÂDFs»!WþÍpC™;ÕCÝj ©â £R½²í鎢­QÔ7O¿ö–§ßºÚ¤¯X ˜K~IÉèpŽ ^0¨²Ì¢Zý2Åjwx¤”V\?ÄÊD¥'õØiGKö׃Ǘ¥ÜÐg$Ëtɨ°¼ªá0ˆ äç+|¢¤‚¹s]GÅø=±Üð(´ †;FDæso7URÓ¢«ƒfVÇÄMG"Ò¡zßDÚ…*H4uaW Ѫظññ_»›a+²q?(‰1Í2 M!çHN³kû@Y|ÅQ_zŽÕ•jiJëàoüÄ–•Æzä T„é‹.7a÷ñŠv RVQ:CÙ2ÇqHù´ys1Ô†æo\2-[J=„šø­ Ǩ>»,*{çÂø¤.0ÙDžÛ‰8àdA©æõü¤?Óå*´Ë]ê—ºAE-]Qô˸J“#vEè/ì]iwÁG-ŧ¥Íq»ûRŠw¦Ú b¾ OçgšÔ?‘7/Ý>:·è\s|Î Y/ëö_±5fv»§íÔχ-<LÝ9«+ñ…GdGOÎ:Ç9³ª³º)PÇŠ3Š\ü—¿í.D\ií™ÆÍ*¸ ß1&€¾Ðâ?Ä*îfŒhS\¸)¦˜íM”ŸZ@,Ø ú"þä>Ž£X}Àa3a²Õïù¹ÃUÁ¦ ‹Å±‡ÐgÚ @”;»˱ Î/åcštàý¸c°)6á¶èjúñêùðÊ&>ª\­|yõñæ T†;ñ÷Ó‡,Óç<7€<­ëÅÍw´àš„àêt„;š+ã‹K¡ŒD¹äh®„4žž>5d´O¶J{=S¬†&ÿ­ÐfÙä†ÉБv‰h ×" K—Nb²ÏÄuBô |@°Gƒ;ËŽ‚Bû…¤³ˆ\ÖhfVfçƒÆ¥‡¿Ïµ'¥“Ûf}G‹/ø‹Y.D‰!ÀˆÜC)“/SÚè1˜_Gh)©[o&t²¸Vò­tc\¿ÐhíMðÕÜeÞï{€ •§¹án 2ú2ië×Nã2>yÚkÎóÕOôÉßÔ.¹}cÖEª&§Íc¹¤çDx‚ 7 bäeœóèïwFŽ@@Ì–s=œwæYÓÇ»Š©l«¿¥ßWf^¤müµŠ$ÐÕí˜Y•׌õ¹X‹ú+þQìL[ßPÖè^’€ö³ô ê½yhñŸq¤Çè2¨Ç?’»ÙJ}x€’Ÿé„¶„íbµå>Lj#o製3Ãrm‚¨Õ"cÝ¥…Ççóæºß&qnÙ´L^æ÷XTU4™f= Kh1»¼¹Žöy¸—嘫JqžAû p8ú‘ºÁëò=t©¿©‹£<0ÀŸ Y`²|8kƒ/…å )ŽkÑ’¨oQÕcÞH4ÍñDŽ˜yN‘÷ÍOOÈk'¢?="ZÉÑ2bÄ?ØØTÞ‹ õ ׌cñHCÉTG3çF.BO‘ab¬­ŠQ$¹b­«Y„{£š¿¾Ò³µ,v™N‡Šµâ±ìÒrß¹ÄÿY8«rɪúÅ󖊃ÎiêËÕcÃì"ÅiF+E;ñ,‰GZ¬ÖNêÂSðù}P²ÛÛ܉G,’®BGÞ­Qg¯ÍטÂоPï"v p¿ kÉÄMüx;l5\@FïEEžÜ‰¿¨U5=ñ÷ÓkõÞY&N¶å¨J^v:ä%ÙÐPP[{Å¡í¦ßÖÉk˜,ÜÄÔ’»œ—SxÍØVäÁ¿æŸ¥·8IÏÐYfÈŸˆÒ¶eAÜ$Å¥ÿ…"e^º7þ{g,™Ÿœ¢¯¹|£‡ÛDrê‹Îç;¡ž·6”ž ’ú†sœX0, O—¾û=…”qFBa>Q‰T´Ù'§ÞþšåXÝ‚þ.Ö·¢ rÌëto9‚@Ï›>—¯º²GKÓÙñΠN 4Ë /¦³wÃòA%a8(qðA"­²ÕÊ£…}Õ:›:Vf!^ʃŠ-þ,æF—Á˜¨A”äÙ›u ?þPá8ÂJݱ’ÖŠz¹X€wÃÑSLV±•@óF,èíú6á¿ ÐÈ)hí2¿Qá\´;.Zþî´. ËàÝÍ=À@I‡ŽÎQcnÉÎ úå1µŸ•~„MË8”;#y¤:“»µq>‚FfÈZó÷jMY%‘éMeë`NBEåΑri-Ó9’ˆŒ.éñö­ýS4ùó¹Åv™N¡ ¯¶¡óSBdS¨t,å¬^¸NþÂ÷1vÒ•õD¢?ò¨œÓ^sšsû•§[/ nŠ©À‰´4k¦ã‹µGB”²ƒÖ–®©î¥L¸eeëMþï*6ì¬ëzˆÂÕ¶-aÀïö˜å¿z!V –_ÅÏè%»Ë¯À<¸‘L;Áɶt(O]04ÑÙÐñô˜ÞMHdäù¥ õ&†hÆ ËØ%$¼Ì–=›âáϾ3q!v‹yêBP7‹ÈH|Údå¡}È Wâ´&KY­dý†gÍúÁJqJ9: £Ÿ>jÈMöÓwíKsuÔF>ŒÝ¢i3 1 ú^³òÑ»væÌ¼“æêÊ¥œ[KFB 'jÑ=ø<“¥¿Ë¤\§þFé+aS@t Œp²ûèÀ±Lu"‹oX,®Äná”вN!˼¯1 „»iТ"«‹2•gІ«]^ýqØq¤vªÿ²—ÑÙgŒîi݇¿¨OÐoÙ":¯çlëHЇq‡Ûéj=ªˆ/ ÷ﻵºFƒŒðj•–ã„¶¶¯®@\ubŒàÁ5ÑfÕJuFm`=×v}IM¡rÓëKŸffÀ¹èm8äþ=iŒKãÓØ*㲨ü{0kvÑ£C‰œA(ÊðÒ®3·÷£…ŽåË®’³p ˨YøË0ìH„¢æ<>\fé´1«ö`ÑôóÄ!+Ç›>Â&á¶dÍnŠnèDD;ÿ5'ŠuÒ„[aä†aW<˜ÏOQï7læ”Ö¨KfÏÃÂô2Œd3u_Ò­åd„!ܰkǺ¬ž„¹ùã¼Ä ˆ]Ýû³¹¢Éy8j¤š,¼îÑ.‚6ö;.õK‚a0h7ñ9ÃÓWŽ(#4ñ>:Í´Á§RuŠœ¥F”|ëY0•¦m ®?¿^Ï>. ;dÏ)sAä¸ÎSg*¥ÅŽƒxÄVôK*ëÖl‹³ 2 §\gGÜ·ë¥ê-Іü]yñ§Ür’@ÕÔ,ÈëXWìÑÀC‡"‹& %øqey5¢“âK4ƒß; húÃÑyÅ邟fsðâ›6g êÇ”ŒäaÐô¤nêfÒ¤cñ`ò²€J•‹µ}©sûŸ4®&‡¸ÆÜÈÔŠŒ!\ÒK_¡Ï&úí+Q»Ü]¬¹Y–ŒÿüQ|áÝQA.Q[’Í…Xà;Ýä‡Yó1¤Å±TN€s9c&¡YE¸Ùô¸?²…mc1ª†‡Öî8=[F¶€‹š<×®Ü&ú0®(j¹—¾¼Ö‰×ñ6!„ Ù‰…™¼ÞóÄOs‚Ú[4á ½ÀwüÝZ[FÁ£ìwÂZ¾Šõ‚ ÑzŒü¦Â:C”FfÛ¨–4$…¢P55<ˆÁý~óçvŸt‰—ðyfÆi4…©¨¼ÜJ"úq³{BoˆÅâuFRñ#zµK-%;¥¬Ühä¼Sºà*¶Á#èZ¬¨cñžó<Á ½þ󟰔ó~q<æKH¢ „~ ‹¾Ÿ¤cl$!å1üž1À3fÿs¼'±ëX…ÖŽIÄrÜç…ï.1 ÕN${rsÒ½°_OCì —ÏQo:©W¢9&±dÆÐ®IîÊÍŸ$á¶´}O¦(E¨_Ò.–t "T&%ÏG¬&½˜ þ¶÷ÜŸqÒjcE©&Z¶hƒëÏ–èŸÅ >¦ƒ!Aêp¥±VõŒ %ÐáoÁ íö˜2nì†L‹Zºñ)vŸ\øSÅÃs >ùP” Ÿ[}¡{w/mé¸üPª~§ÑNØ‚(ý®F!a.Ȧjj!^Fnëá”Ü»äVGF½®µaZÊÉ$ä¯LŒð^¾TPRô4ËÃ÷êÝÛØ}.Çß‹Üo¬`Ô‘×–”‰ ïGÈå)çù1ø‚ê½;b¡ºkÛEñ xŠ´y„ª é·"²ÔÍM<æ©ÊKöý©ºßGhñöí–›…-×IøL­Š!ÄÐuÍr³Å²ûÝÔÀˆ‚Û¯4Q!p ÆÝÁ¦g½%˜lÙc:óf ‘z-=yÇñ0WšùxN•Éñ42 yÐ'·–z`´Eb ‘¼ÍÄ8»|‘-f½{}÷Ê¡’ Ð!Å˜ÍÆ±¤)NE©lWeÏ¥^íf6ds••þ~Š.S%*q %j”•A½:Eå’–€ŽÄë#gÃò n´8E:²±@Ô¼œ•A ÊVsǵ+Ó›,i?T)½³×¨®C I©Â|ò[+‘àkãë]$§qÓ »Î¶rÿ|”ùz¯l™ s4kTïª{´ŒRî'qAýiŒoÒ6ïQ5NÁLÏ æ(a˜¼Ðª¡ÃR'üêä¿(kýcjZ´Ÿ35×*aqÄwh‹w×6)fÑË'—Ò×lŸSŒµÜÐP,Öx°Ó­vgò›ÿd¼íäÑØsîWÁÛÙðìŒkº$×—ÛΫä k¨»–ññ'ÖY™›‰0Z³k›ØÉ‚MÂ%ýXn¹˜ÌžøÍ\ÍÅÄ¥‹yx ¹ßÁ„®ãzGÚN†ÛÑ –'%ð@=îìÄWÈüâ޽ˌÛü)âäÌ5 .›››>ðæ'ùY3ñ×ìñÞ%¹°Ì_lc¤wʹh¿ /~è”ìqošýlƒÃ<†™ µz®×ˆÔèžï}ö´ŒÿÕrª§êZ«j,‘®~×È0OHål VO36B! ¥¤ø›D#ôᮣìÝYárÇH¯7ÔŸN#›$$®5‰Ä/O5ñÕnyþË</¤Üwä:ÉûlWÐýÀH’_cúqÚ‹^Ê;"-yy¡z‘•A‹)é×¥¿aì!²fX53ÒY3 )0UDõëBOÿZ1QBÇœ'ÅŒ’ÝÍÉIU逵¿K&ïÅMýv.#äoã¶<ª“Y&^ÞÙÃÌ¢Ì"ˆÏÙE–d¨’ú#‰Uz(ÚÏ|STšJ5r¦yÛo¡‡Ï‡©t±í P ÷+zÈ ×2$ÞPH¼tü"¡(-ó2 Éӥ󨆇†eò𗯕ö$êo^_Èæ .…„ÄO· ä0!vó€“î¶ÈÖ…A0Æ!´j±‹/E²†¾S[÷ØÕzpyp¶Üi½Sž+â×[lzóu“êšw˜JpÍËÍqko¾>ŒGî«ððùŠGßó&øèZ½<=Û^ ³û³HlÙ»*Ü$z‰°,vFFxÕ …¨ÕW¡CdÚ>4gˆpTüðÖæ†þ*l³…'´÷’ *vuã¦ø¤¼¯MLÆ¿Œûò#UÕÆä0Ó°=m蟽h¤&ön§€q®söG<‘ï/T¥¯„Ø&±ˆJÝT«zpÊŽ‹Š‘Þ~Z¤ŽSŽØOÆF8ª¨}8ÉS.SÃ;üEÚºÇé=Ä»Ÿzì³L:Ù‰hoFÐø†}¤ÖãhVü¸£ÂÔ¥60Z'‚Îã§µÓv&ëÉZœ—j|‰?Õþ,@Üi!>ÌÇnST;Ãf¦PB‘d;{F Œ2¡mŒ¡V6å&¬\ª¬{~MÏ=ˆÜ˜JkpºãÆ ÁŸ_ýaž_m²Ô€Íc 8 ŒBÍ·6už$'ó^ûzÐöÖRjê]¹ £9ÊV†Ãè*TPž ð÷= ˜!š_Á®[Ã_È ¾¼È?\fÀÔF£o¡ hûÌ\Kª\rr¯Î‹ÖØýIê›î‡NF:'¤ ÀRG=¹ôúÉ#*u‹zho¬Œ 7¼Œ‚ý(Øc›"¢Á©, %@€¦&‹åK}#ô‹¸ã–‚;QÿÛíR<Ô–i0¶Æ÷là ¥ý"%vûgÿ³—°z¢þRJPSl’9uÇ"EpO¡Ï\}|ŽÜiû<ï61!îRØÐÐK˜`ar:X5Ó˜ò†úËúžËSÄ#ìXßÔÁߦ’xÚ •ÜÌ7—/Qû>"½ˆ3g-mªh¬Òy"ôÆ3Ä9pÌdžÌ2K­{îÈ©ôòžµt—^6 mK©i¬2ö Rz ŠnVcLˆ77è·™Î'³‘äí+w™ *ˆè7AnV G§ž= ôŸþeÊåñá„Ù2t6v”Õ½\榘Ÿ}Q±gËéÜ»ÕUìË{ƒ’Ð0Ñ\F«øc ÷²¹qØŽÞÚ3w»YÔÝsüœ}ͺIk†¼OÙxªè¨¹{v§‚’×¼XPõ*W_ïN“¢)Œa ìŠKæª-éFº¥wc¦pšR5d ,:`š$mÜ¡~Ä—â˜JS‰û´8X¢èKâ_•suiý§ó¢²Ä’ó9„RÇ(”¦ÒF¿ïð÷Ô!tÀMLZç(GÁ˜p„ÊÑl—lx[‚ÂnÌÃ%‘íD"NR+£&†»¤LЊ*ª ECïÍG€& & ïøüû­YïÊ–fŒJópÓ6ƒ¾ØÍ‡ÿçMàŒógr ÎÖ†ú´ Ï´ÄŠÙÒÑû`®‘™Ðª§ÅöYúOäçøÚ&…‘6{®¤5'<^?Eð§€ì©R>ãÁ>Œ…Ö3÷À|…ž±J¸ ,º&½ ?4â×t^Pµ(Òï¥Vòöz§ŸjrCB5Hˆá#T 2µ[nUK cËRƒj|;¥fáõ»´n8møÀ]d8_þêʽ>,L)Ó²ò%}‡b¡ dY°È‚%Ã[çCÒàa&“Oû½cõ¬.ÂïÎ-.ÏâìjVÕ¢ªLøˆæø…Ĥκ&¤ÉT›c¯Ï @V¡þ)9•••ÿÇ•µ 0¼NÈ nËB¡‡½ÍP]«vYò·OËiz2Úz4©“øúÖÝì¥Ì>! ø ¯ÕŽî…[\½?âšÉ=¥Š‘_ñ3Kœ25˧*&´²Àžý~¿Ü¡”Ž×c’§²ø™YT¬ ¾äg©™H.ýOÇé¡ 6D7ɲ.Ü *X–™2˜ÃÎz‘ìµvûÜWÙ¦54ù>_ã;,ƒú}”ÓýÕѪB±á¬¥øf”©UçØghK®aÖN»kyx†¤w‚À;ŽÅöÇ‘AÍ®‹†¢¬dßü»¢ëõÊ¢C`vÑ9÷Ì®ªfßà=Î`– /y^çé©L=SBˆ9Ž¡j\¢tP^à·|Unc?÷Ä‘¸Cß*ÙÀ)±ÞRÄ<ï@‘çXbQZÅä£ÏAiîg޲…¬ƒ{Í& vŒäF‚üñ±"º[N8xC‡P,ƃÉ~D콑íûŸgÛã|ûG³-Ò>ÎTì…äHöQþû;6?OgëLm|”~ʳñ9((¢GQmqú ?µ)àMÅ +°tŒû¥pÔ®"¹YÅÕ>Ö÷ôˆ”>?~̉QÞŽ·¹ ˆ÷Ê„OÜ.Šð¸ü•¿ÄÏCÆ­˜/ÖVÜ¿ÙûÂ&,ÓîÝh{¥¿™Á¿°'plå¡­ÒöÂNJK L¤ ÐSʱbö2zƒ~@:Y925} ¿×•ŒQ˜ƒ¾KK=Aß}p‰áå-ˆ‚èŵ°{ê’›,©É[øçû‹Ðæ8Ò†Q È Qh<ÌDq¼ûø®×¢0&z%_Ú¹âE·zSw{TÌâÑ\“n nPAYÿ,¢3¤Äˆ@5©›§Þy› ŸˆÓ Cðü‹ïØbn9Õ§ÔÃNÊ©Å3½‘¯êVðƒ Ÿ't¥ÃO¼ž¾²»Oááe²ey¢ö ²•92d»‡zþWgÎKi†’wƒ»CHÓBóh€Ò±.ºfa[xž}gí >_bõ/M"]„Ï^N4dó 6.ºy!_,‚`¨z ÖRš»»k0¦‰+Ävj¢ÌŸÁŽ6¿´Ù{^ ¬23z?¾†¨ƒÆ~Ès°Vóö–qƒ®Á«,½AËD ~5$i,^`ÄŸ Ú£Sé.ä ïä8ÄCàœe¡)ž±Å×û{ø}mb«ÏßSÂ+ 5R“-½‡0Z| Ÿ²y5©'½< z, É÷¼¿cÃÂK§„ýj n#!l/ ¶ã( r²¬q?>˜1ÄÚWyA©›É$#Oˆ•Ë[¤ ¿5&¸ÑšÈîvÊAσ+‹©üf©Ð’ã6… À´(Åj¡Y`&V ÁÉ"Ï[Á“V8S³ë•V>Â`6Q5<žõx³A öÕç茤º« ^¯éÏ]ßžuåÔxשñetù@`Ï~ÙÒÊÒflõ–ùã.IH"àãoJPˆ Ô½@F5¢uèã´¸Žm†bN|j…3Òr ë¼Ùô…Â䱉¼K49©á(±Y;zÔ*—n›èpO)þñ" íÈß®NÇjR¨Âl©®›ž€r/ªüS6’ZL×,ô¡=œ»s€~`˜¬-'õòR²”çaRšÖg‡jc g}HíCßX¼ÿÖÐá!Ö‚Lü›ÿ¶œãO«ø±{Éßxèê—8>~Q+&gÿ«}«½ùj‹# þñOÝKviÅqN´kÙ“c4I¡0­ÞËÁb¹Œ&½Q{kqC ’šÞîCŒíErúS1 HPUD :Já¢ïöö¥Þ÷â(Dm• ß)÷¤nô ç'ñ¶ýœ›¦ìª_{޾+8 ›…Nr×VÓ;q¨Am;ó‘.?T%oVû±¾ÜB·䌺”cÓlħŒ'ég ftBÔì,„íÑÂØ’ކiZ–©NýÙ®#3…à'ÉÆŸ4>×ÜyׯŸêŠ"§x÷ʺ™`ùà¿æá¹qÑv}ܪÑ&Í«‘¹{—ÙÞèçôŠ~†½#uŒíªU%<~RI;y·’ÂÔÚ÷[Ðÿá?w_]šã¡¡”ÙG4±§¹9QØ.µÄse‰E)}Çj°»B`b-ÊŒ‚|Cô@Hª¦iTÙ ŒQÒ:ß«‚ã.ì>¢>^Ùá±!±ÅÞ¨½òAÛÝ·á¶Ê§G4-Ö¦ •N?‹Eü0{¥·ý%¯½¦.þöŒ½…¡—!/·ÝYD ‡MÞ*ƒ:!•(ç6g*üÞ†»^YÀn?±ä3£µ,<ÝêR+8"jÍ‚˜)6+u Ã)OcOYw*¸¶ÜÑÆz¶‡ÃJLæ+–%~kb–}ñ?èím¡"[Õ3k¯¦¸Ã¦„¹/5y9R˜¶ÕÌÊIò™<Àcz êÖ ã iÃÑM¹ º™ŽçÓý1ýÏì;v¥\CeLµß F›X×îuÍj%;oaœQ…0kÊW»D£¯sW"ʸA–ÓF­^‚'JòJÄl«5ÔÕl1Vo©§´KZÉÙýn. IŽ„z”kŽЕú³`¦82ˆt3¸ØÊösߌúrZt…êÐh’ñªxج…¼ ½òpŠþÕ SëßjOØ‹¬ÅvOâË’Z‘ ñ­Èc^ähä¦QaU†\ÇpÁ ö‰oäŒC¥µWOyÆærLÑô«¤d}¨§d õ#Ý» ²ôä8WVb9ª¢Y½-‰wë*ô4­ ÃC¬zË#„:-Vƒ›‰2SHÐaaQ£T/~Ìñ"ö¡KA«PW«ÝñÏ8‘á~cS j™Œ¹ZCùfeã B·ºzkÐc¡8¤VëiATÕ–Ó<ƒÆaŸ‘b¹8‰¦ç ŽŒµ/¹/n!{6ÒR*r~zw˜ò85V`PŒ*8üU™€å2[ÆWÎq)çS…tB²âÔx`ñÞlÕ=û²©M‘ÃTqúÈAšDJgÌÖÔ3_ `r-Nä“É×<5ËGŠ¢¥©n5RûØÝE©Ö¾#4&¾£œ®*`÷%/J·³‰ÿâÁHB_;lÛ‚hÉ·@Š*_»eÍï¯@{2ãü™ùiOB¨“&ÒµXv&4ÊÖÜ£Èo‡Êq«¸$J-7ƒzþÈuͼÐÛ®Y¡™Ø"(Íj¦ÿ—ìÿoðÿ S;sc7G{c[XØÿ 0Çp endstream endobj 28 0 obj << /Type/FontDescriptor /CapHeight 850 /Ascent 850 /Descent -200 /FontBBox[-62 -250 1123 750] /FontName/TFYXAO+CMSL10 /ItalicAngle -9.46 /StemV 79 /FontFile 27 0 R /Flags 68 >> endobj 27 0 obj << /Filter[/FlateDecode] /Length1 722 /Length2 5193 /Length3 533 /Length 5749 >> stream xÚí•UT\Û–†‚àœ …{Q¸»»KÐE…TáAà!Á=¸„@‚»î,Ü%@p tÎ9÷ö}n¿ôè·½÷Ëžÿü÷¿¾=÷c±0èðÈÙ"m`ÊH„'ˆO¨ e ÉòÀ8,, î0ˆ'‰P„xÂÄ|bb|@9/{ ÿï¾°¸ XœŒƒÃT@ºúºÃí<ì ¸D€r.0w8‚jA<`.¿C g  ‡yú‚€@9gg þ¯xõa0wo˜-‡h ‡zm`öpïPj;$Pä/ÙÖËõŸ-o˜»Ço. ûoNàoJ[$ÂÙh ³ÃáÕFþ^ ö›åŒõßPý=\ÙËÙYâòGüŸƒú·>ÄîìûÒÅÕËæÔBÚÂÜ·šÀþ‚Ó‚Ù½\þÞUó„8ár{gG $(ü— ÷P†ûÀluážP ÄÙö§CØþä÷ðþÄà5T~j*§ÃõûWWGxúºÂ€àÙÿ¬ùþUÿ’;ÜhÁ|¿¿ï>Yþm5%i GØ fÅ›fŽÎ¶ÍœCi­aQ~ãûð©i,üóп޲÷$ðÝE©þ±;ŸNZ:>VÇ›vzކr…†…e “ƒd á§M”ˆxK â,5åÊû£(#V›ætžÛû•l!¹m-Ŷ üyŒÉÃüHŽ`ïGÂe~Û΃zã4ÊBØ4«‹€Ý¬jícEÄ3^¼^É2F’Çynô‹Ñèæ¤(ÂZí²nj<ùÃÂûTÆ­¯U~2.Bc^–84qã_äÍÞÝÆ$~£+Ä ¡Ã[÷G%C”ßãî­I¥‰niueaÜm¯ú‡Ùȇ•q¥ñÚGG¼ι¸ Åô¬2™q=³ d j.Éo…|n—šg&.ߌc⾈”ö&Ìw›EÉÎfš´Ûôãž›~›†—<Üïƒ þbè³”^ÅbÅ6çáä@´¢Ò/F¼ò*O@a»3aÕª5ý¡cÒ±?|ßdŸniõéË6òâR;šÀÒž…*NµÞŸG*hý®+Çûçß®‰eA‰Ø/m¯‡*íêùs©€›Ü™ÞÉÒ°x§%‰X±I[²{ùß˱…é2§¯ªŠÍu‰ …t2¶7»šô¶œœL“ª­0œ´±óY/§uu2$|ɺXñ¬&äÍå¯Úù5ﺜ>$>iõ #‹`M,lÏÛ”Vˆî»ˆäÏùøhÆé~©“ËÝáÚ„÷سVH7™ž|>aÜl”£‡†À¹Í}>âQl$ÝåÌÂì¤Ñ(æ°Ñ6­QÉe£PÀpg’¯Ð—Ó+2/þ^|s‡MÖ!){ LJ£'„Ë J1Jç¸gx>\ 6ý EmgÕ•¼Ü]6",WñѤÍ^­]'r57cé|nô±C©ÊôÿŽ‚W¤ßâû4j…€Åó©¤. ¿ôó§}¨Ê_ÒX®WÔÀ* (ÔûHõ2›’VÚ›´ÚäWæI7¬»ò±Ï~ÞäáD_šôàEbùœ21–Qàý|MÂ6+lþ€>úy—ãË=æ)Ók|Ç‘G1˜þÛ²衠⠼òfäiØEõ2m^ dünSRYªØ]Ô¬B–Ago%¦?R€IŸàC•=l†¦±–yrr¦Å\Ò½‹·Xtlö÷,-éÁ1yòðC°cÞOmt—0V¾=dÂ_/O…—–¹Œóò%íã åŒOëÃzðå“•¨¤‰ýµ.ÒÁ®bC©Òúû,¨D¯Ž«Btª.:5fá4‡ã ˜ÑÅã$ƒH¦öËl ˆne²eZ™Td¯FQE ,kÙI •&*:¢±#°)Qî};9“ÊìÚÌF§[´òÜ.ã²@Y—”pÙPÞm]y™Ç9HûI~ #DÓGÉûì$õ±ÐTŽ3IMÌv§TÉÂ’é;Q×fû’c©SÌêµõÌB=7¬nÖ®‰Zç³É§ìçÄhýæ:©ƒ³‚Ã¶Û Ô}åî*VÃQÜI¨fUx-t/ˆÅb‚ ÌöÈ.K>g… IGæŒNA žeí“`¹ùpŸ|^&_íÛæÑßâË|™’€g̺»£*TùCýh¯é¦º§žv*20’ásÌÓsï<¾ëÇŸžŸ0_Á„¦ÓucvÑÊdŒD NÖõ]ˆä ˆéàž„ãÞ4^UŒ³îXÛWòSuúI‹µ¯‰„b!Ä~>oìêÖÂh:öZÓbhÞZÅ <~]ÞÕrúMX¼&þž•KWð{q}¡üDv[Wû.ê‚f?˜ _Ÿ¤ü3x2Ý-êJ„Ýòurkð ýžj¸âA’2ß2SN’‰qúHkàuÍ”düÖ|I¬Õgßõ½÷G ~h12Køm*k(ë·ÂŽ4I`¬I-kn ‚/ž\@ª‰x‰ï§±î£‚žŠ¿8è]̪šæØéuÞ]šüè:ü‘psðí™­(ü¥¸a/¸±XAðR¹éîÇd<91xLm\‹ûc_˜“möÁ­-ï®n °)*$?TgÆû ®Þ½z¿ù¤¹(ëæ†a ¿žœHI1âüˆ2Ì<~®@¢«»$©›I¦êzkÊø^í—^oÞÉ„ÂSy}º„ù ;þeîÛ8ÉðSTí L½øF;ªuÂ\§l.¶˜•›†ôgö:ÏÂåhË' ´ŒOùßÎ,Ø·<} Î\Ÿ3^r~-æ.o±™ß¨|ËO&Ëõò'žO+l$Á±@ÇR–Õ¾^›5WâÚBºž ¯×Ï‹.&* ¥ ׉zðÊSÌAšñCá«ì;;óò1=•ý¾õ ꛼½ËÈ¢ž»ŽÔrêsß?»°…TæCî¼à˘(¹¿DìiàD‰l¬ Føç¾æDêiÖCŸ;bcQâ(Ì“%žhtÆG©ó~­ö-Ûë ÎPz©QðöNm¹¤¤ Ø“/Íô ]™Þ¹”)I²áq¥@,”AØŽ8% [£8÷Kýƒ]û‚¾&/µë¨œ¬6XŒ?‡3¦½=è_Ów9 ÑQráÞª›þB–’Xy þd´Ÿ¡ç “Zœ\Ÿi×­Ñ(‚¸ì¿ÂçYŠNedjµáíi›œ†xP)üõb×d*̸I{&f¸}õ>ÖvKÒØŽÍKfŠŸìù¿j@šÊ”x$ÑWqC!ÇH6Õ^»h2].:ãI¬#7XÇ P'lãQtãM|Öa¦žâ¯ÁX¤¾ÞŠÛ:•<ËoâszòÚ}û|ËÂ(ã,äUÅþ9ùMnТ»ÕËß&–@ÄAâü× m@¿Eh¸øTþf½ª j)~O)´lØÿC*Åø¡éÖ¾ $AÈ©ïF¯׎ãvýBΊQÌ/3|,.ÛâÉî ÕKµíãɧs‹è‚qV¼Æ„ŒñENÕ°Q–k¸‹àk[VmêwÖìv-á{ušiLæîñ Ãc3¬+¢[á¯É6G7,¾¥}w–S‘]DØÊÄׄD_ì9‘b¿Ì$ëΰ¸Îû⸠Ýý‘ÈÂ9¥Þ¹Ê߯Qe©ã&É<ªƒ6ÐÀå5†¿¯~ˆ|ƒíʱ È%ÆÐuë>ˆ d0+®ÇyØJÀFrZK¯qgöÚ͵-p#K¹äuçQIuðÐZã(}(¢fŠ ã"go>fXþ ò e[]¾ÉB5m†¬fF­G»"Ì:sÀN}ÈVŒÃËÂ/ü}@WÉ$Q­&f^D $çç¯V©«ö§(~õ2oŽUã’èpk¬¹gÛ7®]|Xˆ4`¹fŽç_2ÄlØ'ô±¶HÍâ~Wj-ìñȰ8Í}¦€Þœî5²V—gÜš‘;–WiDJL-»9‘´+­Vº,ŒYlvo¦6ìWYeÚL¾åhMGáç0<\Öß)øööúée!COÅ2h ÿÄa4­ŠVš§´ãêÀÃc²CࡨÇÞ³Swæz¸ÒcSÄÈÆÑIi¾uÿô‹³ýÄI5 õÔTèf©ÖeeGW¶‰òWo©¦c˧Z˜Ôu™iû„%*™A¥†VÁ·€MNˆE€‡)7Šö͹áÁÒO¶òŠwÕñ“`¦^Ky¯GÙÓHBné¢`@|+r0×taeà=+~Ãhô²C˯0î4¦÷E)¹–ñÕ™qc± &kŒ)–Åqj#öë¨k {N¬'Ñ­rAòœõ&¯yˆì7OöÙ¬}Œ¹œiC9Ïj ÅíôØÚæ\i`¨*ÖQP„Ésø¬=xuÞ'€õ¤¢;"-¤R`öõu/œZ.oŒÏmøÓÀ:¯=¤h½Úø¨Ú®'ë0¦bzË÷Är•‹Ðd'åÜŠç<T…Z»:QÆSzúzỆº¸ŸwxN|fÆ™¨È ùK¥ •"g =<ñ¢°Ú‡S?Dåïò‹ŸÞO3¬®Œ®H'Å mÄ|ùŸ²Fåà׋|œ7cÉ£v“ãìy ­a?èyð‡±†l>PK"•}pôš_W%h§c’m¯/òRHU<»Ø¿žªþ’GÛ™ ˜Å®Ö´´M“ßôM¶f˜Sy ßÒ‰«Ô5ÉÚHÇø²N-p[6¾2ÅIŒ¿–>Hók'ÛÀj‡~ðÞî=Õ&åS¿5¸Îº&¤PV·Á“Û’€Gý•¹~¹î½V¥üâº9fMôqn0õU…¿<'¥·™ ]YÝã›O‰bâJìÉ­©8ü©¡8×ßÌv žv¡5Y‘åyàÌîÌ ˜—]ŒëÝ«à‰´®‘îRû—˜ÆVZá$ÛɺF…ö ¨ÃçÃÖ7$šËE­V4LŠVšûI§¨=M’iæÐ²ûƒ‡X§7‹ž˜“vÒ=xÑë;4rHÉ£ÑÆDhkç7” ç#²R¹ò1y(¤¥çKê” µø½2|ÀCá8AJÿvûs©7Òjú˜®÷tÞ¹,¥dpŸÆíw'Q–n:£õ¼»½qezg¾V-¦;Ý}¬(9sœYy,²Ÿh¤”…È*V8VœŽßvzçzËw”MuDÖ´ÍÐW¢(@)E2Ù/úA\‚'‚“›@Rá¨ÓÑ帺9>ƒ ¬Co©#:MFY »¿¿¦„ $LXDÌÏ=OKÔN6~@ÏØxxæÔRæB”üõ­®i!Z(!Àß_4z\žFJèšR~Á¿ªKM(,øsÍÒ|ø1éFÌÛ uÔ×§ÖýÍ ž ?n¬ý7ˆÈ7†!VAE?´^ÆvJ¦fUQ:ûbQ³­ü!¦–ªÙ§æä=çÅzr\oXRBWÊz?pš=­•Þe@{Þ'Ã.»Âö}ÎŽž™è>*pc&d¹ ‚;ð—>\©œj25б±Lå››0µÙYÕ:ûîØœ^yŸà1åT7ÀQA= "ì*WÁ'~Ã#Óï4$Ìc– [óz·îô®]æIЮ 0ÚŠ(tu _ö“kf¢(Vs˜Kºöj<­{¨µ5gÝÈ&7NÈî#ÓܵElÜ4ëVÞ˜÷§‹{,mõÔ¡½˜k=G¥qé+f¡ì3"p=×±š:öü¿¼pþ?àÿDÔq÷Dº@Üppþ)ÂT» endstream endobj 32 0 obj << /Type/FontDescriptor /CapHeight 850 /Ascent 850 /Descent -200 /FontBBox[-29 -960 1116 775] /FontName/LKJITK+CMSY10 /ItalicAngle -14.035 /StemV 85 /FontFile 31 0 R /Flags 68 >> endobj 31 0 obj << /Filter[/FlateDecode] /Length1 724 /Length2 1246 /Length3 533 /Length 1783 >> stream xÚí’}ðzÿKàGÀX$Ì% pÁ ’õúËò‰ð¨×#ßͼíìÏÓ©h¶ñÕÜÓýYÉV¡æÏËšZfüÄ)¼u7JÓÌÖ·êkZõÓ=û2júøÖm™Mºž5aÚu0ß4-ZúT”n»–7-Œ.WÌ%ì¾î{íTùÀøëÆ×ÛCI‡³ó­¦Oþ<ºä±Ø8¢òÀ˜*Õ³y¦F1Jטyu¼:[©6bºÈ²sÍ´a6÷H^lªÌºVƒ˜»Tüf?¯RΊÈ>B9Íóðíjº{cª bc·€ÊxìMé[É‚ºÑØv‰š~0¹èÌÒ©)k¨´ÕÿèÜšƒ…íC’ú²à”½“n1þ®¼–Ö'vĦ´ïp³ŸLêÉüë/æx»£2šŸkb×ÌÒôv°›ùÛ„]›Þì¹n9£êq©¤¡ÄÞ-Éÿj|¾êpb‰³t;|¿³†Ô¹Q{C~õc¿Œ_õVOPwÌ¢<2¾“ÖA=îѶDåbßIopr!DLê¼GÖ3»|ÛÒjß™¹jB{}-˜GUëLƒ ‹ô¿©¥tI$¦ŒÅäq 3÷‘vî=ήè°=_†šg<Ý¡qÒ´gŸ^É”Ýû"Pßì\BòUƒrNy#›€v'tfIOgZ_©ß;fà÷bª —HêÀOÒ+ZFòFf)dóu6ô‹éJâb‹i]ñ7sö!'PÏŸ"uò­n9½P²iº6åºëô´2S³âä§vÝâ«cX5Ê©+ДA%OHsɺLØÞ6|Wé.}r³K~¥äñ9¶Zé¿üœíŽíjÚР;îh÷I«½Za¹²\hžå¬ô4Ð6µãaª9™“0dq¡;ü™£+T£y×2ûµ6gÈÄço(ÏôÄ•m×YÈPs&ÞVÝCƒ«»0ô¬—¤ûSçÜZåÕãÒMIG$3Ñ:„`üU~ƒ¥½ùshôÊ3ñ­äOÇD%÷§›Êý>Zk‚éX>™-lI5 OÁ=Õ’¢éiwiêgF”Ÿ‰-ÊÑâú:ÿ]§_Vè©ëjWÕõ«o]YQù›GáÊÆðB^ñ½ŒÊí×¾¸¤êÝt§yýOµO¢á}@´§+Y5 >Jªä³vü~Ê¥Áª¹ù›K%Jùß8.÷õgYTsÎÞì]\KKåV¤¬á¼™i]zÞâxhfÌkËXAýÇó!Ÿ 廫ì.K++vK À›är÷¯3=‡Òɶ7 3/lÑw2û‹öÇ} ¥—ýæ Eu‚-Īº>ÎÄN=á"…âH ‘}Ù¡'=—%˜Û%¯bÝÝö|¨W2Ë 1Ö{™M¹4ÇOêé¶Ý:YS¡dÂ/ÄIÇ­„S[­>C¹…/ƒ[#£Þ1#n„îüÂÆ/»/‚ú_>„ÿüOpø0„á¨ÂB „ ïÃ! endstream endobj 35 0 obj << /Type/FontDescriptor /CapHeight 850 /Ascent 850 /Descent -200 /FontBBox[-36 -250 1070 750] /FontName/BLBMAW+CMR8 /ItalicAngle 0 /StemV 76 /FontFile 34 0 R /Flags 4 >> endobj 34 0 obj << /Filter[/FlateDecode] /Length1 712 /Length2 4998 /Length3 533 /Length 5552 >> stream xÚí–g8œm·÷u½·Ñ‰Nt¢‡è!z‰13Æ0côέeÔè“èD "ˆÞEKÑE—½…í¾ïý<ûxïý~ÙÇþöïu}¹ÖZÿëþÎu®'/§±©ˆÄÝúЉ‘•Pj˜È%Dż¼(( wGj‚ÐP „¼¼PÍ”JÈ(HÉ+Üxîþ(8Ì ÐüS% Tsƒ¢à`hB;CÝnMÀ ÐÔ ‡¢ýE@5hòç/^@¨å…ˆ@Œ:Bap$@ìO¤GH'w ìßiˆ·Ç¿J>P”×-Pà–SxK qG"ü¨@ÌÐýv5è-ËÿëÿBõOó‡Þ„!ÈíOûÛ6ý·*È ŽðÿϺ»›‡7ЏC (ä?¥Ð¿Ñ  ¸·Û?«Ð ¬†„! @ñ¿Sp¯‡p?(ÄŽ;@/è_y(òOˆÛ¶ý… ¦®¯n f!ô×þ]3Á‘è'þÿvýSüW,ñ_ñmsPp? ¸¨¸¸Ä­ðöý×—Ý?ÖÒB‚Ý!p$ hŠ!! ä߉ÿΤ®îî("%‘”¾ qYq ¬´xðÿ)4CÂ=½¡4Òâââ²òS½Q((ý×Üî÷_±ü¶;P¨ È}AÇ}*Ì&tìpÔþ…Ë¢ydÊÐúúG–ô –~´ŸA :íåj|ô•übÇ8>óL€C%¶&Ä@1¹ýľËߟ¹bŽþžÓP‹ÍʱBe†È8Í;k<±?¡ñïŸÚÔ a¥í (æ X´GÛ¯N¦†Ë/}!m3 k¡¶¯uߟ­}ÀQÑòÕ{.”÷ôä-!ò“Äš†Ñÿ­$M°[„TÔµÙ¡ªˆYèd½Ž³emÑ;ì°(ËÑJvCGGIqÔî{P@!#¨Â£¸Ð&ö>w=¡m€†`Lj¼ëJET%¸3ƒ´2h…¶õH´Ôµve6mK[yÌŸáN¾?#yŠ®wswÓÖÍ}r+JïÏ1ó[[9p|)£Šucøn¸¸ïyiy½h­è+¨Åe¥oæ –mèéé-Òº®Ð‘[_‡Çºeÿî&OJReÿyÿ ZãØîCÅLFÇñ÷ÀÚËø¶Ý.’Pn…¡è‘é9æ CGö}&ò_CŸ% )E8z?ÌuƉqÑ f·Ù„õÕ WÂÑ÷âs3:BE•€ªÍ;p,·b¥Lý ˆH±¤ yßïq¨4NíȽ†l²Ê‘—zNÛCZ”3>úšX^Wª 4Ì&Îïꆑ=«ìŸ¶×\ã”]²½ µs‰¸x8spj>%jë`Íâ—Õ4®Ê*\ÁŒËõª¿¸l)ƒè çày*67ÛJþyd[­I\„\£ï·,ñ ÆWYµœÝ%À>œÁ £|W¶ü·ÍWòm9¥‹b…|µENì0>–ºoý–šî©4妖]‡´ÃÌð‘Û ÊcIÂQÖë"& < =Ém¹&,»ã[ÅQmÉÎû¬»MØ‹{**R©t_Ë|ñU“œÆx±––¹FÛ=2® « ²|Ñ5-/VÉEyM+VlAÚ‘´[Oämb®íüìvÕF·è^¤Ñ-î-ÎÚÒ¯Û¡ä•<‘D¡’Ä]Ïìοh‡^f+:2•ÔΫ?ºŒ™¢¡æ *~ú>9Z÷8ŽS­¹þD2F¤¨>Å ‘ Iû/y¦òƒ!•÷R g²$ß«4 ¸ÀÊ-²:K1Zœü(­i`6KÌyµØfFÀ!*/̤.«NªWÖ4ŠÛ£CÄÛ›ñ{Ǥ£º…¼Þ¨±çå]MÑ%°øÈ.÷ТC*]$9ݧtÏ©ù²½ú™ds€æÓî+íÊe—‚—ãÎw{Þ¨áØÞÝ8q#·§AÛ_½ßšÃ‰#!i…?’¥V£húJP‚)1W!Ïâÿذ ÆL qgÖùå‹A>,À«¦]~–CZN–]±Á>Fð²MÃÀOËó,?}ëKY4‘Vº[Hoha3n–,ú&ÛÓ›/VOb-}¤^üÊux2xièR]#_µXYoUrêÊterÓ‘O¤S¬ðÈ3·.õåqÐfSúÆxŽIµ±’Îi¡¼u>mW(ö_õ ²dó³V“î Ð/úy^Q­©"ª•gMû…f¹6–Â1'q]QÂ+ø_u6”Kz˜<¾}>ÆýùS?@}Ô+¿‚gHï³Æ+rNzæO¤V3JÈe‚uý×Õê̺2“œu5zs±0̳XwEð´e ÚÛË-Woáž!ãü¸Vb•,÷˜†;)¶½½–/K¸òÞ~_Í‚¡‹§+/ÜÍê Þꈻx®Ãb¨¦¬>y9»]±ó}‹:Ùó™&.ÊǤÀºº'åNŒîo˜ Ye;WKnÂÁEí“ë§ÄŒ¨ é×¹ÄbŽ‹f*®<‡êêQ4ÓÕa¸zÑë¶æÁݾw(ÜnÄâ>)ºÊe¶‘ª%};4¸ð›êÞ¦§^Ès>’RaQˆ\l½”#tUÄÎ\çá}yCׄÄq~àÐwòR(Ú`š¾ä£ÚÓ¢-aL'_4 Ÿ;¾Kßy‘ûاkÙVþÄ~ÅEOÝËÞj”‚¶l²p7ƒr‰ôÞ½Ô¸è¤Içf1+jˆ|‰WÎv”Ï{M~Ö× Ó‡!ÖçD9‹sÕÏ„d ¦Äœ?Xƒ7-^wEH‹$Ý}r`šVêÕŸŠj“>=ß™89ôœvo8iæÿÜhPšö´ª÷`°Ó{6Е³¼ÃõI•™hœF¿¸1¢ýƒlަ»o·-šÞLѯÉ|Ô>ØáˆÌ æaÑÓöEBL©B“H(ý?#Å~¥óÈØŸ½õëi¼[rF3eþRçKzcÿdV©DUãÃx°ÊdkOWáý# ¿”þ%?ûC®4$&uø-úyîÅórÎ{C^F%S_î8ÀûµÀ¿C*ÜíÚûè?wÐÜcξœ¢å,$y÷àE®H ݵ® ˆÁpzCÕqL±_p~WË÷‚“K2«èÑ\+ÏáÏ5ÂüÚb/FKi•¶Àj6ˉ‰æt “Ô9x8Ò ë‰ §׈kǺùªèäÛç©W:Ì·(²Ý·™xÆ#Pú²ÚܯœœzïAÕfçxJûȶùö?RcÎó’8@ÖÚYìI)t [åy»ÔÒyúÚÕÚa¯3a†æ]ï^™§Ë#ãã³Núº[ݹøgÐOeÆTbV¿K ¾â™î&ê×QïýºÕ ®Íúˆ;y‚DFT~Eàø·jšG—§Ý½²a;Ÿ{Ç탚Bã!ð§&X­×öîóäíœúýÑE)µ~¨êÎäzªP¿µ¢Ä6ÿàõ³\œÑOuôáþ¤òâ÷{ýÚÐØº¶†‚±ôôeŠ? ÚÈR‖5w}‡JY>Z±w­]~á(„·Uš—\þ~^L x§×ßfù2d3JöDÿÈÈ.úâ“.ö­*þÒˆ†áIÿ„W,ä{FqÇzüT¾õô$Úò+=æÆûI*ök ’¢(‚¼Ç_qMf«2ʧ*(¯‰G1¤ÀM„Ù`uô£ ©k$šB§?-£;=~|#«'´ ÷§!ež¥S”'}ÚKÚàÇ„¾2˺ó˜6Ù¶ÓQüí‘—Ú{°Aõ³Y_^bX׫v1Ç@÷å¦[Jw8]ã¬ÙºC€±ØÏ‘Û‹qÿâoAšè–‹Î‰Ñ‚}ÆD0TQ½¤™f1-Qê§@üðˆ€93 1{dúC(SAÇ#êd€uã5xè×Þ!‰œ%ulOèïÑ ÅE꼤@Ûá ãéý}WŸ»ž¬¯,1¥6wýÈL…Ùç´¨ôpì¾»pŒ4ÌþaEé×7ðÉ$yõ~…qp²¼Åö…½ ì‚ÆUxA?Ü—¯2l˾¨5ÙàÚ- :#±žtýi¬s74QzŸ6k“Š»ÙYÔ–ðI¾xôEª@Dz{ CgWWð—:˜«Ž³WâʉÏÂ’ßõ¯U;|I¯Wí°nÄií×…\zÆYé,<5¹)ôºîÕ~ÓYŒsº£H/>ߟ¢*‹ÿì~7U›½Šû”!`PYLwp}`±ÐŸÓS¯“’»[€ˆ™r¾OD¢FQÅóŠ0òŒoÿÂ]GÐ3?ìùÍa)×ú†“õ8Ú3æ D¨l³¿›ð¼7èÁ\BÑåLô…yòÎ\á0Œ£³Ô“çÏñãBžþPé¸ uèëNÓ¦}ŽÛg ”ôÓégÖ7«uëùµõæÇ4p8|vŠñ>}¸5O'=ƒêÛá¥ÜÙÛž²d°q¯‚µ—ŸB³lm;»£¢öëps’ßµZéUf×|Îc$ÆKÙsÌDÈÉSw) Þ Ài8T¸”ÌŒÔ{am¹¹d“ƒN…`^tèrÏxb»Å ^e©0ä«ÞÎïbÉ+át«Aœ\äLÍßa“?%Ë/%yÖ𫜺Éyd:E-KIÎß#g|BœyÂbŒûþêÍŸ³ÍÍ)5"RÆQtåá 5@wÍj³.7èñ¤¦yÅ7¸…ul€ýuéâãbC/L¢—Oåp0qtŸ5n¶5iHV¥‚à$“ùµ5Jj'h;›ÞÕ¨_q"†Ïñ<¥³RS®!R’AÁÍ7…ùÕ½côLožR[ûdïãyMšnhÑÓÃþvÀ³¸ÒØ¡îûˆâ§·'Qc¢ug±ú†ÉõÍû ˜jPœUªvÕsÊŠhÓ†RÖ 1~8M²N´8L;4øQ¶PmÛ=âDe¤éTPƒÖ«ÄÛ›xé†+´õ)-O=DfÊÈ`@|Ç“yÄËÛÑMfzŤ¿‡“Äo“f‰¾W<“ÞùxDƒ­, S§,ø ç@eÝ _$>iêŒ7~îUûØß¾qªdˆ 7­ïÏ ÿE<þäêJ°%¦Ñ 8|™ßQŸJeé´·‰Ýk`==c滪I*&t&‚+îxOS銿j$Éヽèì–}IN.lX|”mÿBÍf”º{꣢¢@°G}¬òf(ö³ èÍå[®?L–² ÜDXö>¨$ùÊ™Umq³ 'ú^[†V©_¦¬sŒ›¢6ýQý~9ÂÃÞ„%Ùç›åƤS7ïM‰ä@µ„ßG“ ™ü¬çj†{"¦Åß#¡\Þð:V¾ìï£s&Ñ:R”ÒßÉýÉÌ#t ^i||e•Ø;MGÂ&WêF•&@o•.ø9!dì99ï”å‘UAšÉ^86ú>ðËçÆÚ22}Ô5$ o/«{³×Š¿3 }ÿ˜èpg)µö›ñ|¢‡,&ÞX³œxQ°%Ý2¦’)n’Õ;õÓ·g)G ¼é3êZÅðe`’oGø¹Mø¡šc}é %D Ã)¬ZâœJ{ÆŸ3Ä»4¿ÝƒS×ì[Ýkúj;ò»?¿Ø¤€µbbϤÑfÖˆ*·²@G{ú"€Y^ŠAëù‰ë4—@ mëg‹xažÖðž¾Kþé ¯© @«Úƒ3q‡üiŽ\«‰#í5Æ‚îiþ„Y9l1U·ÝþG¢JZï%X;:W"j1ÏÒÈ`ÖÓkºIÉíls‚ðW*r} .õ\úv”ST{Ám@~€Ej‚õ«¿6ç{O·àºtíÚ$#™Ìä­-×Îc_Tmœ×ð~á So¨ÕkÓ½ß4;|„-Ìj‰[6´Žõö=õNQ…c[|·¾ã7Ž¢W¤%Èö¥†³bPÇãO×ø•£ÆÇ©N*Šù"Oßœ9ëmÄ7‡¸‘ø”³¸blªÚú•¸J É—zÈ‘ù¬$:Dl:s¯.àvY^‘g艉ôÒxÔÂ/`Ž]þ‚—\÷—p'²<æÈøÆ_g*¦->ÛU›[âüU¥¼²}cm”·«ÿûê…¡›‚m3õ©ÙA‘ÙS|5{ =¾ÒÍ•ÁúÜ€bƒ÷ƒ!¸ÌR?¥¸ hJù” "+t&:Ïn)½XÜøâç–=—=Ê™Âx2óòþ*ÃvuÓÕ7?мÔÅ%¥"\ù/q›ÍEÆÄ ÔÊ;viT9²c¼]¶vNzCäÔtDÔ˜;Rª’^PŽÇnPä4ÕlÔÙ¾÷­wg.;á±?,ÅÍhª2Ü?}{tˆÓ8¸{O×ÉNþºg]ôfK«›qWŽVû±7æV&ÑÇ\ß·?µó2>ÂÔ: A³«ç A\<ÆkºÖiK콑ÀF´Ó]m[.-‚6]§N^æ¦ê³`,§_?§ó Î> endobj 38 0 obj << /Filter[/FlateDecode] /Length1 728 /Length2 7401 /Length3 533 /Length 7963 >> stream xÚí—UP]Ѷ¦±`ÁÝÙ¸oœ@p îî¶  lÜÝ‚»»[p×àšàÁ5h Xçœsoßêsû¥«ßºzÍõ0Çÿó[ÿšµª•ª›¸¥£9HÆÑÊÆ äüTÒ”ãäp98$Péè$AfP°£ƒ”ôÀ) À™ÿü½?òò}ääCE¥H::y:ƒ­m FI¦¨>ÄíAÎ` 3€’Ôdÿ·‰… áhA=€8PÿÇ€:Èäì²¢¢rr,ÁP€9Èì€Êþ,9+GÀ‡¥-]þ³ärvùË`ü')à/§¥£Ä` ²BeWvü»è/Íÿ1Øÿ†ëߛ˸B ÊföÿhÿO³þ[ÝÌ ñü…£½“+ä Pr´9;ü»Tô/8%%ØÕþß«rP3ØBÜÁ°qò9xþ•»È€=@–ª`¨… ÀÊ âúgä`ùï$ýû'»š¢Žš² ˼ÝUUÍÀPMO'€ã¿äÿŒ9ÿ+þë’3Ø`Àñ×fο¿ã?gFÿ¶›´ƒ…£%ØÁ 5s°4s¶üŸ‰ÿN%!áèáÍÆÉÇ `ãâý{Ü8yø|¾ÿ«RËüÙ$'àåàààçâÿgÖÂÕÙäýçøûÈÿ[ÿºy€,P4ԔϿp˜TÑ3-¼ÍÃÓ§xc,³4DZŽ–G…¿¦{•†§¾§¿ÿ´¼}¥”.2·X>AÁV¾ú(ì ¸k=GL«öáÞùi+xkº ¸gBÀŽ•6‰pÇ©x[ÏJ,‹‹=¯ò³Çû¤¸È#Z–óUoym(ƒmgží]ø8-2Yx+Øo^’ï>AÊTÌü2=xÛf`d±Ýg4®®ãfWl]“ýõÖûÓÓ5`êÜ&¤©4ÞiœRe+àæš$Æàg'ýàCz,æQXfÖâ(b¯scDÔG6è¾HÄI1ç¼ ühø™æÃÙ·1—¤Š—{ÁfL¸6ËìgËd!T±=»sñC0Æ]ÃR4L«w×­„}ÿÁ¥®à{ù…Ún(…è¯ßLµ ”ðâ†CúÉ*ƒý„ÇÚïx˜Áu“å0K#m®YÊ.ÒUjåHõÍNé/…öUõû%‰P´'(MEΜ¾5‰)@•‘SÐ=ve’C˜¶sCîÖ0©€`/åaàˆ’u¼ÜR®–¾Œ·JcKF»†5}²~ž‰„=;[F†AETÎ?_ÂgÛkWFMŒëæ©òþ5KÎÞ–e¬·ÍIlÞ¡RRå5²ÿíY8 °ÝŠ7¨=9‘ÅÇG{ßU˜fýÒðãe~ÓïO¨ÝëgÏCŠ)Úê°YQÏoôî1?[O˜Ç€ÀËhMWÚ[†Nt@×ï,[.jF­ü’0—ØG^ÿ…Wüö$¢îc±u÷æØi¼|Unòµ¯³4e¿ŠP0›bV—HK5`f¶£y¡#T“$yq?êyŠ2îoi>Xˆ­°FÚýÞþ‹®| ˜ÙfôóV®çå ü1+FËmÁB~¥˜GNî·cýÛWɮ훈]¼Ðf®ã®Ðmñ—‡xg†H¾‚½U5B7ûÝBò†UqÌl{ógýÛú!üVêRëþKEZÀ{’†Iƒµ|•žtÝ[iË'P‹©ãlK @vU+Õ´rõwñ$i \ïC•H?:r´ýx‹‚OÛN«•tºýȸ‹£“× ~iø¶|ôb`dq²€ô“»:;‰Òu‰¥ç‹rÔíó6—tÂ×y7‹u®šýÄ3q\®‘uí埚3)ý+É=Û–ðÞ9u‚‰¸Ð—G&ÒüÙ®³T;Lüg¦?Þªh½?óÂ$óæ¥eÔû¨ˆ„¹A§íElÜQ¡ó,½‹»¶wÇ[‹–ã3´Oz…w³1`€[H°¢cU(·±0¼I #!ø=QyÀ»=CÒ¶ê\úÄo%3¨ëZR¥F#DB9je2*ß~®„øïðJÞ€–B匚MíGÒ²–qS¨j ³ÉCu‚FIb/¡ÀóL´þy¯ÁÁŽˆÆï[A‰‡ˆ3˜vÓ.?G8DØÊÐôë¸&V!4¼š…tqÒ–‡‡ÂÙ*Dí ý jÒ56kêx•~m]‡¨9TˆÔžÙðù¹üÝaL¢„;!¢¤Y•‹à¤–8ÐtCÚóΡ ñÖÆBJÄ…ðbD©DDz,XYœ‚/-Ú~ÓYõ?@±8Ÿâ$š™!'{:U’Ñc«õ&)¡Ý!íGEó¢%‹à’i‘¬ÈQªÒ:úúÓ> ÜõË †Ú«ûR\ɆâÚ JÂíDذ“I6à÷ÚÕ7_¢‰ÅºhiÛ¯š™™óG„©¶'óê̦¢ñu¶MíâG…R|»møÆ±äÖe§ÖÈÏé‚z÷•Ó(§;WÔ2.;† e˜Y”L¨âÕúBùÆóûÜmK×›^XÜ3µnÛ½ »m—P*ü8…âJ•BÊk塈 Q¬«õ«ýÙ&ÒJ»¼msœôÑa$é¶•ìmÍ…–¶«ßõ~q9̈jeù>¶ËïXTæZ_ ÖŽÜSáwGàýùF©Þ™Ÿà«ÍÇùÁÛ¤Žsv¢8<†?ÖÞQÚûØpïˀ’ª8šˆ§t’ŸÏ¨Ô¿Ú}Zêó~±5ìbJ3xåÎé<KŸæ‡/_¹ ÖzϰvÎÃ2Ç<²¨BÓ‘u;©“Ƴ(cR„Ÿž[¸^1YE™òÐÞ¥{,Q=7cûZòÜOd—$ç˜QêÈqa Îá;¸=2M~ùT öO°WˆñåA§JÖ<{‰ û…ÖÔ¨â‚_ÉäçÊd "a´Ê•¦­„u§½¹ÓމÀøƒÐ¼Œ`¦õ¢K¤Ì×)n ¨F'ȳéú¸I ·ç¡_6sà<2Uª½ uÚ¤Cµ­ªfYµÔ»™Ì6Ô™œJLG¨{à°ÿ+«aaíÝmUù4=m[ÔdxøG¢…"&›˜^¤àg@ ºâ'ÕPɘ›»s½œhmZ¸Mm  —9&ci#ÙKS$º/mwX8 n~Ý>NšZÐØ!B3&v¾»]`fsB·f2>Pn ÇžÃW¡z N‚®Ìž1)MôýIÙX~—TÇ'|﹞#ƒq?•&k[~ìS9Roñð z„Z³Ì4ÝáÃU '}I(u èÚÉqöÁkƒ©ûÂjí¸X‰`–Œ;¾:üÉæ)¦<~)bE>^Û"8·î-­ëbµ vèË ¡¾‚‡ÇP¬ä¬*ŸK0El¸§0Æ{G™f\t sAJ–:Cæa²þ‘|쥿ÿ4òÙ~Q©2ZÌ,nèhÎYt•E%MKÐ0ýˆŒHò³ÉR$^0Âýƒ°'Kcó{‘tæ¸wm†²Ë §e¶ä‡mfÞ+ œµâ•‘ßÛêÞ‹ìs›×îdFBê’~S˜èÑ-2•åΤËy>'ä™vµÍ§r#ÔåׄH_}r¯©Qóœȱô½Švâ±>_ØTGÔãêÞX—ë|²Q&ÞGãžL*þ új‰á¥À° ý^¯xuJܨ5Ýwí»<^ü‚qã‹t€g5VôºU^ÛÃLÛ¶1zùiat³3Ñ<ñ8iXdë.·"9 ¾F4±þéq5nmÓÜì ¦b,*Ó’õóó’ö‡.l• yÕú\k†qòQÕNÄxšwìñÈÑÂ0rÙ€3í–Yë#sW)Ž˜ÁBªSíŽD$ÉLÚ’_~«sä¿ÉN£7-*tËlÞ3R•%¬?ÕVŸÌéߟ£Ú £áÒIc1Ùw×–âÇ[„×uÿÄ1I~.žÉ, îbïˆ19ä!­Êô/©çõcº2FWZßÔŽG^põªnb~¾¨ÁQ òÖ(Æõ¬äbyR.,vžvºÈÅ@|• ê;Ù¬Ž#ñ{â/Á@|2%ÚÏÉqµNªº²!¸iŠk8Œxï¡ÛÂŒÛ?¾Ø0÷­âæn$F+Ù‹Ó•mw{z¬Ù%«ì"±¡ƒµùĤ¶Ä¿ÞPO_C¦ï. ¹jKf—c{ûæsfƒÂ]~­¾N ÿ6œµ“œ1‹Oýrók¶„œÓЦ$Ûïþ¦QƒSzè+¿É@SF^ÛÔj@Íf^íS2¶Í·òå×$´@!Ø*ì¬A«ßû¶Ç3çaŒÉ*údsB,ó.5¹8J©~ƒrì⥷¢±J}OžÅ$(ƒòô\Q!ÿ\ä #örƒ•ã]a=ÇäT~vf{«êÔÁ@ÏZžÓ ž-Ù&¨~5ÏÔ|Í3¬vád)â(Ô!äh@>¯Îö±ëˆˆm*˜Ú»^?ÔeR“>l¸ I ’cý\âÏqí`=¡'AüÁßþÅ!½Æìå¶5zÂ0Á¸PF=¡, aŸWÂ¥kSæªíM ÿ Ф6qÞ® ¨ÂBu<Û§;RûÕc¯Üt=ù±é°öBZ 5Œ0gäv\÷\„«Áž5ñÞyK€ÇÃÓ–gjŠ=Y/«ilà-ÄQ=Ô„vì¡þXÐPѵœ˜à¦‘ øì„ßÏ\¬œ=Ž î€¿t×÷tONöÏh’Æ®qYÜpf;V—b0L£g/µÂJ4UúÐÓcEóÄš]\ ¨C]öäO-¾ã£¡ÈD ¸¸fH@÷{—71‚xáe„Â>w<Ô{{.y“Ù ¹ª ”P÷³OšW‚‘-¥S­çö{ESE·š&˜ÿFåà Ÿ.‘’ÙU„£Í´`-g+“:œuÏh4«)‚¸uç€Å!Õ«éWùq]®4}4éºIFFU3ûÇ‚$­_æøð—P,út¬­ÂÏS>ßñ·ª-ÜPéŒÑh“õƒ=ßR¤&x6â>5fuàÍ;^l3>«zm³ô@Ȉך6[ÒÁÙL9!,%Ÿ`Ü×—b `56±—àY6Œ¾IÛÐ(âÚübÓ5¤U<*y­”ž}ø8N ìÌfMe7 |d7i£Êù0˜Ï.+ÈŒråiä^Àºg)ÁŒ-”tø ‹¶£x/ùªËýñ÷Án{ë1I¢‘aÚê|ö'ÞqŠf+- ϲ}b·'DòÛx÷>GÐ/ìÑXjødAÆ¡Äk°6‰ü½’¹q3Ei–/>ï³/&¢Úï‚mÇ“îKÑè3´ÏŽA/iÜ¢ÜmüÉã}’€· ÷Ð|ø_·WQýLÌèƒnÆ@Ζ†®ô`Û¶”–i[n 8ãœ;¿i(lõ±NŸÛ7ï¶›!ñ”žnˆrÅY³”§©Ù0ßp?k‡-É)ïÛ H<£èCŽ…™ët¼}™bt/GHðãåìÏØ¹ç»ëfß½Ûj¼n-¤oAÖH+¼—\}“.i9½psÖ\û?8ôaß ±hê– £d€½;IiYæ()ýX•8ÑÜ Ÿ¥M&á—O61J’ªÞz™ ‘:c|¨Üµ µS·úO9Šàb –±œ}Û¾Ók›„ý²Êƒ§YkŽ7 nýfÝ^…âœÿªj«aÉ' ¢RòSË,iÖS\Õx7:¢Oö‰F¨ò»ï/à;Û:…DSøüÚº–>ëîWÊ€ 3+Á¾„Zÿé¢òïTI}YO38[Jt©FªD¸î|”³˜Û §½¨JÝ“y;³0Îh•É¿ä/JæYTsCêÈÍa›ÝŽ‚èX:=|¼U(;&CíPä°ÇH¬ð o[b ÷þš|Qµèû6tf´¸äUSS¶§å¾÷œÒ¸yž ä^Skd|W­ÑT‰#Q&ïEwl‡s0eÅ(H¶ìº®Ûw o¦ª3*2Àbn²´R¼äÉ_æŸ~2ÐúºY¾[Xš•ña àï– ?Ò™/̺1íé†iRW4FÊZà|RØgfOæ~èi6·4ÇÝäcSæ¤ÞÄÔ®†ã.eä½MQæE%¶Ò3$ûÓ2V,‚¥¤æZCW80-»L Â³&–y/å‘„6ÑŒk Šö$¶®ÄœB_ø8;ë©lËR+žKã¿\¸znàÂåê÷3îæk€¥?ÞçúZ¾ ÔÏpWZ#Zn¡©)Š÷óÍ«QèÀ‡}Af¨Öm ŸßÁi—zÁ˜ë6 -õq°RZZɱ‹ø%øpg ¶>3lq6 –X7ܘùjNO[Þ^k¬R‘~0%aäåɨWI¤‹G\Öüí=ŠƒÚ›Èº³¨¥Æ›FÁ0»á<³#õ!&kßÚˆ‹zÚf¢Ÿu_p»Ñ ‘ŒÐâªé̇4AD¼›€ Ê–ö]Äœñç‰O R Ù³Guá9ÅLñ'骬e½HÏ¢Úòüµüô.…žÊóÓ<Dû%ý½îã÷•Ñ-.ß) ùo6§×3Ðð®wlͧl0*ªñiˆTG›Uö}‰ÈÒvw‰{æ…•Ið‰ Þq8µgQ÷õpÜæ58¶)ºé¢ `gº=Q'öP»1ç^0ã%Dà›Š8yî‘OœÎš¶†Q$¬[òƒÜú*Ê¢ª¸*m­nÜ¿t: Te߈®•9K}æÚé<öi,¤lìi¹Y~9›ãŽðÈ=÷ø\Óï„~=fû=­æ ¿AòSÐe—˯ºaxÀëp±N“WyÞC©Óe¾ާH`ÅÈKÔtHÑtÝK¼¾,`q±I'Šp…>½k¥’—,ßœ×Èr \e©Fl) ÝÉcÀP¯}:¼äǧÑÈ¿Áª¢Ÿ1'Žùí[Â&^ÈZ‘ÿÕ%V J§ð+é&2<§ iF‚ãn!ü¢C`JÄÆcz\—&ô3Îxqt@'á^oÝ2cöšg‡{ûòwK¯¼t,%BœfTt r¢0PåqËL ü#”‚õÏû4Ôäà6ë“«‡4¡è\‘w'…±}$­]´s†Ã¡Þ¼!_Kºö…cv1’¦Í¯ËÅi8o2^/€É–QEvlÊ›fzâ­;e÷ÔÊAü×øºWa¢Ž—ÀÇÔ×M= à›…­ìñKÚ•zm/:OÊùœkðJÃDñ½ü ÊÖi.]H,Ò¢ÝU~è½Wül²6P±U¥NJ¬caO¦G±ùñfùœÅAh®¡ŒR^yç z¥þ§gÝáÔ}»'ˆ­?¿îãŸÿ¨o!r]T!P…W sJåÖhàßÏÕÎW#ߌ[¹–ݯ Ñ9ËèïeQÏ•Ë#,à…¿"SjìÒö¾Šî Y¡:IŒ³]˜rÈè=ºï uãì§7æ<¥jWD.7¸¾\>ŠTEg‡„wÁ@ÙßB¾Ï رTº'Øõ6ßI‘Ž-“ÍIz;*}K×ÐÆäУºW…îŠÝ0È–KZgÞŒjš : \“‹¼¶la¿10ºøöž¿D³)X¼»¡¿ëš éðŸàE,d^‡Ò3¾ÙÙb­6åð$ñš­~Dnß×[/ŽVLŠ]¸’Ân,åß#+2ú6o‹ì¼8!DÁ~⣾'ãÏüºøe•‡yö¼?Œ÷T4ö³ÝE±m{bÇü}±—ŠÍ‹Zøc » övÉ Ç‚Ë¼åífÕYãácYÖí™þtzö" /U¾1A®£:ú]¢ÝÉB*Õr–b ¤ñIFÅ<¯…‘´üf‘ÓMå­†pe7mrF\ÔlWò;fÝ’eüs¯½„lá#ê‡%sL"6;b Ò§í0a•âµ'ê£C¦ „•ý”¢Øœ ® 5#ÖdI | mM²B>ú_=-9ïG|G§Ò“¦Ìš4¨pªÍùû·Ü^ûܶÉÇ7l¯\9)Ž ÞA½%ζ¢ƒâêÒŸå‡eM·žˈw%á§¹€Uê†Ód1Ùó_ùn)â ø›zËÔWêH”7´šÇGcÉóâ;¥W·_?ìÞžˆ íMäÕ}š£AÎrqÒtíü ÉÚ©ÿR‘uâ®ÂܳWõŒ&,;¤¡>C,®3‡W`Éq" {hÝù¤wŸCL‹'ÜÎή׳$?Š¡Us9yRN”}»—èT¥ÞÑâ¶ígùA€¦Ë ÍlúM‰­Ù¿ãêÖhÏqÂŽÖä…Ùjаh%ŒÚƒ ñmÒìÃA=Iåä6¶ö­°Ã °í»p°à Ÿ@,œ æw÷Êü3äªsä=ß1n|düE<ØÜ;H›>)Ïë’èv€RXº0ED‚¶_"äÒÄw'€© ù…9£¬>¬¥©uÞ.dV¿œ[š,#°ÈLÓÜDDäèU ÈuË¢~ ze3LéC­®_V²M L)ñrµê¤‘“ü¡°•Qî¾pÔÕ‹¹Ž…ÄR¡ä](ý|´û¹I “öZ?Y¯ßò–œŸ´(dCøº³£M ¦§@‹:܇ÛÀôoÉD9Z$k ëp¹ë '}'ÂPŠ3X¨È†úí]ß,8S§àÏ‹´£{ˆÐn•yúØS7ç— ÇÔ=Q?ÍÕåV¾’ZkëÌiù!êZX!AÐ’Á48 3}€ƒŽ×iœk£¤Ñ)V¢PÙ˜·Z‡!˜QûÝ w'QVӊ†xé1þŒ‡ÀœVs„‘þ:§M_°g¥ÒÎ i"Ö·1¼PÙIÊ6ŽÿË õÿ7ø¢dæ u´7s¶CEý€;±í endstream endobj 43 0 obj << /Type/FontDescriptor /CapHeight 850 /Ascent 850 /Descent -200 /FontBBox[-32 -250 1048 750] /FontName/ZDOWWY+CMMI10 /ItalicAngle -14.04 /StemV 72 /FontFile 42 0 R /Flags 68 >> endobj 42 0 obj << /Filter[/FlateDecode] /Length1 727 /Length2 2626 /Length3 533 /Length 3178 >> stream xÚí’y<”ûÇel Sö]=d,Ùf%2Ù…È>̃aÌL³È’S#eÏ2)¡”åÉž}9¡t¤²…²Žì¤¨Äu:çÜûºÝûÏ}Ýÿîë>Ï?¿ïçûù}~ïçûüàòŽÅ´ HM¤€Åá¬`w@@áp, Ä3ˆ²žH}ý#€5“ ´Ú@WÛ@ …Â,…N#2¬êï.4€ iD?<Àá`Ènˆž8Rüˆ #\0$pò÷-tà$Hi¡ A E"Ñø‚D2Tëw,+²?@ÿ!˜Ô¿Z¡ ¾Ë¨|#Uv9 2) €þP-;Êîyà.Í öo¸¾·`’Hvøßã¿ ë_úø")üO%„Êd€4G!€4ò÷Vð8H 2C¾ïZ1ð$¢†@ ¤Ž&BçH· †"Ã/ðÇ“èà7$¾'Ùß7-73{—ÓjþÝ?ºx"™áNÄ?ìßjä?êÝ)шa€;B@îwß¿VžßfNö£ˆäÀ‘'ð4Âß…¥25¥„Ejh£ ”îîmCèèh]DÔ?ÉÄ3LÐÊ ÐE衵õt¿©~L $3¾Ý‡Ý/þ«ö'î Ã@?èðèR}ÓQı³DÊѼ.ÂdC¿ÜѶ$gæd2Ö*¯¤»(„Q•×ͨƒ1JêG&Ç'¸8¸4‰o ,Ûš¶ê @®˜=N˜¯Ýè²Qëî/ýœšÆÝ«bƒ5M‘çÅôRžâ3— lÉ}VmF~swLùe¯˜â%=»جWص~”Š„¼ˆª=îgq•°{_{µßî—H²s ªQn~%ìhs;¬Ì(ŒK” +ØJhýjþZ([pÞäæÈõô£dªS¸…µ ’ßU'ÉÆT_?n{=ÝãSŒ©A9¸]¼òÖB5Ãð¹CƒÔhàhvߥM¤p3§S(Ô.{"à¼K×’[—³Y²7ëŽï鉾i™u¡›Ž³¥¼w9'SaOeCûs¼níÔ•oêpT¤ ðÆ$úy ²ÑÔ[!ðijuŒ,Bjj®þÈÜ{Í>Wå@kÛ}Kaî#ÉúbL쬦$™Ã‡Í¥bY Y®¶ÈzPÃu= äuFßäPr‚àz‚xòÂèû%Áý¼5Y¶é"Ùþ9€”¢Óü!f«oL…xóšÍµûуW5™”·ÖŽÂ÷¹­ûmmßöáhµ1ö€¢Õ“wÚ{¶äëùÄÚµ;~it]v|%ï2¤X±VÑ|ÇðQÞºf´uÝ›3<Á°ª€/u÷pWµ™1çË:ůiK¤³ºåæs×fy÷¶;&ßH„%œpš?wÐwáttÀªqŒ´1ABÉíÖýMÄÇfTÛù¸r¼UQ§9ÕŸ³;êÙÔÊæ ñœ¸ÄjøTiôËÇBX§]ßmeiTi’Ä ¬Ÿæy®q¯÷´â«ûEÏü¸"]ذQ%Ÿ‰ý}ç£ØÏZŽOÔ;qü5c÷éÒW”[šÈÁ3Éâ‰Qå›b÷¶PÏŽÐm¹£IÐ_ež¾Žµñ0hNßè»"õc !OQ*®/˜ÜœÀ5×ê[×´cd”•1ÄÍt1üüÈŠ>–œ˜œØ¥! ‚”Z(øü›Ó±?´[‚¥S|=ÜŽn_mž½Ëå"dØ{ý„‡°yä3_ê,-Œ¾ F(V[¬b[ é< æ›°¤ ½ž¢_ßðÍŒí¯½™ÅƒÌ ±/[›ùJ䉧ÃÏÚÞ;T£Ö¦VÕ1°Õ¥ÒM-œç¯YkŽ š‘·æÍå·¢—·Z,>÷eÕ§4=RÌç íçb’ÖKEãØm ||¾…Yì€'醴W¨é˜T\‹N)Æ¢úλ&~—®X76.(~‰g›TßâÒ_nV"q_»0Fp¿ÌWüñpEýà ”¨4tBU^Äÿˆøžû#Y‚)þ2fó{,³íÓÇ.MeÏ­@¤ÁŽIlºŠ¶¾³Óêo>ØÞs­«ÆåňY=§ \ϰ3;vU÷Hõ¡vÆÐ}þù‘u¡ñ–²¾íî‘O}R/žžw°ð-n#À öX(=p?:˜¸üÁ{ò´.§‡ƒð[÷L;ZÁv‡•YíYM×ûyÓ6xêF;öÁ͇•Õý²ïŒ3\‚¦SÓì,‡Œ/Ø,Äc&Ö^†ö«£iëÖ%­¿"E'Wª–æó9ó9Ï–áêœ9ãVó%¢"('¥?6þ¤80!Œ ;¯/üªrN¯ÈŽ>}¶0~uÓñvÚlõÝ‘«6Û;pƒÉ,ç˜þÛ55£Y¦MmÒ˜ÍP*ÛÛôJ p>¨û„`ªW\Ç 9×F5ô’FhâB¼ŠŠbÍG¬Ð-Y‡ŠœûΡö`r‚äÕPµrK|¬áZâé¨íŸ\VPV3«ro¾Ò-{¾Ò˜¼¼†JŒ›âIù.›YÈ[ˆMÚg*]_-¬Ž;^xýTÜc޹éakÛõ'f7Z,ÎGOsy›Þ¼¡7F¶ÒÓBö¹½Ü†Qí!xÇÊLžåYnÈWZ‘17ç¼ nXLîuˆèÐ…Ëm9ñ%¦ÙòÐá§®ä yfÚ6ÕÛb¹ëÎ`ª]z¹†å:kªÓærBîð›ÊF±DA-ªþ…Üô³Ð3.tí$ÀW‡‹NU¹r“¼²7/¿è)˜îPæHUÞs¨B]`zZ]´ppj_^¼ì˜ ¯”̸s¤òõ–œœŽ¸ÆÈ$¤“jë­êõØG©VRYɇÎ?Õ¼)úBû«ºçOœI¦šHaI“O&IØcšì¬[­m†–£)ñicÉšwƒcz_= îÝ{úVü‡ÀWÓöÞª/BB,šúEoÈJ¿Ö6q¤Gëüª§KoÚžØAB‚V&}±&÷ŒžpóÛ_=«¡þcÈ­Öòż&µÍ¶ãX9K#)ï{ \­ê±Ïï^)“5N*Ž•Ÿ™U¸]ŠZûÝ«:þSÁ¦Ëµû ]lLö{_”9»úéqunåÉèÒ5ó‡_z÷Û,Ý´–~ª åyÐ Ž-vžI1•ZEW¾+’'&ž¯©î»Œ¾eα8#‹#®9”Fí|þ¦¸ðz~DùxªüH•rôi[lë÷¡•goåOÅ¿ôJé’cÑa_%ÖäÑa UͪíÚ­¹XÖ@]„­F‰e­âh£R_Bm_èýˆvm%m%xžnm_!YÙy™éÑd5—;ú©‚¦÷å4¹ŠæìÍ–9V\ !"Ê3tÑØ03ž\ySã¨_˜¸÷‚„ÄgñC› æÜ…¬™¥|+(ㇳÅ8÷—æVo9¼+3D]unÚoˆ4–5u>KÒ«}ˆJÖ9?$Ø.l³û9»Ú*p’v6R‹ËãXpäíÁ²4kA†°¨ƒUÆè:©ðê!¹q_´ÔĈÇÌ‘¢Ÿû"àaš­ðR³û빩qÔÔàŠ”Uy|?»ÞÙõĪ©²MŠÕµÄ>Êlš¿õ̶ÙEVÖ|ªd\8ÿhi”ËàV]ÄxªJ5ÁÕ~l¿t» *°Ç}ŒN‚nGW×u`Wj¸FdEž=Ò²šû1šAý»Çœ¢@Lz<3>Çâ•~v”Á“ãzånú €NÜæŒ÷](_ šº˜ÛSèx<úCª®‡Oí/Ëeèô¯²±¯}"ÚÆ"âgr÷­¬8„í%Þ(_ð^7ü,3zØÉÂK;DRôÇç+ýê¢~-ÙŽÚ–|×W²çÒÉb>F˜±·V÷îZ‹ëâ鶇!Ã’òù)¼vS%ÆÎÍþ‚=˜/êíüIšá¸ÑÛÇ&Û<$žñ\N÷i »’š1—J>ùÒ°Ô¹Z&\ å®.›zbÒ›}ê%w€!1iñëˆKìC!jÅè}‰[Q-—»xÊÌûE»Nz^Ä©dåâ;q™—G5ö‰`w†’’xÚúìƒJ?§1½~«—WJiü8\{‹5ˆŽ»ÔÒÞºæzÒùG»È‡×_w²XOæ y’bR^ñýuú™YØG;[Loóªk«;¸•Ãh×j³Ž2ä„7½¼=zûŽÂ ¤ãžj5˜œ‚ˆ#þËúÿ€ÿ‰?ˆ§1(!xZ0ú7êHL¢ endstream endobj 106 0 obj << /Type/FontDescriptor /CapHeight 850 /Ascent 850 /Descent -200 /FontBBox[0 -250 1171 750] /FontName/VPGVOI+CMMI7 /ItalicAngle -14.04 /StemV 81 /FontFile 105 0 R /Flags 68 >> endobj 105 0 obj << /Filter[/FlateDecode] /Length1 722 /Length2 1252 /Length3 533 /Length 1787 >> stream xÚí’{8TûÇ7!3Q;—j™a׌5—iT.g"Çý»efaif-ÍHm”­ðȸ›6r9NŽ[ÅÔ#é¶ÅÞÈ“dbs„4gâtösìóÏyÎç9k­?~ï÷ý®ïï³Þõ36ôò!9°±p˜¡|…L¡NL@¾A¼±±†ø†:C|˜Pìì¬7°°@ÕRþàñÆ€#â!‘Q|ÀÔÉì“ËpàÂ<„¡€Ä‚¹òÄ|0óEdpàpïO¯ÄÞp,Ì‹ƒÙd<žBØ‹„ÑŠ7ÿDÅD#0Àf]f b>·â`^¬œ 0]#5äœl åˆ67÷ÄäûÁršÿìßpm g8Oˆû)þÓ¬~׆¸GôÆðaà±aºÑ¯³yÀlDÀÝØeò!Âr@#90@¢X‘A«u‰e B˜í…ðYQ@ĉ…×teo$‘oÃÜßËÅÿs÷ú¿]ozAÊ÷ÅÀø›{­¦üVËgÄC„@HAŠÜ(¿?¯B7lö”…±4ðáC(â±ÿ)üÊÑ&€É‚ Š °¡‚‰ÿjóC‘c˜é PA[K[‹5•%àñ`”¿väŸû¹Ž@ä‚a!ÌÂ'[‰R~°s|Ž"×ÔÕ])¼°Óêúq+ÅdMW4¯ ßq‹øîBACœwŽL5Ùc­624Ò`¥T_‡Õ^›êgn½+Šä}½³Zƒõ- IZ¶Ù„>(O:ÕV$©sFǯÿDê×2:cë¹°sJöÜin@-»æœ8þ¦BÈqZõªÕ~ËWÛt2Z>Û£ë‰mOžkú¸_VÛ •¶çlSh«|ż¬¢TB«˜’ý9Ä7c¢ç®¬0TO• jÑ©_Ùíª}ko«jüxƒá@½»á°ýIãÃ5‡#ƒÛÇ”5fƯõò[nÊ& Ëφ ¯®êöœ2n¿Œ‹¯¶6xæ1mWäO庘‘é MÜýœ¤ÚÝóªUì”æÖø“Vžv&"–Ëj]±QGî‘*Ü<û; ýVVŠkª­¹‘DuàmwÚÚ=‰¦ÂèÍ¥¦›L3Þf,ú¯Cv÷å¾kçU¦Øg~Ò)Ø“RvP@~»{'Røú….H4_™›¿Ìé#a¿Ü óò.K÷FÖ<Ì—I™×•'a!awÛ9\-%£8º‘1, f§ßïóÏfÚ§Èxù•;U­^Lƒ%¡tæÝZµ0ƒóÝc½+±‰ ’:³ÂÜm¹K»ŒûÔŒyî÷s.áN­$¿£„6ìÔÕ?Òmž>WUðRãÂq‰³/Jþhdz‚œÒ}¤DLäáÇ—qI ¾Ã_®®Üž¹“è§½¼éöYÿÆ‘øéRØÚ½Ùùø>B’- '÷@¯;©è¤ÔÁ=ÊôŸûqÍ*Êo¡ù±ÊF?_öL\®ðz“»ìƒï‹ã©)"èø±œ,I`×nWÕô:¥Í$-/G—ò,Ú»¥¶ âoîJ¯ñBssÒá–§Cfð¤F&mù¤Áæ Mß#tƒêxL«íü°à ½’áUõn‹Dº#Úî«R ªÕ×ÚXØÜ }O îÕc”3Ú fOsÛ ýZˆSBï’6}›æÝ_fŸí§CsJ3mþžã•Qìµömyu.°5™2äz¶»¶µ<É&£ ‰^&pÑž;ô|æ@¼¸# M¼Óî-Û=)&ZKºØr&9›4)¨’â8…dbµ¿šDsæø7ôÃ#o-]!uá®ævŸ>µkÆSRfP˜Žô>sWiQ0g+¥?1¯Ï7]bL0éå“n¿èºTxëtžúQÉñ±ó—i*\5™¢ë‡Ã„jçCÙôw7µ'Ù›'F²O6Ña¾¢ ¨¿øž­‹tB¯Õ5¯i(3aòa9! §?›LwU4ep6ï(- {x¬nèk²H½_ññºqÍøOGÇžvýjâלߩRŠ&”L/[d©Ñ¡ž e¨»{ä¹·îߊó!¿)œ{š‹¨,ïXÑûë=þ—þÿÿ, ñøâÅãÿe˜ÁÕ endstream endobj 1 0 obj << /Creator( TeX output 2014.08.03:1250) /Producer(dvipdfm 0.13.2d, Copyright \251 1998, by Mark A. Wicks) /CreationDate(D:20140803125023-07'00') >> endobj 5 0 obj << /Type/Page /Resources 6 0 R /Contents[18 0 R 4 0 R 19 0 R 20 0 R] /Parent 138 0 R >> endobj 22 0 obj << /Type/Page /Resources 23 0 R /Contents[18 0 R 4 0 R 24 0 R 20 0 R] /Parent 139 0 R >> endobj 25 0 obj << /Type/Page /Resources 26 0 R /Contents[18 0 R 4 0 R 45 0 R 20 0 R] /Parent 139 0 R >> endobj 139 0 obj << /Type/Pages /Count 2 /Kids[22 0 R 25 0 R] /Parent 138 0 R >> endobj 47 0 obj << /Type/Page /Resources 48 0 R /Contents[18 0 R 4 0 R 49 0 R 20 0 R] /Parent 138 0 R >> endobj 51 0 obj << /Type/Page /Resources 52 0 R /Contents[18 0 R 4 0 R 53 0 R 20 0 R] /Parent 140 0 R >> endobj 55 0 obj << /Type/Page /Resources 56 0 R /Contents[18 0 R 4 0 R 57 0 R 20 0 R] /Parent 140 0 R >> endobj 140 0 obj << /Type/Pages /Count 2 /Kids[51 0 R 55 0 R] /Parent 138 0 R >> endobj 138 0 obj << /Type/Pages /Count 6 /Kids[5 0 R 139 0 R 47 0 R 140 0 R] /Parent 3 0 R >> endobj 59 0 obj << /Type/Page /Resources 60 0 R /Contents[18 0 R 4 0 R 61 0 R 20 0 R] /Parent 141 0 R >> endobj 63 0 obj << /Type/Page /Resources 64 0 R /Contents[18 0 R 4 0 R 65 0 R 20 0 R] /Parent 142 0 R >> endobj 67 0 obj << /Type/Page /Resources 68 0 R /Contents[18 0 R 4 0 R 69 0 R 20 0 R] /Parent 142 0 R >> endobj 142 0 obj << /Type/Pages /Count 2 /Kids[63 0 R 67 0 R] /Parent 141 0 R >> endobj 71 0 obj << /Type/Page /Resources 72 0 R /Contents[18 0 R 4 0 R 73 0 R 20 0 R] /Parent 141 0 R >> endobj 75 0 obj << /Type/Page /Resources 76 0 R /Contents[18 0 R 4 0 R 77 0 R 20 0 R] /Parent 143 0 R >> endobj 79 0 obj << /Type/Page /Resources 80 0 R /Contents[18 0 R 4 0 R 81 0 R 20 0 R] /Parent 143 0 R >> endobj 143 0 obj << /Type/Pages /Count 2 /Kids[75 0 R 79 0 R] /Parent 141 0 R >> endobj 141 0 obj << /Type/Pages /Count 6 /Kids[59 0 R 142 0 R 71 0 R 143 0 R] /Parent 3 0 R >> endobj 83 0 obj << /Type/Page /Resources 84 0 R /Contents[18 0 R 4 0 R 85 0 R 20 0 R] /Parent 144 0 R >> endobj 87 0 obj << /Type/Page /Resources 88 0 R /Contents[18 0 R 4 0 R 89 0 R 20 0 R] /Parent 145 0 R >> endobj 91 0 obj << /Type/Page /Resources 92 0 R /Contents[18 0 R 4 0 R 93 0 R 20 0 R] /Parent 145 0 R >> endobj 145 0 obj << /Type/Pages /Count 2 /Kids[87 0 R 91 0 R] /Parent 144 0 R >> endobj 95 0 obj << /Type/Page /Resources 96 0 R /Contents[18 0 R 4 0 R 97 0 R 20 0 R] /Parent 144 0 R >> endobj 99 0 obj << /Type/Page /Resources 100 0 R /Contents[18 0 R 4 0 R 101 0 R 20 0 R] /Parent 146 0 R >> endobj 103 0 obj << /Type/Page /Resources 104 0 R /Contents[18 0 R 4 0 R 108 0 R 20 0 R] /Parent 146 0 R >> endobj 146 0 obj << /Type/Pages /Count 2 /Kids[99 0 R 103 0 R] /Parent 144 0 R >> endobj 144 0 obj << /Type/Pages /Count 6 /Kids[83 0 R 145 0 R 95 0 R 146 0 R] /Parent 3 0 R >> endobj 110 0 obj << /Type/Page /Resources 111 0 R /Contents[18 0 R 4 0 R 112 0 R 20 0 R] /Parent 147 0 R >> endobj 114 0 obj << /Type/Page /Resources 115 0 R /Contents[18 0 R 4 0 R 116 0 R 20 0 R] /Parent 148 0 R >> endobj 118 0 obj << /Type/Page /Resources 119 0 R /Contents[18 0 R 4 0 R 120 0 R 20 0 R] /Parent 148 0 R >> endobj 148 0 obj << /Type/Pages /Count 2 /Kids[114 0 R 118 0 R] /Parent 147 0 R >> endobj 122 0 obj << /Type/Page /Resources 123 0 R /Contents[18 0 R 4 0 R 124 0 R 20 0 R] /Parent 149 0 R >> endobj 126 0 obj << /Type/Page /Resources 127 0 R /Contents[18 0 R 4 0 R 128 0 R 20 0 R] /Parent 149 0 R >> endobj 149 0 obj << /Type/Pages /Count 2 /Kids[122 0 R 126 0 R] /Parent 147 0 R >> endobj 130 0 obj << /Type/Page /Resources 131 0 R /Contents[18 0 R 4 0 R 132 0 R 20 0 R] /Parent 150 0 R >> endobj 134 0 obj << /Type/Page /Resources 135 0 R /Contents[18 0 R 4 0 R 136 0 R 20 0 R] /Parent 150 0 R >> endobj 150 0 obj << /Type/Pages /Count 2 /Kids[130 0 R 134 0 R] /Parent 147 0 R >> endobj 147 0 obj << /Type/Pages /Count 7 /Kids[110 0 R 148 0 R 149 0 R 150 0 R] /Parent 3 0 R >> endobj 3 0 obj << /Type/Pages /Count 25 /Kids[138 0 R 141 0 R 144 0 R 147 0 R] /MediaBox[0 0 612 792] >> endobj 18 0 obj << /Length 1 >> stream endstream endobj 20 0 obj << /Length 1 >> stream endstream endobj 4 0 obj << /Length 30 >> stream 1.00028 0 0 1.00028 72 720 cm endstream endobj 151 0 obj << >> endobj 152 0 obj null endobj 153 0 obj << >> endobj 2 0 obj << /Type/Catalog /Pages 3 0 R /Outlines 151 0 R /Threads 152 0 R /Names 153 0 R >> endobj xref 0 154 0000000000 65535 f 0000122485 00000 n 0000126767 00000 n 0000126415 00000 n 0000126620 00000 n 0000122649 00000 n 0000005254 00000 n 0000000009 00000 n 0000054660 00000 n 0000054472 00000 n 0000000913 00000 n 0000065071 00000 n 0000064883 00000 n 0000001848 00000 n 0000002765 00000 n 0000079375 00000 n 0000079189 00000 n 0000003742 00000 n 0000126520 00000 n 0000004486 00000 n 0000126570 00000 n 0000005199 00000 n 0000122752 00000 n 0000005407 00000 n 0000005315 00000 n 0000122857 00000 n 0000017071 00000 n 0000094825 00000 n 0000094632 00000 n 0000005456 00000 n 0000006376 00000 n 0000100883 00000 n 0000100688 00000 n 0000007992 00000 n 0000102966 00000 n 0000102780 00000 n 0000008943 00000 n 0000009943 00000 n 0000108827 00000 n 0000108632 00000 n 0000010850 00000 n 0000011831 00000 n 0000117098 00000 n 0000116904 00000 n 0000012785 00000 n 0000013731 00000 n 0000016961 00000 n 0000123043 00000 n 0000020119 00000 n 0000017133 00000 n 0000020020 00000 n 0000123148 00000 n 0000021787 00000 n 0000020181 00000 n 0000021688 00000 n 0000123253 00000 n 0000022913 00000 n 0000021849 00000 n 0000022847 00000 n 0000123533 00000 n 0000024138 00000 n 0000022975 00000 n 0000024072 00000 n 0000123638 00000 n 0000025456 00000 n 0000024200 00000 n 0000025390 00000 n 0000123743 00000 n 0000026890 00000 n 0000025518 00000 n 0000026824 00000 n 0000123929 00000 n 0000028543 00000 n 0000026952 00000 n 0000028477 00000 n 0000124034 00000 n 0000030454 00000 n 0000028605 00000 n 0000030355 00000 n 0000124139 00000 n 0000032174 00000 n 0000030516 00000 n 0000032108 00000 n 0000124420 00000 n 0000033868 00000 n 0000032236 00000 n 0000033791 00000 n 0000124525 00000 n 0000034755 00000 n 0000033930 00000 n 0000034689 00000 n 0000124630 00000 n 0000036426 00000 n 0000034817 00000 n 0000036349 00000 n 0000124816 00000 n 0000037929 00000 n 0000036488 00000 n 0000037863 00000 n 0000124921 00000 n 0000039389 00000 n 0000037991 00000 n 0000039322 00000 n 0000125028 00000 n 0000042540 00000 n 0000120583 00000 n 0000120390 00000 n 0000039453 00000 n 0000040449 00000 n 0000042428 00000 n 0000125313 00000 n 0000044210 00000 n 0000042604 00000 n 0000044143 00000 n 0000125421 00000 n 0000046403 00000 n 0000044274 00000 n 0000046325 00000 n 0000125529 00000 n 0000047695 00000 n 0000046467 00000 n 0000047628 00000 n 0000125720 00000 n 0000049891 00000 n 0000047759 00000 n 0000049813 00000 n 0000125828 00000 n 0000051343 00000 n 0000049955 00000 n 0000051254 00000 n 0000126019 00000 n 0000053642 00000 n 0000051407 00000 n 0000053553 00000 n 0000126127 00000 n 0000054408 00000 n 0000053706 00000 n 0000054363 00000 n 0000123439 00000 n 0000122962 00000 n 0000123358 00000 n 0000124325 00000 n 0000123848 00000 n 0000124244 00000 n 0000125218 00000 n 0000124735 00000 n 0000125136 00000 n 0000126318 00000 n 0000125637 00000 n 0000125936 00000 n 0000126235 00000 n 0000126699 00000 n 0000126722 00000 n 0000126744 00000 n trailer << /Size 154 /Root 2 0 R /Info 1 0 R >> startxref 126865 %%EOF mawk-1.3.4-20200120/man/mawk.doc0000644000175100001440000015025613602720754014301 0ustar tomusersMAWK(1) USER COMMANDS MAWK(1) NNAAMMEE mawk - pattern scanning and text processing language SSYYNNOOPPSSIISS mmaawwkk [-WW _o_p_t_i_o_n] [-FF _v_a_l_u_e] [-vv _v_a_r_=_v_a_l_u_e] [--] 'program text' [file ...] mmaawwkk [-WW _o_p_t_i_o_n] [-FF _v_a_l_u_e] [-vv _v_a_r_=_v_a_l_u_e] [-ff _p_r_o_g_r_a_m_-_f_i_l_e] [--] [file ...] DDEESSCCRRIIPPTTIIOONN mmaawwkk is an interpreter for the AWK Programming Language. The AWK lan- guage is useful for manipulation of data files, text retrieval and pro- cessing, and for prototyping and experimenting with algorithms. mmaawwkk is a _n_e_w _a_w_k meaning it implements the AWK language as defined in Aho, Kernighan and Weinberger, _T_h_e _A_W_K _P_r_o_g_r_a_m_m_i_n_g _L_a_n_g_u_a_g_e_, Addison-Wesley Publishing, 1988 (hereafter referred to as the AWK book.) mmaawwkk con- forms to the POSIX 1003.2 (draft 11.3) definition of the AWK language which contains a few features not described in the AWK book, and mmaawwkk provides a small number of extensions. An AWK program is a sequence of _p_a_t_t_e_r_n _{_a_c_t_i_o_n_} pairs and function definitions. Short programs are entered on the command line usually enclosed in ' ' to avoid shell interpretation. Longer programs can be read in from a file with the -f option. Data input is read from the list of files on the command line or from standard input when the list is empty. The input is broken into records as determined by the record separator variable, RRSS. Initially, RRSS = "\n" and records are synony- mous with lines. Each record is compared against each _p_a_t_t_e_r_n and if it matches, the program text for _{_a_c_t_i_o_n_} is executed. OOPPTTIIOONNSS -FF _v_a_l_u_e sets the field separator, FFSS, to _v_a_l_u_e. -ff _f_i_l_e Program text is read from _f_i_l_e instead of from the com- mand line. Multiple --ff options are allowed. -vv _v_a_r_=_v_a_l_u_e assigns _v_a_l_u_e to program variable _v_a_r. -- indicates the unambiguous end of options. The above options will be available with any POSIX compatible implemen- tation of AWK. Implementation specific options are prefaced with --WW. mmaawwkk provides these: -WW dump writes an assembler like listing of the internal repre- sentation of the program to stdout and exits 0 (on suc- cessful compilation). -WW exec _f_i_l_e Program text is read from _f_i_l_e and this is the last option. This is a useful alternative to -ff on systems that sup- port the ##!! "magic number" convention for executable scripts. Those implicitly pass the pathname of the script itself as the final parameter, and expect no more than one "-" option on the ##!! line. Because mmaawwkk can combine multiple -WW options separated by commas, you can use this option when an additional -WW option is needed. -WW help prints a usage message to stderr and exits (same as "-WW usage"). -WW interactive sets unbuffered writes to stdout and line buffered reads from stdin. Records from stdin are lines regardless of the value of RRSS. -WW posix_space forces mmaawwkk not to consider '\n' to be space. -WW random=_n_u_m calls ssrraanndd with the given parameter (and overrides the auto-seeding behavior). -WW sprintf=_n_u_m adjusts the size of mmaawwkk's internal sprintf buffer to _n_u_m bytes. More than rare use of this option indicates mmaawwkk should be recompiled. -WW usage prints a usage message to stderr and exits (same as "-WW help"). -WW version mmaawwkk writes its version and copyright to stdout and com- piled limits to stderr and exits 0. mmaawwkk accepts abbreviations for any of these options, e.g., "-WW v" and "-WWv" both tell mmaawwkk to show its version. mmaawwkk allows multiple --WW options to be combined by separating the options with commas, e.g., -Wsprint=2000,posix. This is useful for executable ##!! "magic number" invocations in which only one argument is supported, e.g., -WWiinntteerraaccttiivvee,,eexxeecc. TTHHEE AAWWKK LLAANNGGUUAAGGEE 11.. PPrrooggrraamm ssttrruuccttuurree An AWK program is a sequence of _p_a_t_t_e_r_n _{_a_c_t_i_o_n_} pairs and user func- tion definitions. A pattern can be: BBEEGGIINN EENNDD expression expression , expression One, but not both, of _p_a_t_t_e_r_n _{_a_c_t_i_o_n_} can be omitted. If _{_a_c_t_i_o_n_} is omitted it is implicitly { print }. If _p_a_t_t_e_r_n is omitted, then it is implicitly matched. BBEEGGIINN and EENNDD patterns require an action. Statements are terminated by newlines, semi-colons or both. Groups of statements such as actions or loop bodies are blocked via { ... } as in C. The last statement in a block doesn't need a terminator. Blank lines have no meaning; an empty statement is terminated with a semi- colon. Long statements can be continued with a backslash, \. A state- ment can be broken without a backslash after a comma, left brace, &&, ||, ddoo, eellssee, the right parenthesis of an iiff, wwhhiillee or ffoorr statement, and the right parenthesis of a function definition. A comment starts with # and extends to, but does not include the end of line. The following statements control program flow inside blocks. iiff ( _e_x_p_r ) _s_t_a_t_e_m_e_n_t iiff ( _e_x_p_r ) _s_t_a_t_e_m_e_n_t eellssee _s_t_a_t_e_m_e_n_t wwhhiillee ( _e_x_p_r ) _s_t_a_t_e_m_e_n_t ddoo _s_t_a_t_e_m_e_n_t wwhhiillee ( _e_x_p_r ) ffoorr ( _o_p_t___e_x_p_r ; _o_p_t___e_x_p_r ; _o_p_t___e_x_p_r ) _s_t_a_t_e_m_e_n_t ffoorr ( _v_a_r iinn _a_r_r_a_y ) _s_t_a_t_e_m_e_n_t ccoonnttiinnuuee bbrreeaakk 22.. DDaattaa ttyyppeess,, ccoonnvveerrssiioonn aanndd ccoommppaarriissoonn There are two basic data types, numeric and string. Numeric constants can be integer like -2, decimal like 1.08, or in scientific notation like -1.1e4 or .28E-3. All numbers are represented internally and all computations are done in floating point arithmetic. So for example, the expression 0.2e2 == 20 is true and true is represented as 1.0. String constants are enclosed in double quotes. "This is a string with a newline at the end.\n" Strings can be continued across a line by escaping (\) the newline. The following escape sequences are recognized. \\ \ \" " \a alert, ascii 7 \b backspace, ascii 8 \t tab, ascii 9 \n newline, ascii 10 \v vertical tab, ascii 11 \f formfeed, ascii 12 \r carriage return, ascii 13 \ddd 1, 2 or 3 octal digits for ascii ddd \xhh 1 or 2 hex digits for ascii hh If you escape any other character \c, you get \c, i.e., mmaawwkk ignores the escape. There are really three basic data types; the third is _n_u_m_b_e_r _a_n_d _s_t_r_i_n_g which has both a numeric value and a string value at the same time. User defined variables come into existence when first referenced and are initialized to _n_u_l_l, a number and string value which has numeric value 0 and string value "". Non-trivial number and string typed data come from input and are typically stored in fields. (See section 4). The type of an expression is determined by its context and automatic type conversion occurs if needed. For example, to evaluate the state- ments y = x + 2 ; z = x "hello" The value stored in variable y will be typed numeric. If x is not numeric, the value read from x is converted to numeric before it is added to 2 and stored in y. The value stored in variable z will be typed string, and the value of x will be converted to string if neces- sary and concatenated with "hello". (Of course, the value and type stored in x is not changed by any conversions.) A string expression is converted to numeric using its longest numeric prefix as with aattooff(3). A numeric expression is converted to string by replacing _e_x_p_r with sspprriinnttff((CCOONNVVFFMMTT, _e_x_p_r), unless _e_x_p_r can be represented on the host machine as an exact integer then it is converted to sspprriinnttff("%d", _e_x_p_r). SSpprriinnttff(()) is an AWK built-in that duplicates the functionality of sspprriinnttff(3), and CCOONNVVFFMMTT is a built-in variable used for internal conversion from number to string and initialized to "%.6g". Explicit type conversions can be forced, _e_x_p_r "" is string and _e_x_p_r+0 is numeric. To evaluate, _e_x_p_r1 rreell--oopp _e_x_p_r2, if both operands are numeric or number and string then the comparison is numeric; if both operands are string the comparison is string; if one operand is string, the non-string op- erand is converted and the comparison is string. The result is numeric, 1 or 0. In boolean contexts such as, iiff ( _e_x_p_r ) _s_t_a_t_e_m_e_n_t, a string expression evaluates true if and only if it is not the empty string ""; numeric values if and only if not numerically zero. 33.. RReegguullaarr eexxpprreessssiioonnss In the AWK language, records, fields and strings are often tested for matching a _r_e_g_u_l_a_r _e_x_p_r_e_s_s_i_o_n. Regular expressions are enclosed in slashes, and _e_x_p_r ~ /_r/ is an AWK expression that evaluates to 1 if _e_x_p_r "matches" _r, which means a substring of _e_x_p_r is in the set of strings defined by _r. With no match the expression evaluates to 0; replacing ~ with the "not match" operator, !~ , reverses the meaning. As pattern-action pairs, /_r/ { _a_c_t_i_o_n } and $$00 ~ /_r/ { _a_c_t_i_o_n } are the same, and for each input record that matches _r, _a_c_t_i_o_n is exe- cuted. In fact, /_r/ is an AWK expression that is equivalent to ($$00 ~ /_r/) anywhere except when on the right side of a match operator or passed as an argument to a built-in function that expects a regular expression argument. AWK uses extended regular expressions as with the --EE option of ggrreepp(1). The regular expression metacharacters, i.e., those with special meaning in regular expressions are \ ^ $ . [ ] | ( ) * + ? Regular expressions are built up from characters as follows: _c matches any non-metacharacter _c. \_c matches a character defined by the same escape sequences used in string constants or the literal character _c if \_c is not an escape sequence. . matches any character (including newline). ^ matches the front of a string. $ matches the back of a string. [c1c2c3...] matches any character in the class c1c2c3... . An interval of characters is denoted c1-c2 inside a class [...]. [^c1c2c3...] matches any character not in the class c1c2c3... Regular expressions are built up from other regular expressions as fol- lows: _r1_r2 matches _r1 followed immediately by _r2 (concatena- tion). _r1 | _r2 matches _r1 or _r2 (alternation). _r* matches _r repeated zero or more times. _r+ matches _r repeated one or more times. _r? matches _r zero or once. (_r) matches _r, providing grouping. The increasing precedence of operators is alternation, concatenation and unary (*, + or ?). For example, /^[_a-zA-Z][_a-zA-Z0-9]*$/ and /^[-+]?([0-9]+\.?|\.[0-9])[0-9]*([eE][-+]?[0-9]+)?$/ are matched by AWK identifiers and AWK numeric constants respectively. Note that "." has to be escaped to be recognized as a decimal point, and that metacharacters are not special inside character classes. Any expression can be used on the right hand side of the ~ or !~ opera- tors or passed to a built-in that expects a regular expression. If needed, it is converted to string, and then interpreted as a regular expression. For example, BEGIN { identifier = "[_a-zA-Z][_a-zA-Z0-9]*" } $0 ~ "^" identifier prints all lines that start with an AWK identifier. mmaawwkk recognizes the empty regular expression, //, which matches the empty string and hence is matched by any string at the front, back and between every character. For example, echo abc | mawk { gsub(//, "X") ; print } XaXbXcX 44.. RReeccoorrddss aanndd ffiieellddss Records are read in one at a time, and stored in the _f_i_e_l_d variable $$00. The record is split into _f_i_e_l_d_s which are stored in $$11, $$22, ..., $$NNFF. The built-in variable NNFF is set to the number of fields, and NNRR and FFNNRR are incremented by 1. Fields above $$NNFF are set to "". Assignment to $$00 causes the fields and NNFF to be recomputed. Assignment to NNFF or to a field causes $$00 to be reconstructed by concatenating the $$ii''ss separated by OOFFSS. Assignment to a field with index greater than NNFF, increases NNFF and causes $$00 to be reconstructed. Data input stored in fields is string, unless the entire field has numeric form and then the type is number and string. For example, echo 24 24E | mawk '{ print($1>100, $1>"100", $2>100, $2>"100") }' 0 1 1 1 $$00 and $$22 are string and $$11 is number and string. The first comparison is numeric, the second is string, the third is string (100 is converted to "100"), and the last is string. 55.. EExxpprreessssiioonnss aanndd ooppeerraattoorrss The expression syntax is similar to C. Primary expressions are numeric constants, string constants, variables, fields, arrays and function calls. The identifier for a variable, array or function can be a sequence of letters, digits and underscores, that does not start with a digit. Variables are not declared; they exist when first referenced and are initialized to _n_u_l_l. New expressions are composed with the following operators in order of increasing precedence. _a_s_s_i_g_n_m_e_n_t = += -= *= /= %= ^= _c_o_n_d_i_t_i_o_n_a_l ? : _l_o_g_i_c_a_l _o_r || _l_o_g_i_c_a_l _a_n_d && _a_r_r_a_y _m_e_m_b_e_r_s_h_i_p iinn _m_a_t_c_h_i_n_g ~ !~ _r_e_l_a_t_i_o_n_a_l < > <= >= == != _c_o_n_c_a_t_e_n_a_t_i_o_n (no explicit operator) _a_d_d _o_p_s + - _m_u_l _o_p_s * / % _u_n_a_r_y + - _l_o_g_i_c_a_l _n_o_t ! _e_x_p_o_n_e_n_t_i_a_t_i_o_n ^ _i_n_c _a_n_d _d_e_c ++ -- (both post and pre) _f_i_e_l_d $ Assignment, conditional and exponentiation associate right to left; the other operators associate left to right. Any expression can be paren- thesized. 66.. AArrrraayyss Awk provides one-dimensional arrays. Array elements are expressed as _a_r_r_a_y[_e_x_p_r]. _E_x_p_r is internally converted to string type, so, for example, A[1] and A["1"] are the same element and the actual index is "1". Arrays indexed by strings are called associative arrays. Ini- tially an array is empty; elements exist when first accessed. An expression, _e_x_p_r iinn _a_r_r_a_y evaluates to 1 if _a_r_r_a_y[_e_x_p_r] exists, else to 0. There is a form of the ffoorr statement that loops over each index of an array. ffoorr ( _v_a_r iinn _a_r_r_a_y ) _s_t_a_t_e_m_e_n_t sets _v_a_r to each index of _a_r_r_a_y and executes _s_t_a_t_e_m_e_n_t. The order that _v_a_r transverses the indices of _a_r_r_a_y is not defined. The statement, ddeelleettee _a_r_r_a_y[_e_x_p_r], causes _a_r_r_a_y[_e_x_p_r] not to exist. mmaawwkk supports an extension, ddeelleettee _a_r_r_a_y, which deletes all elements of _a_r_r_a_y. Multidimensional arrays are synthesized with concatenation using the built-in variable SSUUBBSSEEPP. _a_r_r_a_y[_e_x_p_r1,_e_x_p_r2] is equivalent to _a_r_r_a_y[_e_x_p_r1 SSUUBBSSEEPP _e_x_p_r2]. Testing for a multidimensional element uses a parenthesized index, such as if ( (i, j) in A ) print A[i, j] 77.. BBuuiillttiinn--vvaarriiaabblleess The following variables are built-in and initialized before program execution. AARRGGCC number of command line arguments. AARRGGVV array of command line arguments, 0..ARGC-1. CCOONNVVFFMMTT format for internal conversion of numbers to string, initially = "%.6g". EENNVVIIRROONN array indexed by environment variables. An environment string, _v_a_r_=_v_a_l_u_e is stored as EENNVVIIRROONN[_v_a_r] = _v_a_l_u_e. FFIILLEENNAAMMEE name of the current input file. FFNNRR current record number in FFIILLEENNAAMMEE. FFSS splits records into fields as a regular expression. NNFF number of fields in the current record. NNRR current record number in the total input stream. OOFFMMTT format for printing numbers; initially = "%.6g". OOFFSS inserted between fields on output, initially = " ". OORRSS terminates each record on output, initially = "\n". RRLLEENNGGTTHH length set by the last call to the built-in function, mmaattcchh(()). RRSS input record separator, initially = "\n". RRSSTTAARRTT index set by the last call to mmaattcchh(()). SSUUBBSSEEPP used to build multiple array subscripts, initially = "\034". 88.. BBuuiilltt--iinn ffuunnccttiioonnss String functions gsub(_r_,_s_,_t) gsub(_r_,_s) Global substitution, every match of regular expression _r in variable _t is replaced by string _s. The number of replace- ments is returned. If _t is omitted, $$00 is used. An & in the replacement string _s is replaced by the matched sub- string of _t. \& and \\ put literal & and \, respectively, in the replacement string. index(_s_,_t) If _t is a substring of _s, then the position where _t starts is returned, else 0 is returned. The first character of _s is in position 1. length(_s) Returns the length of string or array. _s. match(_s_,_r) Returns the index of the first longest match of regular expression _r in string _s. Returns 0 if no match. As a side effect, RRSSTTAARRTT is set to the return value. RRLLEENNGGTTHH is set to the length of the match or -1 if no match. If the empty string is matched, RRLLEENNGGTTHH is set to 0, and 1 is returned if the match is at the front, and length(_s)+1 is returned if the match is at the back. split(_s_,_A_,_r) split(_s_,_A) String _s is split into fields by regular expression _r and the fields are loaded into array _A. The number of fields is returned. See section 11 below for more detail. If _r is omitted, FFSS is used. sprintf(_f_o_r_m_a_t_,_e_x_p_r_-_l_i_s_t) Returns a string constructed from _e_x_p_r_-_l_i_s_t according to _f_o_r_m_a_t. See the description of printf() below. sub(_r_,_s_,_t) sub(_r_,_s) Single substitution, same as gsub() except at most one sub- stitution. substr(_s_,_i_,_n) substr(_s_,_i) Returns the substring of string _s, starting at index _i, of length _n. If _n is omitted, the suffix of _s, starting at _i is returned. tolower(_s) Returns a copy of _s with all upper case characters con- verted to lower case. toupper(_s) Returns a copy of _s with all lower case characters con- verted to upper case. Time functions These are available on systems which support the corresponding C mmkkttiimmee and ssttrrffttiimmee functions: mktime(_s_p_e_c_i_f_i_c_a_t_i_o_n) converts a date specification to a timestamp with the same units as ssyyssttiimmee. The date specification is a string con- taining the components of the date as decimal integers: YYYY the year, e.g., 2012 MM the month of the year starting at 1 DD the day of the month starting at 1 HH hour (0-23) MM minute (0-59) SS seconds (0-59) DST tells how to treat timezone versus daylight savings time: positive DST is in effect zero (default) DST is not in effect negative mktime() should (use timezone information and sys- tem databases to) attempt to determine whether DST is in effect at the specified time. strftime([_f_o_r_m_a_t [, _t_i_m_e_s_t_a_m_p [, _u_t_c ]]]) formats the given timestamp using the format (passed to the C ssttrrffttiimmee function): +o If the _f_o_r_m_a_t parameter is missing, "%c" is used. +o If the _t_i_m_e_s_t_a_m_p parameter is missing, the current value from ssyyssttiimmee is used. +o If the _u_t_c parameter is present and nonzero, the result is in UTC. Otherwise local time is used. systime() returns the current time of day as the number of seconds since the Epoch (1970-01-01 00:00:00 UTC on POSIX systems). Arithmetic functions atan2(_y_,_x) Arctan of _y/_x between -pi and pi. cos(_x) Cosine function, _x in radians. exp(_x) Exponential function. int(_x) Returns _x truncated towards zero. log(_x) Natural logarithm. rand() Returns a random number between zero and one. sin(_x) Sine function, _x in radians. sqrt(_x) Returns square root of _x. srand(_e_x_p_r) srand() Seeds the random number generator, using the clock if _e_x_p_r is omitted, and returns the value of the previous seed. Srand(_e_x_p_r) is useful for repeating pseudo random sequences. Note: mmaawwkk is normally configured to seed the random number generator from the clock at startup, making it unnecessary to call srand(). This feature can be suppressed via condi- tional compile, or overridden using the --WWrraannddoomm option. 99.. IInnppuutt aanndd oouuttppuutt There are two output statements, pprriinntt and pprriinnttff. print writes $$00 OORRSS to standard output. print _e_x_p_r1, _e_x_p_r2, ..., _e_x_p_rn writes _e_x_p_r1 OOFFSS _e_x_p_r2 OOFFSS ... _e_x_p_rn OORRSS to standard out- put. Numeric expressions are converted to string with OOFFMMTT. printf _f_o_r_m_a_t_, _e_x_p_r_-_l_i_s_t duplicates the printf C library function writing to stan- dard output. The complete ANSI C format specifications are recognized with conversions %c, %d, %e, %E, %f, %g, %G, %i, %o, %s, %u, %x, %X and %%, and conversion qualifiers h and l. The argument list to print or printf can optionally be enclosed in parentheses. Print formats numbers using OOFFMMTT or "%d" for exact inte- gers. "%c" with a numeric argument prints the corresponding 8 bit character, with a string argument it prints the first character of the string. The output of print and printf can be redirected to a file or command by appending > _f_i_l_e, >> _f_i_l_e or | _c_o_m_m_a_n_d to the end of the print statement. Redirection opens _f_i_l_e or _c_o_m_m_a_n_d only once, subse- quent redirections append to the already open stream. By convention, mmaawwkk associates the filename +o "/dev/stderr" with stderr, +o "/dev/stdout" with stdout, +o "-" and "/dev/stdin" with stdin. The association with stderr is especially useful because it allows print and printf to be redirected to stderr. These names can also be passed to functions. The input function ggeettlliinnee has the following variations. getline reads into $$00, updates the fields, NNFF, NNRR and FFNNRR. getline < _f_i_l_e reads into $$00 from _f_i_l_e, updates the fields and NNFF. getline _v_a_r reads the next record into _v_a_r, updates NNRR and FFNNRR. getline _v_a_r < _f_i_l_e reads the next record of _f_i_l_e into _v_a_r. _c_o_m_m_a_n_d | getline pipes a record from _c_o_m_m_a_n_d into $$00 and updates the fields and NNFF. _c_o_m_m_a_n_d | getline _v_a_r pipes a record from _c_o_m_m_a_n_d into _v_a_r. Getline returns 0 on end-of-file, -1 on error, otherwise 1. Commands on the end of pipes are executed by /bin/sh. The function cclloossee(_e_x_p_r) closes the file or pipe associated with _e_x_p_r. Close returns 0 if _e_x_p_r is an open file, the exit status if _e_x_p_r is a piped command, and -1 otherwise. Close is used to reread a file or command, make sure the other end of an output pipe is finished or con- serve file resources. The function fffflluusshh(_e_x_p_r) flushes the output file or pipe associated with _e_x_p_r. Fflush returns 0 if _e_x_p_r is an open output stream else -1. Fflush without an argument flushes stdout. Fflush with an empty argu- ment ("") flushes all open output. The function ssyysstteemm(_e_x_p_r) uses the C runtime ssyysstteemm call to execute _e_x_p_r and returns the corresponding wait status of the command as fol- lows: +o if the ssyysstteemm call failed, setting the status to -1, _m_a_w_k returns that value. +o if the command exited normally, _m_a_w_k returns its exit-status. +o if the command exited due to a signal such as SSIIGGHHUUPP, _m_a_w_k returns the signal number plus 256. Changes made to the EENNVVIIRROONN array are not passed to commands executed with ssyysstteemm or pipes. 1100.. UUsseerr ddeeffiinneedd ffuunnccttiioonnss The syntax for a user defined function is ffuunnccttiioonn name( _a_r_g_s ) { _s_t_a_t_e_m_e_n_t_s } The function body can contain a return statement rreettuurrnn _o_p_t___e_x_p_r A return statement is not required. Function calls may be nested or recursive. Functions are passed expressions by value and arrays by reference. Extra arguments serve as local variables and are initial- ized to _n_u_l_l. For example, csplit(_s_,_A) puts each character of _s into array _A and returns the length of _s. function csplit(s, A, n, i) { n = length(s) for( i = 1 ; i <= n ; i++ ) A[i] = substr(s, i, 1) return n } Putting extra space between passed arguments and local variables is conventional. Functions can be referenced before they are defined, but the function name and the '(' of the arguments must touch to avoid con- fusion with concatenation. A function parameter is normally a scalar value (number or string). If there is a forward reference to a function using an array as a parame- ter, the function's corresponding parameter will be treated as an array. 1111.. SSpplliittttiinngg ssttrriinnggss,, rreeccoorrddss aanndd ffiilleess Awk programs use the same algorithm to split strings into arrays with split(), and records into fields on FFSS. mmaawwkk uses essentially the same algorithm to split files into records on RRSS. Split(_e_x_p_r_,_A_,_s_e_p) works as follows: (1) If _s_e_p is omitted, it is replaced by FFSS. _S_e_p can be an expres- sion or regular expression. If it is an expression of non- string type, it is converted to string. (2) If _s_e_p = " " (a single space), then is trimmed from the front and back of _e_x_p_r, and _s_e_p becomes . mmaawwkk defines as the regular expression /[ \t\n]+/. Otherwise _s_e_p is treated as a regular expression, except that meta-characters are ignored for a string of length 1, e.g., split(x, A, "*") and split(x, A, /\*/) are the same. (3) If _e_x_p_r is not string, it is converted to string. If _e_x_p_r is then the empty string "", split() returns 0 and _A is set empty. Otherwise, all non-overlapping, non-null and longest matches of _s_e_p in _e_x_p_r, separate _e_x_p_r into fields which are loaded into _A. The fields are placed in A[1], A[2], ..., A[n] and split() returns n, the number of fields which is the number of matches plus one. Data placed in _A that looks numeric is typed number and string. Splitting records into fields works the same except the pieces are loaded into $$11, $$22,..., $$NNFF. If $$00 is empty, NNFF is set to 0 and all $$ii to "". mmaawwkk splits files into records by the same algorithm, but with the slight difference that RRSS is really a terminator instead of a separa- tor. (OORRSS is really a terminator too). E.g., if FFSS = ":+" and $$00 = "a::b:" , then NNFF = 3 and $$11 = "a", $$22 = "b" and $$33 = "", but if "a::b:" is the contents of an input file and RRSS = ":+", then there are two records "a" and "b". RRSS = " " is not special. If FFSS = "", then mmaawwkk breaks the record into individual characters, and, similarly, split(_s_,_A_,"") places the individual characters of _s into _A. 1122.. MMuullttii--lliinnee rreeccoorrddss Since mmaawwkk interprets RRSS as a regular expression, multi-line records are easy. Setting RRSS = "\n\n+", makes one or more blank lines separate records. If FFSS = " " (the default), then single newlines, by the rules for above, become space and single newlines are field separa- tors. For example, if +o a file is "a b\nc\n\n", +o RRSS = "\n\n+" and +o FFSS = " ", then there is one record "a b\nc" with three fields "a", "b" and "c": +o Changing FFSS = "\n", gives two fields "a b" and "c"; +o changing FFSS = "", gives one field identical to the record. If you want lines with spaces or tabs to be considered blank, set RRSS = "\n([ \t]*\n)+". For compatibility with other awks, setting RRSS = "" has the same effect as if blank lines are stripped from the front and back of files and then records are determined as if RRSS = "\n\n+". POSIX requires that "\n" always separates records when RRSS = "" regard- less of the value of FFSS. mmaawwkk does not support this convention, because defining "\n" as makes it unnecessary. Most of the time when you change RRSS for multi-line records, you will also want to change OORRSS to "\n\n" so the record spacing is preserved on output. 1133.. PPrrooggrraamm eexxeeccuuttiioonn This section describes the order of program execution. First AARRGGCC is set to the total number of command line arguments passed to the execu- tion phase of the program. AARRGGVV[[00]] is set the name of the AWK inter- preter and AARRGGVV[[11]] ... AARRGGVV[[AARRGGCC--11]] holds the remaining command line arguments exclusive of options and program source. For example with mawk -f prog v=1 A t=hello B AARRGGCC = 5 with AARRGGVV[[00]] = "mawk", AARRGGVV[[11]] = "v=1", AARRGGVV[[22]] = "A", AARRGGVV[[33]] = "t=hello" and AARRGGVV[[44]] = "B". Next, each BBEEGGIINN block is executed in order. If the program consists entirely of BBEEGGIINN blocks, then execution terminates, else an input stream is opened and execution continues. If AARRGGCC equals 1, the input stream is set to stdin, else the command line arguments AARRGGVV[[11]] ... AARRGGVV[[AARRGGCC--11]] are examined for a file argument. The command line arguments divide into three sets: file arguments, assignment arguments and empty strings "". An assignment has the form _v_a_r=_s_t_r_i_n_g. When an AARRGGVV[[ii]] is examined as a possible file argument, if it is empty it is skipped; if it is an assignment argument, the assignment to _v_a_r takes place and ii skips to the next argument; else AARRGGVV[[ii]] is opened for input. If it fails to open, execution terminates with exit code 2. If no command line argument is a file argument, then input comes from stdin. Getline in a BBEEGGIINN action opens input. "-" as a file argument denotes stdin. Once an input stream is open, each input record is tested against each _p_a_t_t_e_r_n, and if it matches, the associated _a_c_t_i_o_n is executed. An expression pattern matches if it is boolean true (see the end of sec- tion 2). A BBEEGGIINN pattern matches before any input has been read, and an EENNDD pattern matches after all input has been read. A range pattern, _e_x_p_r1,_e_x_p_r2 , matches every record between the match of _e_x_p_r1 and the match _e_x_p_r2 inclusively. When end of file occurs on the input stream, the remaining command line arguments are examined for a file argument, and if there is one it is opened, else the EENNDD _p_a_t_t_e_r_n is considered matched and all EENNDD _a_c_t_i_o_n_s are executed. In the example, the assignment v=1 takes place after the BBEEGGIINN _a_c_t_i_o_n_s are executed, and the data placed in v is typed number and string. Input is then read from file A. On end of file A, t is set to the string "hello", and B is opened for input. On end of file B, the EENNDD _a_c_t_i_o_n_s are executed. Program flow at the _p_a_t_t_e_r_n _{_a_c_t_i_o_n_} level can be changed with the nneexxtt nneexxttffiillee eexxiitt _o_p_t___e_x_p_r statements: +o A nneexxtt statement causes the next input record to be read and pat- tern testing to restart with the first _p_a_t_t_e_r_n _{_a_c_t_i_o_n_} pair in the program. +o A nneexxttffiillee statement tells mmaawwkk to stop processing the current input file. It then updates FILENAME to the next file listed on the command line, and resets FNR to 1. +o An eexxiitt statement causes immediate execution of the EENNDD actions or program termination if there are none or if the eexxiitt occurs in an EENNDD action. The _o_p_t___e_x_p_r sets the exit value of the program unless overridden by a later eexxiitt or subsequent error. EEXXAAMMPPLLEESS 1. emulate cat. { print } 2. emulate wc. { chars += length($0) + 1 # add one for the \n words += NF } END{ print NR, words, chars } 3. count the number of unique "real words". BEGIN { FS = "[^A-Za-z]+" } { for(i = 1 ; i <= NF ; i++) word[$i] = "" } END { delete word[""] for ( i in word ) cnt++ print cnt } 4. sum the second field of every record based on the first field. $1 ~ /credit|gain/ { sum += $2 } $1 ~ /debit|loss/ { sum -= $2 } END { print sum } 5. sort a file, comparing as string { line[NR] = $0 "" } # make sure of comparison type # in case some lines look numeric END { isort(line, NR) for(i = 1 ; i <= NR ; i++) print line[i] } #insertion sort of A[1..n] function isort( A, n, i, j, hold) { for( i = 2 ; i <= n ; i++) { hold = A[j = i] while ( A[j-1] > hold ) { j-- ; A[j+1] = A[j] } A[j] = hold } # sentinel A[0] = "" will be created if needed } CCOOMMPPAATTIIBBIILLIITTYY IISSSSUUEESS MMAAWWKK 11..33..33 vveerrssuuss PPOOSSIIXX 11000033..22 DDrraafftt 1111..33 The POSIX 1003.2(draft 11.3) definition of the AWK language is AWK as described in the AWK book with a few extensions that appeared in Sys- temVR4 nawk. The extensions are: +o New functions: toupper() and tolower(). +o New variables: ENVIRON[] and CONVFMT. +o ANSI C conversion specifications for printf() and sprintf(). +o New command options: -v var=value, multiple -f options and implementation options as arguments to -W. +o For systems (MS-DOS or Windows) which provide a _s_e_t_m_o_d_e func- tion, an environment variable MAWKBINMODE and a built-in vari- able BINMODE. The bits of the BINMODE value tell _m_a_w_k how to modify the RRSS and OORRSS variables: 0 set standard input to binary mode, and if BIT-2 is unset, set RRSS to "\r\n" (CR/LF) rather than "\n" (LF). 1 set standard output to binary mode, and if BIT-2 is unset, set OORRSS to "\r\n" (CR/LF) rather than "\n" (LF). 2 suppress the assignment to RRSS and OORRSS of CR/LF, making it possible to run scripts and generate output compatible with Unix line-endings. POSIX AWK is oriented to operate on files a line at a time. RRSS can be changed from "\n" to another single character, but it is hard to find any use for this -- there are no examples in the AWK book. By conven- tion, RRSS = "", makes one or more blank lines separate records, allowing multi-line records. When RRSS = "", "\n" is always a field separator regardless of the value in FFSS. mmaawwkk, on the other hand, allows RRSS to be a regular expression. When "\n" appears in records, it is treated as space, and FFSS always deter- mines fields. Removing the line at a time paradigm can make some programs simpler and can often improve performance. For example, redoing example 3 from above, BEGIN { RS = "[^A-Za-z]+" } { word[ $0 ] = "" } END { delete word[ "" ] for( i in word ) cnt++ print cnt } counts the number of unique words by making each word a record. On moderate size files, mmaawwkk executes twice as fast, because of the sim- plified inner loop. The following program replaces each comment by a single space in a C program file, BEGIN { RS = "/\*([^*]|\*+[^/*])*\*+/" # comment is record separator ORS = " " getline hold } { print hold ; hold = $0 } END { printf "%s" , hold } Buffering one record is needed to avoid terminating the last record with a space. With mmaawwkk, the following are all equivalent, x ~ /a\+b/ x ~ "a\+b" x ~ "a\\+b" The strings get scanned twice, once as string and once as regular expression. On the string scan, mmaawwkk ignores the escape on non-escape characters while the AWK book advocates _\_c be recognized as _c which necessitates the double escaping of meta-characters in strings. POSIX explicitly declines to define the behavior which passively forces pro- grams that must run under a variety of awks to use the more portable but less readable, double escape. POSIX AWK does not recognize "/dev/std{in,out,err}". Some systems pro- vide an actual device for this, allowing AWKs which do not implement the feature directly to support it. POSIX AWK does not recognize \x hex escape sequences in strings. Unlike ANSI C, mmaawwkk limits the number of digits that follows \x to two as the current implementation only supports 8 bit characters. The built-in fffflluusshh first appeared in a recent (1993) AT&T awk released to netlib, and is not part of the POSIX standard. Aggregate deletion with ddeelleettee _a_r_r_a_y is not part of the POSIX standard. POSIX explicitly leaves the behavior of FFSS = "" undefined, and mentions splitting the record into characters as a possible interpretation, but currently this use is not portable across implementations. RRaannddoomm nnuummbbeerrss POSIX does not prescribe a method for initializing random numbers at startup. In practice, most implementations do nothing special, which makes ssrraanndd and rraanndd follow the C runtime library, making the initial seed value 1. Some implementations (Solaris XPG4 and Tru64) return 0 from the first call to ssrraanndd, although the results from rraanndd behave as if the initial seed is 1. Other implementations return 1. While mmaawwkk can call ssrraanndd at startup with no parameter (initializing random numbers from the clock), this feature may be suppressed using conditional compilation. EExxtteennssiioonnss aaddddeedd ffoorr ccoommppaattiibbiilliittyy ffoorr GGAAWWKK aanndd BBWWKK NNeexxttffiillee is a ggaawwkk extension (also implemented by BWK awk), is not yet part of the POSIX standard (as of October 2012), although it has been accepted for the next revision of the standard. MMkkttiimmee, ssttrrffttiimmee and ssyyssttiimmee are ggaawwkk extensions. The "/dev/stdin" feature was added to mmaawwkk after 1.3.4, for compatibil- ity with ggaawwkk and BWK awk. The corresponding "-" (alias for /dev/stdin) was present in mawk 1.3.3. SSuubbttllee DDiiffffeerreenncceess nnoott iinn PPOOSSIIXX oorr tthhee AAWWKK BBooookk Finally, here is how mmaawwkk handles exceptional cases not discussed in the AWK book or the POSIX draft. It is unsafe to assume consistency across awks and safe to skip to the next section. +o substr(s, i, n) returns the characters of s in the intersection of the closed interval [1, length(s)] and the half-open interval [i, i+n). When this intersection is empty, the empty string is returned; so substr("ABC", 1, 0) = "" and substr("ABC", -4, 6) = "A". +o Every string, including the empty string, matches the empty string at the front so, s ~ // and s ~ "", are always 1 as is match(s, //) and match(s, ""). The last two set RRLLEENNGGTTHH to 0. +o index(s, t) is always the same as match(s, t1) where t1 is the same as t with metacharacters escaped. Hence consistency with match requires that index(s, "") always returns 1. Also the condition, index(s,t) != 0 if and only t is a substring of s, requires index("","") = 1. +o If getline encounters end of file, getline var, leaves var unchanged. Similarly, on entry to the EENNDD actions, $$00, the fields and NNFF have their value unaltered from the last record. EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS MMaawwkk recognizes these variables: MAWKBINMODE (see CCOOMMPPAATTIIBBIILLIITTYY IISSSSUUEESS) MAWK_LONG_OPTIONS If this is set, mmaawwkk uses its value to decide what to do with GNU-style long options: allow MMaawwkk allows the option to be checked against the (small) set of long options it recognizes. error MMaawwkk prints an error message and exits. This is the default. ignore MMaawwkk ignores the option. warn Print an warning message and otherwise ignore the option. If the variable is unset, mmaawwkk prints an error message and exits. WHINY_USERS This is an undocumented ggaawwkk feature. It tells mmaawwkk to sort array indices before it starts to iterate over the elements of an array. SSEEEE AALLSSOO ggrreepp(1) Aho, Kernighan and Weinberger, _T_h_e _A_W_K _P_r_o_g_r_a_m_m_i_n_g _L_a_n_g_u_a_g_e, Addison- Wesley Publishing, 1988, (the AWK book), defines the language, opening with a tutorial and advancing to many interesting programs that delve into issues of software design and analysis relevant to programming in any language. _T_h_e _G_A_W_K _M_a_n_u_a_l, The Free Software Foundation, 1991, is a tutorial and language reference that does not attempt the depth of the AWK book and assumes the reader may be a novice programmer. The section on AWK arrays is excellent. It also discusses POSIX requirements for AWK. BBUUGGSS mmaawwkk implements printf() and sprintf() using the C library functions, printf and sprintf, so full ANSI compatibility requires an ANSI C library. In practice this means the h conversion qualifier may not be available. Also mmaawwkk inherits any bugs or limitations of the library functions. Implementors of the AWK language have shown a consistent lack of imagi- nation when naming their programs. AAUUTTHHOORR Mike Brennan (brennan@whidbey.com). Thomas E. Dickey . Version 1.3.4 2019-12-31 MAWK(1) mawk-1.3.4-20200120/man/Makefile.in0000644000175100001440000000224713611425173014711 0ustar tomusers# $MawkId: Makefile.in,v 1.3 2020/01/20 22:32:27 tom Exp $ ############################################################################### # copyright 2010-2015,2020 Thomas E. Dickey # # This is a source file for mawk, an implementation of # the AWK programming language. # # Mawk is distributed without warranty under the terms of # the GNU General Public License, version 2, 1991. ############################################################################### # produce alternate forms from mawk's documentation. SHELL=/bin/sh srcdir = @srcdir@ VPATH = @srcdir@ PROG = mawk manext = 1 .SUFFIXES : .html .$(manext) .man .ps .pdf .doc .txt .$(manext).html : ../man2html.tmp $* $(manext) man >$@ .$(manext).ps : $(SHELL) -c "tbl $*.$(manext) | groff -man" >$@ .$(manext).doc : GROFF_NO_SGR=stupid $(SHELL) -c "tbl $*.$(manext) | nroff -Tascii -man" >$@ .$(manext).txt : GROFF_NO_SGR=stupid $(SHELL) -c "tbl $*.$(manext) | nroff -Tascii -man | col -bx" >$@ .ps.pdf : ps2pdf $*.ps ALL = \ $(PROG).html \ $(PROG).pdf \ $(PROG).ps \ $(PROG).txt \ all: $(PROG).doc $(ALL) clean: -rm -f $(ALL) distclean: clean rm -f Makefile maintainer-clean: $(PROG).pdf : $(PROG).ps mawk-1.3.4-20200120/man/TODO0000644000175100001440000000362611254651152013335 0ustar tomusers-- $MawkId: TODO,v 1.6 2009/09/18 09:27:06 tom Exp $ mawk was implemented to conform with POSIX 1003.2-1992 According to http://www.opengroup.org/austin/papers/posix_faq.html that was merged into POSIX-1003.1, and the latest relevant text of that is documented here: http://www.opengroup.org/onlinepubs/009695399/utilities/awk.html The extended regular expressions are documented here: http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html Sections below refer to the awk.html sections. OPTIONS mawk complies here. OPERANDS mawk complies here. STDIN mawk complies here. INPUT FILES mawk complies here. ENVIRONMENT VARIABLES mawk ignores LC_COLLATE, LC_MESSAGES, LC_NUMERIC and NLSPATH mawk implements extensions MAWKBINMODE which gawk does as BINMODE MAWK_LONG_OPTIONS to ignore long options such as gawk's. Values are: error, warn, ignore (only the first character is checked). WHINY_USERS feature from gawk which makes iteration over array in sorted order. EXTENDED DESCRIPTION strings are converted to double using strtod(), which could be implemented using atof(). ENVIRON and CONVFMT are in the standard now, not extensions. >Expressions in awk mawk complies >Variables and Special Variables mawk complies >Regular Expressions mawk's built-in regular expressions do not support brace expressions (used to denote minimum/maximum number of matches). mawk can be built with an external regular-expression library. However, POSIX regular expressions do not support matches of NUL-bytes. mawk's internal regular expressions support NULs. >Expression Patterns ok >Pattern Ranges ok >Actions delete is now part of POSIX-1003.1 >Output Statements mawk does not use popen/pclose for opening/closing a pipe. >Arithmetic Functions ok >String Functions toupper and tolower are now part of POSIX-1003.1 >Input/Output and General Functions ok >User-Defined Functions ok mawk-1.3.4-20200120/man/mawk.10000644000175100001440000012552013602720633013664 0ustar tomusers.\" $MawkId: mawk.1,v 1.36 2019/12/31 19:29:31 tom Exp $ .\" ########################################################################### .\" # copyright 2008-2016,2019, Thomas E. Dickey .\" # copyright 1996, Michael D. Brennan .\" # .\" # This is a source file for mawk, an implementation of .\" # the AWK programming language. .\" # .\" # Mawk is distributed without warranty under the terms of .\" # the GNU General Public License, version 2, 1991. .\" ########################################################################### .ds N Mawk .ds n mawk .TH MAWK 1 "2019-12-31" "Version 1.3.4" "USER COMMANDS" .\" strings .ds ex \fIexpr\fR .\" Bulleted paragraph .de bP .ie n .IP \(bu 4 .el .IP \(bu 2 .. .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds AQ \(aq .el .ds AQ ' .ie \n(.g .ds `` \(lq .el .ds `` `` .ie \n(.g .ds '' \(rq .el .ds '' '' .\" ************************************************************************** .SH NAME mawk \- pattern scanning and text processing language .\" ************************************************************************** .SH SYNOPSIS \fB\*n\fP [\-\fBW .IR option ] [\-\fBF .IR value ] [\-\fBv .IR var=value ] [\-\|\-] 'program text' [file ...] .br \fB\*n\fP [\-\fBW .IR option ] [\-\fBF .IR value ] [\-\fBv .IR var=value ] [\-\fBf .IR program-file ] [\-\|\-] [file ...] .\" ************************************************************************** .SH DESCRIPTION \fB\*n\fP is an interpreter for the AWK Programming Language. The AWK language is useful for manipulation of data files, text retrieval and processing, and for prototyping and experimenting with algorithms. \fB\*n\fP is a \fInew awk\fR meaning it implements the AWK language as defined in Aho, Kernighan and Weinberger, .I "The AWK Programming Language," Addison-Wesley Publishing, 1988 (hereafter referred to as the AWK book.) \fB\*n\fP conforms to the POSIX 1003.2 (draft 11.3) definition of the AWK language which contains a few features not described in the AWK book, and \fB\*n\fP provides a small number of extensions. .PP An AWK program is a sequence of \fIpattern {action}\fR pairs and function definitions. Short programs are entered on the command line usually enclosed in ' ' to avoid shell interpretation. Longer programs can be read in from a file with the \-f option. Data input is read from the list of files on the command line or from standard input when the list is empty. The input is broken into records as determined by the record separator variable, \fBRS\fR. Initially, .B RS = \*(``\en\*('' and records are synonymous with lines. Each record is compared against each .I pattern and if it matches, the program text for .I "{action}" is executed. .\" ************************************************************************** .SH OPTIONS .TP \w'\-\fBW'u+\w'\fRsprintf=\fInum\fR'u+2n \-\fBF \fIvalue\fP sets the field separator, \fBFS\fR, to .IR value . .TP \-\fBf \fIfile Program text is read from \fIfile\fR instead of from the command line. Multiple .B \-f options are allowed. .TP \-\fBv \fIvar=value\fR assigns .I value to program variable .IR var . .TP \-\|\- indicates the unambiguous end of options. .PP The above options will be available with any POSIX compatible implementation of AWK. Implementation specific options are prefaced with .BR \-W . \fB\*n\fP provides these: .TP \w'\-\fBW'u+\w'\fRsprintf=\fInum\fR'u+2n \-\fBW \fRdump writes an assembler like listing of the internal representation of the program to stdout and exits 0 (on successful compilation). .TP \-\fBW \fRexec \fIfile Program text is read from .I file and this is the last option. .IP This is a useful alternative to \-\fBf\fP on systems that support the .B #! \*(``magic number\*('' convention for executable scripts. Those implicitly pass the pathname of the script itself as the final parameter, and expect no more than one \*(``\-\*('' option on the \fB#!\fP line. Because \fB\*n\fP can combine multiple \-\fBW\fP options separated by commas, you can use this option when an additional \-\fBW\fP option is needed. .TP \-\fBW \fRhelp prints a usage message to stderr and exits (same as \*(``\-\fBW\ \fRusage\*(''). .TP \-\fBW \fRinteractive sets unbuffered writes to stdout and line buffered reads from stdin. Records from stdin are lines regardless of the value of .BR RS . .TP \-\fBW \fRposix_space forces \fB\*n\fP not to consider '\en' to be space. .TP \-\fBW \fRrandom=\fInum\fR calls \fBsrand\fP with the given parameter (and overrides the auto-seeding behavior). .TP \-\fBW \fRsprintf=\fInum\fR adjusts the size of \fB\*n\fP's internal sprintf buffer to .I num bytes. More than rare use of this option indicates \fB\*n\fP should be recompiled. .TP \-\fBW \fRusage prints a usage message to stderr and exits (same as \*(``\-\fBW\ \fRhelp\*(''). .TP \-\fBW \fRversion \fB\*n\fP writes its version and copyright to stdout and compiled limits to stderr and exits 0. .PP \fB\*n\fP accepts abbreviations for any of these options, e.g., \*(``\-\fBW\ \fRv\*('' and \*(``\-\fBW\fRv\*('' both tell \fB\*n\fP to show its version. .PP \fB\*n\fP allows multiple \fB\-W\fP options to be combined by separating the options with commas, e.g., \-Wsprint=2000,posix. This is useful for executable .B #! \*(``magic number\*('' invocations in which only one argument is supported, e.g., \-\fBWinteractive,exec\fP. .\" ************************************************************************** .SH "THE AWK LANGUAGE" .SS "\fB1. Program structure" An AWK program is a sequence of .I "pattern {action}" pairs and user function definitions. .PP A pattern can be: .nf .RS 5 \fBBEGIN\fR \fBEND\fR expression expression , expression .sp .RE .fi One, but not both, of \fIpattern {action}\fR can be omitted. If .I {action} is omitted it is implicitly { print }. If .I pattern is omitted, then it is implicitly matched. .B BEGIN and .B END patterns require an action. .PP Statements are terminated by newlines, semi-colons or both. Groups of statements such as actions or loop bodies are blocked via {\ ...\ } as in C. The last statement in a block doesn't need a terminator. Blank lines have no meaning; an empty statement is terminated with a semi-colon. Long statements can be continued with a backslash, \e\|. A statement can be broken without a backslash after a comma, left brace, &&, ||, .BR do , .BR else , the right parenthesis of an .BR if , .B while or .B for statement, and the right parenthesis of a function definition. A comment starts with # and extends to, but does not include the end of line. .PP The following statements control program flow inside blocks. .RS 5 .PP .B if ( \*(ex ) .I statement .PP .B if ( \*(ex ) .I statement .B else .I statement .PP .B while ( \*(ex ) .I statement .PP .B do .I statement .B while ( \*(ex ) .PP .B for ( \fIopt_expr\fR ; \fIopt_expr\fR ; \fIopt_expr\fR ) .I statement .PP .B for ( \fIvar \fBin \fIarray\fR ) .I statement .PP .B continue .PP .B break .RE .\" .SS "\fB2. Data types, conversion and comparison" There are two basic data types, numeric and string. Numeric constants can be integer like \-2, decimal like 1.08, or in scientific notation like \-1.1e4 or .28E\-3. All numbers are represented internally and all computations are done in floating point arithmetic. So for example, the expression 0.2e2 == 20 is true and true is represented as 1.0. .PP String constants are enclosed in double quotes. .sp .ce "This is a string with a newline at the end.\en" .sp Strings can be continued across a line by escaping (\e) the newline. The following escape sequences are recognized. .nf .sp \e\e \e \e" " \ea alert, ascii 7 \eb backspace, ascii 8 \et tab, ascii 9 \en newline, ascii 10 \ev vertical tab, ascii 11 \ef formfeed, ascii 12 \er carriage return, ascii 13 \eddd 1, 2 or 3 octal digits for ascii ddd \exhh 1 or 2 hex digits for ascii hh .sp .fi If you escape any other character \ec, you get \ec, i.e., \fB\*n\fP ignores the escape. .PP There are really three basic data types; the third is .I "number and string" which has both a numeric value and a string value at the same time. User defined variables come into existence when first referenced and are initialized to .IR null , a number and string value which has numeric value 0 and string value "". Non-trivial number and string typed data come from input and are typically stored in fields. (See section 4). .PP The type of an expression is determined by its context and automatic type conversion occurs if needed. For example, to evaluate the statements .nf .sp y = x + 2 ; z = x "hello" .sp .fi The value stored in variable y will be typed numeric. If x is not numeric, the value read from x is converted to numeric before it is added to 2 and stored in y. The value stored in variable z will be typed string, and the value of x will be converted to string if necessary and concatenated with "hello". (Of course, the value and type stored in x is not changed by any conversions.) A string expression is converted to numeric using its longest numeric prefix as with \fBatof\fP(3). A numeric expression is converted to string by replacing .I expr with .BR sprintf(CONVFMT , .IR expr ), unless .I expr can be represented on the host machine as an exact integer then it is converted to \fBsprintf\fR("%d", \*(ex). .B Sprintf() is an AWK built-in that duplicates the functionality of \fBsprintf\fP(3), and \fBCONVFMT\fP is a built-in variable used for internal conversion from number to string and initialized to "%.6g". Explicit type conversions can be forced, \*(ex "" is string and .IR expr +0 is numeric. .PP To evaluate, \*(ex\d1\u \fBrel-op \*(ex\d2\u, if both operands are numeric or number and string then the comparison is numeric; if both operands are string the comparison is string; if one operand is string, the non-string operand is converted and the comparison is string. The result is numeric, 1 or 0. .PP In boolean contexts such as, \fBif\fR ( \*(ex ) \fIstatement\fR, a string expression evaluates true if and only if it is not the empty string ""; numeric values if and only if not numerically zero. .\" .SS "\fB3. Regular expressions" In the AWK language, records, fields and strings are often tested for matching a .IR "regular expression" . Regular expressions are enclosed in slashes, and .nf .sp \*(ex ~ /\fIr\fR/ .sp .fi is an AWK expression that evaluates to 1 if \*(ex \*(``matches\*('' .IR r , which means a substring of \*(ex is in the set of strings defined by .IR r . With no match the expression evaluates to 0; replacing ~ with the \*(``not match\*('' operator, !~ , reverses the meaning. As pattern-action pairs, .nf .sp /\fIr\fR/ { \fIaction\fR } and\ \fB$0\fR ~ /\fIr\fR/ { \fIaction\fR } .sp .fi are the same, and for each input record that matches .IR r , .I action is executed. In fact, /\fIr\fR/ is an AWK expression that is equivalent to (\fB$0\fR ~ /\fIr\fR/) anywhere except when on the right side of a match operator or passed as an argument to a built-in function that expects a regular expression argument. .PP AWK uses extended regular expressions as with the \fB\-E\fP option of \fBgrep\fP(1). The regular expression metacharacters, i.e., those with special meaning in regular expressions are .nf .sp \\ ^ $ . [ ] | ( ) * + ? .sp .fi Regular expressions are built up from characters as follows: .RS 5 .TP \w'[^c\d1\uc\d2\uc\d3\u...]'u+1n \fIc\fR matches any non-metacharacter .IR c . .TP \e\fIc\fR matches a character defined by the same escape sequences used in string constants or the literal character .I c if \e\fIc\fR is not an escape sequence. .TP \&\. matches any character (including newline). .TP ^ matches the front of a string. .TP $ matches the back of a string. .TP [c\d1\uc\d2\uc\d3\u...] matches any character in the class c\d1\uc\d2\uc\d3\u...\ . An interval of characters is denoted c\d1\u\-c\d2\u inside a class [...]. .TP [^c\d1\uc\d2\uc\d3\u...] matches any character not in the class c\d1\uc\d2\uc\d3\u... .RE .sp Regular expressions are built up from other regular expressions as follows: .RS 5 .TP \w'[^c\d1\uc\d2\uc\d3\u...]'u+1n \fIr\fR\d1\u\fIr\fR\d2\u matches \fIr\fR\d1\u followed immediately by \fIr\fR\d2\u (concatenation). .TP \fIr\fR\d1\u | \fIr\fR\d2\u matches \fIr\fR\d1\u or \fIr\fR\d2\u (alternation). .TP \fIr\fR* matches \fIr\fR repeated zero or more times. .TP \fIr\fR+ matches \fIr\fR repeated one or more times. .TP \fIr\fR? matches \fIr\fR zero or once. .TP (\fIr\fR) matches \fIr\fR, providing grouping. .RE .sp The increasing precedence of operators is alternation, concatenation and unary (*, + or ?). .PP For example, .nf .sp /^[_a\-zA\-Z][_a\-zA\-Z0\-9]*$/ and /^[\-+]?([0\-9]+\e\|.?|\e\|.[0\-9])[0\-9]*([eE][\-+]?[0\-9]+)?$/ .sp .fi are matched by AWK identifiers and AWK numeric constants respectively. Note that \*(``.\*('' has to be escaped to be recognized as a decimal point, and that metacharacters are not special inside character classes. .PP Any expression can be used on the right hand side of the ~ or !~ operators or passed to a built-in that expects a regular expression. If needed, it is converted to string, and then interpreted as a regular expression. For example, .nf .sp BEGIN { identifier = "[_a\-zA\-Z][_a\-zA\-Z0\-9]*" } $0 ~ "^" identifier .sp .fi prints all lines that start with an AWK identifier. .PP \fB\*n\fP recognizes the empty regular expression, //\|, which matches the empty string and hence is matched by any string at the front, back and between every character. For example, .nf .sp echo abc | \*n { gsub(//, "X") ; print } XaXbXcX .sp .fi .\" .SS "\fB4. Records and fields" Records are read in one at a time, and stored in the .I field variable .BR $0 . The record is split into .I fields which are stored in .BR $1 , .BR $2 ", ...," .BR $NF . The built-in variable .B NF is set to the number of fields, and .B NR and .B FNR are incremented by 1. Fields above .B $NF are set to "". .PP Assignment to .B $0 causes the fields and .B NF to be recomputed. Assignment to .B NF or to a field causes .B $0 to be reconstructed by concatenating the .B $i's separated by .BR OFS . Assignment to a field with index greater than .BR NF , increases .B NF and causes .B $0 to be reconstructed. .PP Data input stored in fields is string, unless the entire field has numeric form and then the type is number and string. For example, .sp .nf echo 24 24E | \*n '{ print($1>100, $1>"100", $2>100, $2>"100") }' 0 1 1 1 .fi .sp .B $0 and .B $2 are string and .B $1 is number and string. The first comparison is numeric, the second is string, the third is string (100 is converted to "100"), and the last is string. .\" .SS "\fB5. Expressions and operators" .PP The expression syntax is similar to C. Primary expressions are numeric constants, string constants, variables, fields, arrays and function calls. The identifier for a variable, array or function can be a sequence of letters, digits and underscores, that does not start with a digit. Variables are not declared; they exist when first referenced and are initialized to .IR null . .PP New expressions are composed with the following operators in order of increasing precedence. .PP .RS 5 .nf .vs +2p \" open up a little \fIassignment\fR = += \-= *= /= %= ^= \fIconditional\fR ? : \fIlogical or\fR || \fIlogical and\fR && \fIarray membership\fR \fBin \fImatching\fR ~ !~ \fIrelational\fR < > <= >= == != \fIconcatenation\fR (no explicit operator) \fIadd ops\fR + \- \fImul ops\fR * / % \fIunary\fR + \- \fIlogical not\fR ! \fIexponentiation\fR ^ \fIinc and dec\fR ++ \-\|\- (both post and pre) \fIfield\fR $ .vs .RE .PP .fi Assignment, conditional and exponentiation associate right to left; the other operators associate left to right. Any expression can be parenthesized. .\" .SS "\fB6. Arrays" .ds ae \fIarray\fR[\fIexpr\fR] Awk provides one-dimensional arrays. Array elements are expressed as \*(ae. .I Expr is internally converted to string type, so, for example, A[1] and A["1"] are the same element and the actual index is "1". Arrays indexed by strings are called associative arrays. Initially an array is empty; elements exist when first accessed. An expression, \fIexpr\fB in\fI array\fR evaluates to 1 if \*(ae exists, else to 0. .PP There is a form of the .B for statement that loops over each index of an array. .nf .sp \fBfor\fR ( \fIvar\fB in \fIarray \fR) \fIstatement\fR .sp .fi sets .I var to each index of .I array and executes .IR statement . The order that .I var transverses the indices of .I array is not defined. .PP The statement, .B delete \*(ae, causes \*(ae not to exist. \fB\*n\fP supports an extension, .B delete .IR array , which deletes all elements of .IR array . .PP Multidimensional arrays are synthesized with concatenation using the built-in variable .BR SUBSEP . \fIarray\fR[\fIexpr\fR\d1\u,\|\fIexpr\fR\d2\u] is equivalent to \fIarray\fR[\fIexpr\fR\d1\u \fBSUBSEP \fIexpr\fR\d2\u]. Testing for a multidimensional element uses a parenthesized index, such as .sp .nf if ( (i, j) in A ) print A[i, j] .fi .sp .\" .SS "\fB7. Builtin-variables\fR" .PP The following variables are built-in and initialized before program execution. .RS 5 .TP \w'FILENAME'u+2n .B ARGC number of command line arguments. .TP .B ARGV array of command line arguments, 0..ARGC\-1. .TP .B CONVFMT format for internal conversion of numbers to string, initially = "%.6g". .TP .B ENVIRON array indexed by environment variables. An environment string, \fIvar=value\fR is stored as \fBENVIRON\fR[\fIvar\fR] = .IR value . .TP .B FILENAME name of the current input file. .TP .B FNR current record number in .BR FILENAME . .TP .B FS splits records into fields as a regular expression. .TP .B NF number of fields in the current record. .TP .B NR current record number in the total input stream. .TP .B OFMT format for printing numbers; initially = "%.6g". .TP .B OFS inserted between fields on output, initially = " ". .TP .B ORS terminates each record on output, initially = "\en". .TP .B RLENGTH length set by the last call to the built-in function, .BR match() . .TP .B RS input record separator, initially = "\en". .TP .B RSTART index set by the last call to .BR match() . .TP .B SUBSEP used to build multiple array subscripts, initially = "\e034". .RE .\" .SS "\fB8. Built-in functions" String functions .RS 5 .TP gsub(\fIr,s,t\fR) gsub(\fIr,s\fR) Global substitution, every match of regular expression .I r in variable .I t is replaced by string .IR s . The number of replacements is returned. If .I t is omitted, .B $0 is used. An & in the replacement string .I s is replaced by the matched substring of .IR t . \e& and \e\e put literal & and \e, respectively, in the replacement string. .TP index(\fIs,t\fR) If .I t is a substring of .IR s , then the position where .I t starts is returned, else 0 is returned. The first character of .I s is in position 1. .TP length(\fIs\fR) Returns the length of string or array. .IR s . .TP match(\fIs,r\fR) Returns the index of the first longest match of regular expression .I r in string .IR s . Returns 0 if no match. As a side effect, .B RSTART is set to the return value. .B RLENGTH is set to the length of the match or \-1 if no match. If the empty string is matched, .B RLENGTH is set to 0, and 1 is returned if the match is at the front, and length(\fIs\fR)+1 is returned if the match is at the back. .TP split(\fIs,A,r\fR) split(\fIs,A\fR) String .I s is split into fields by regular expression .I r and the fields are loaded into array .IR A . The number of fields is returned. See section 11 below for more detail. If .I r is omitted, .B FS is used. .TP sprintf(\fIformat,expr-list\fR) Returns a string constructed from .I expr-list according to .IR format . See the description of printf() below. .TP sub(\fIr,s,t\fR) sub(\fIr,s\fR) Single substitution, same as gsub() except at most one substitution. .TP substr(\fIs,i,n\fR) substr(\fIs,i\fR) Returns the substring of string .IR s , starting at index .IR i , of length .IR n . If .I n is omitted, the suffix of .IR s , starting at .I i is returned. .TP tolower(\fIs\fR) Returns a copy of .I s with all upper case characters converted to lower case. .TP toupper(\fIs\fR) Returns a copy of .I s with all lower case characters converted to upper case. .RE .PP Time functions .PP These are available on systems which support the corresponding C \fBmktime\fP and \fBstrftime\fP functions: .RS 5 .TP mktime(\fIspecification\fR) converts a date specification to a timestamp with the same units as \fBsystime\fP. The date specification is a string containing the components of the date as decimal integers: .RS .TP 3 YYYY the year, e.g., 2012 .TP 3 MM the month of the year starting at 1 .TP 3 DD the day of the month starting at 1 .TP 3 HH hour (0-23) .TP 3 MM minute (0-59) .TP 3 SS seconds (0-59) .TP 3 DST tells how to treat timezone versus daylight savings time: .RS 5 .TP 3 positive DST is in effect .TP 3 zero (default) DST is not in effect .TP 3 negative mktime() should (use timezone information and system databases to) attempt to determine whether DST is in effect at the specified time. .RE .RE .TP strftime([\fIformat\fR [, \fItimestamp\fP [, \fIutc\fP ]]]) formats the given timestamp using the format (passed to the C \fBstrftime\fP function): .RS .bP If the \fIformat\fP parameter is missing, "%c" is used. .bP If the \fItimestamp\fP parameter is missing, the current value from \fBsystime\fP is used. .bP If the \fIutc\fP parameter is present and nonzero, the result is in UTC. Otherwise local time is used. .RE .TP systime() returns the current time of day as the number of seconds since the Epoch (1970-01-01 00:00:00 UTC on POSIX systems). .RE .PP Arithmetic functions .RS 5 .PP .nf .ie n .ds Pi pi .el .ds Pi \\(*p atan2(\fIy,x\fR) Arctan of \fIy\fR/\fIx\fR between \-\*(Pi and \*(Pi. .PP cos(\fIx\fR) Cosine function, \fIx\fR in radians. .PP exp(\fIx\fR) Exponential function. .PP int(\fIx\fR) Returns \fIx\fR truncated towards zero. .PP log(\fIx\fR) Natural logarithm. .PP rand() Returns a random number between zero and one. .PP sin(\fIx\fR) Sine function, \fIx\fR in radians. .PP sqrt(\fIx\fR) Returns square root of \fIx\fR. .fi .TP srand(\fIexpr\fR) srand() Seeds the random number generator, using the clock if \fIexpr\fP is omitted, and returns the value of the previous seed. Srand(\fIexpr\fR) is useful for repeating pseudo random sequences. .IP Note: \fB\*n\fP is normally configured to seed the random number generator from the clock at startup, making it unnecessary to call srand(). This feature can be suppressed via conditional compile, or overridden using the \fB\-Wrandom\fP option. .RE .\" .SS "\fB9. Input and output" There are two output statements, .B print and .BR printf . .RS 5 .TP print writes .B "$0 ORS" to standard output. .TP print \*(ex\d1\u, \*(ex\d2\u, ..., \*(ex\dn\u writes \*(ex\d1\u \fBOFS \*(ex\d2\u \fBOFS\fR ... \*(ex\dn\u .B ORS to standard output. Numeric expressions are converted to string with .BR OFMT . .TP printf \fIformat, expr-list\fR duplicates the printf C library function writing to standard output. The complete ANSI C format specifications are recognized with conversions %c, %d, %e, %E, %f, %g, %G, %i, %o, %s, %u, %x, %X and %%, and conversion qualifiers h and l. .RE .PP The argument list to print or printf can optionally be enclosed in parentheses. Print formats numbers using .B OFMT or "%d" for exact integers. "%c" with a numeric argument prints the corresponding 8 bit character, with a string argument it prints the first character of the string. The output of print and printf can be redirected to a file or command by appending > .IR file , >> .I file or | .I command to the end of the print statement. Redirection opens .I file or .I command only once, subsequent redirections append to the already open stream. By convention, \fB\*n\fP associates the filename .RS 3 .bP "/dev/stderr" with stderr, .bP "/dev/stdout" with stdout, .bP "\-" and "/dev/stdin" with stdin. .RE .PP The association with stderr is especially useful because it allows print and printf to be redirected to stderr. These names can also be passed to functions. .PP The input function .B getline has the following variations. .RS 5 .TP getline reads into .BR $0 , updates the fields, .BR NF , .B NR and .BR FNR . .TP getline < \fIfile\fR reads into .B $0 from \fIfile\fR, updates the fields and .BR NF . .TP getline \fIvar reads the next record into .IR var , updates .B NR and .BR FNR . .TP getline \fIvar\fR < \fIfile reads the next record of .I file into .IR var . .TP \fIcommand\fR | getline pipes a record from .I command into .B $0 and updates the fields and .BR NF . .TP \fIcommand\fR | getline \fIvar pipes a record from .I command into .IR var . .RE .PP Getline returns 0 on end-of-file, \-1 on error, otherwise 1. .PP Commands on the end of pipes are executed by /bin/sh. .PP The function \fBclose\fR(\*(ex) closes the file or pipe associated with .IR expr . Close returns 0 if .I expr is an open file, the exit status if .I expr is a piped command, and \-1 otherwise. Close is used to reread a file or command, make sure the other end of an output pipe is finished or conserve file resources. .PP The function \fBfflush\fR(\*(ex) flushes the output file or pipe associated with .IR expr . Fflush returns 0 if .I expr is an open output stream else \-1. Fflush without an argument flushes stdout. Fflush with an empty argument ("") flushes all open output. .PP The function \fBsystem\fR(\fIexpr\fR) uses the C runtime \fBsystem\fP call to execute .I expr and returns the corresponding wait status of the command as follows: .bP if the \fBsystem\fP call failed, setting the status to -1, \fImawk\fP returns that value. .bP if the command exited normally, \fImawk\fP returns its exit-status. .bP if the command exited due to a signal such as \fBSIGHUP\fP, \fImawk\fP returns the signal number plus 256. .PP Changes made to the .B ENVIRON array are not passed to commands executed with .B system or pipes. .SS "\fB10. User defined functions" The syntax for a user defined function is .nf .sp \fBfunction\fR name( \fIargs\fR ) { \fIstatements\fR } .sp .fi The function body can contain a return statement .nf .sp \fBreturn\fI opt_expr\fR .sp .fi A return statement is not required. Function calls may be nested or recursive. Functions are passed expressions by value and arrays by reference. Extra arguments serve as local variables and are initialized to .IR null . For example, csplit(\fIs,\|A\fR) puts each character of .I s into array .I A and returns the length of .IR s . .nf .sp function csplit(s, A, n, i) { n = length(s) for( i = 1 ; i <= n ; i++ ) A[i] = substr(s, i, 1) return n } .sp .fi Putting extra space between passed arguments and local variables is conventional. Functions can be referenced before they are defined, but the function name and the '(' of the arguments must touch to avoid confusion with concatenation. .sp A function parameter is normally a scalar value (number or string). If there is a forward reference to a function using an array as a parameter, the function's corresponding parameter will be treated as an array. .\" .SS "\fB11. Splitting strings, records and files" Awk programs use the same algorithm to split strings into arrays with split(), and records into fields on .BR FS . \fB\*n\fP uses essentially the same algorithm to split files into records on .BR RS . .PP Split(\fIexpr,\|A,\|sep\fR) works as follows: .RS 3 .TP 5 (1) If .I sep is omitted, it is replaced by .BR FS . .I Sep can be an expression or regular expression. If it is an expression of non-string type, it is converted to string. .TP (2) If .I sep = " " (a single space), then is trimmed from the front and back of .IR expr , and .I sep becomes . \fB\*n\fP defines as the regular expression /[\ \et\en]+/. Otherwise .I sep is treated as a regular expression, except that meta-characters are ignored for a string of length 1, e.g., split(x, A, "*") and split(x, A, /\e*/) are the same. .TP (3) If \*(ex is not string, it is converted to string. If \*(ex is then the empty string "", split() returns 0 and .I A is set empty. Otherwise, all non-overlapping, non-null and longest matches of .I sep in .IR expr , separate .I expr into fields which are loaded into .IR A . The fields are placed in A[1], A[2], ..., A[n] and split() returns n, the number of fields which is the number of matches plus one. Data placed in .I A that looks numeric is typed number and string. .RE .PP Splitting records into fields works the same except the pieces are loaded into .BR $1 , \fB$2\fR,..., .BR $NF . If .B $0 is empty, .B NF is set to 0 and all .B $i to "". .PP \fB\*n\fP splits files into records by the same algorithm, but with the slight difference that .B RS is really a terminator instead of a separator. (\fBORS\fR is really a terminator too). .RS 5 .PP E.g., if .B FS = \*(``:+\*('' and .B $0 = \*(``a::b:\*('' , then .B NF = 3 and .B $1 = \*(``a\*('', .B $2 = \*(``b\*('' and .B $3 = "", but if \*(``a::b:\*('' is the contents of an input file and .B RS = \*(``:+\*('', then there are two records \*(``a\*('' and \*(``b\*(''. .RE .PP .B RS = " " is not special. .PP If .B FS = "", then \fB\*n\fP breaks the record into individual characters, and, similarly, split(\fIs,A,\fR"") places the individual characters of .I s into .IR A . .\" .SS "\fB12. Multi-line records" Since \fB\*n\fP interprets .B RS as a regular expression, multi-line records are easy. Setting .B RS = "\en\en+", makes one or more blank lines separate records. If .B FS = " " (the default), then single newlines, by the rules for above, become space and single newlines are field separators. .RS 5 .PP For example, if .bP a file is "a\ b\enc\en\en", .bP \fBRS\fP = "\en\en+" and .bP \fBFS\fP = "\ ", .PP then there is one record \*(``a\ b\enc\*('' with three fields \*(``a\*('', \*(``b\*('' and \*(``c\*('': .bP Changing .B FS = \*(``\en\*('', gives two fields \*(``a b\*('' and \*(``c\*(''; .bP changing .B FS = \*(``\*('', gives one field identical to the record. .RE .PP If you want lines with spaces or tabs to be considered blank, set .B RS = \*(``\en([\ \et]*\en)+\*(''. For compatibility with other awks, setting .B RS = "" has the same effect as if blank lines are stripped from the front and back of files and then records are determined as if .B RS = \*(``\en\en+\*(''. POSIX requires that \*(``\en\*('' always separates records when .B RS = "" regardless of the value of .BR FS . \fB\*n\fP does not support this convention, because defining \*(``\en\*('' as makes it unnecessary. .\" .PP Most of the time when you change .B RS for multi-line records, you will also want to change .B ORS to \*(``\en\en\*('' so the record spacing is preserved on output. .\" .SS "\fB13. Program execution" This section describes the order of program execution. First .B ARGC is set to the total number of command line arguments passed to the execution phase of the program. .B ARGV[0] is set the name of the AWK interpreter and \fBARGV[1]\fR ... .B ARGV[ARGC\-1] holds the remaining command line arguments exclusive of options and program source. For example with .nf .sp \*n \-f prog v=1 A t=hello B .sp .fi .B ARGC = 5 with .B ARGV[0] = "\*n", .B ARGV[1] = "v=1", .B ARGV[2] = "A", .B ARGV[3] = "t=hello" and .B ARGV[4] = "B". .PP Next, each .B BEGIN block is executed in order. If the program consists entirely of .B BEGIN blocks, then execution terminates, else an input stream is opened and execution continues. If .B ARGC equals 1, the input stream is set to stdin, else the command line arguments .BR ARGV[1] " ... .B ARGV[ARGC\-1] are examined for a file argument. .PP The command line arguments divide into three sets: file arguments, assignment arguments and empty strings "". An assignment has the form \fIvar\fR=\fIstring\fR. When an .B ARGV[i] is examined as a possible file argument, if it is empty it is skipped; if it is an assignment argument, the assignment to .I var takes place and .B i skips to the next argument; else .B ARGV[i] is opened for input. If it fails to open, execution terminates with exit code 2. If no command line argument is a file argument, then input comes from stdin. Getline in a .B BEGIN action opens input. \*(``\-\*('' as a file argument denotes stdin. .PP Once an input stream is open, each input record is tested against each .IR pattern , and if it matches, the associated .I action is executed. An expression pattern matches if it is boolean true (see the end of section 2). A .B BEGIN pattern matches before any input has been read, and an .B END pattern matches after all input has been read. A range pattern, \fIexpr\fR1,\|\fIexpr\fR2 , matches every record between the match of .IR expr 1 and the match .IR expr 2 inclusively. .PP When end of file occurs on the input stream, the remaining command line arguments are examined for a file argument, and if there is one it is opened, else the .B END .I pattern is considered matched and all .B END .I actions are executed. .PP In the example, the assignment v=1 takes place after the .B BEGIN .I actions are executed, and the data placed in v is typed number and string. Input is then read from file A. On end of file A, t is set to the string "hello", and B is opened for input. On end of file B, the .B END .I actions are executed. .PP Program flow at the .I pattern .I {action} level can be changed with the .nf .sp \fBnext \fBnextfile \fBexit \fIopt_expr\fR .sp .fi statements: .bP A .B next statement causes the next input record to be read and pattern testing to restart with the first .I "pattern {action}" pair in the program. .bP A .B nextfile statement tells \fB\*n\fP to stop processing the current input file. It then updates FILENAME to the next file listed on the command line, and resets FNR to 1. .bP An .B exit statement causes immediate execution of the .B END actions or program termination if there are none or if the .B exit occurs in an .B END action. The .I opt_expr sets the exit value of the program unless overridden by a later .B exit or subsequent error. .\" ************************************************************************** .SH EXAMPLES .nf 1. emulate cat. { print } 2. emulate wc. { chars += length($0) + 1 # add one for the \en words += NF } END{ print NR, words, chars } 3. count the number of unique \*(``real words\*(''. BEGIN { FS = "[^A\-Za\-z]+" } { for(i = 1 ; i <= NF ; i++) word[$i] = "" } END { delete word[""] for ( i in word ) cnt++ print cnt } .fi 4. sum the second field of every record based on the first field. .nf $1 ~ /credit\||\|gain/ { sum += $2 } $1 ~ /debit\||\|loss/ { sum \-= $2 } END { print sum } 5. sort a file, comparing as string { line[NR] = $0 "" } # make sure of comparison type # in case some lines look numeric END { isort(line, NR) for(i = 1 ; i <= NR ; i++) print line[i] } #insertion sort of A[1..n] function isort( A, n, i, j, hold) { for( i = 2 ; i <= n ; i++) { hold = A[j = i] while ( A[j\-1] > hold ) { j\-\|\- ; A[j+1] = A[j] } A[j] = hold } # sentinel A[0] = "" will be created if needed } .fi .\" ************************************************************************** .SH "COMPATIBILITY ISSUES" .SS "MAWK 1.3.3 versus POSIX 1003.2 Draft 11.3" The POSIX 1003.2(draft 11.3) definition of the AWK language is AWK as described in the AWK book with a few extensions that appeared in SystemVR4 nawk. The extensions are: .RS 3 .bP New functions: toupper() and tolower(). .bP New variables: ENVIRON[\|] and CONVFMT. .bP ANSI C conversion specifications for printf() and sprintf(). .bP New command options: \-v var=value, multiple \-f options and implementation options as arguments to \-W. .bP For systems (MS-DOS or Windows) which provide a \fIsetmode\fP function, an environment variable MAWKBINMODE and a built-in variable BINMODE. The bits of the BINMODE value tell \fImawk\fP how to modify the \fBRS\fP and \fBORS\fP variables: .RS .TP 3 0 set standard input to binary mode, and if BIT-2 is unset, set \fBRS\fP to "\\r\\n" (CR/LF) rather than "\\n" (LF). .TP 3 1 set standard output to binary mode, and if BIT-2 is unset, set \fBORS\fP to "\\r\\n" (CR/LF) rather than "\\n" (LF). .TP 3 2 suppress the assignment to \fBRS\fP and \fBORS\fP of CR/LF, making it possible to run scripts and generate output compatible with Unix line-endings. .RE .RE .sp POSIX AWK is oriented to operate on files a line at a time. .B RS can be changed from "\en" to another single character, but it is hard to find any use for this \(em there are no examples in the AWK book. By convention, \fBRS\fR = "", makes one or more blank lines separate records, allowing multi-line records. When \fBRS\fR = "", "\en" is always a field separator regardless of the value in .BR FS . .PP .BR \*n , on the other hand, allows .B RS to be a regular expression. When "\en" appears in records, it is treated as space, and .B FS always determines fields. .PP Removing the line at a time paradigm can make some programs simpler and can often improve performance. For example, redoing example 3 from above, .nf .sp BEGIN { RS = "[^A\-Za\-z]+" } { word[ $0 ] = "" } END { delete word[ "" ] for( i in word ) cnt++ print cnt } .sp .fi counts the number of unique words by making each word a record. On moderate size files, \fB\*n\fP executes twice as fast, because of the simplified inner loop. .PP The following program replaces each comment by a single space in a C program file, .nf .sp BEGIN { RS = "/\|\e*([^*]\||\|\e*+[^/*])*\e*+/" # comment is record separator ORS = " " getline hold } { print hold ; hold = $0 } END { printf "%s" , hold } .sp .fi Buffering one record is needed to avoid terminating the last record with a space. .PP With .BR \*n , the following are all equivalent, .nf .sp x ~ /a\e+b/ x ~ "a\e+b" x ~ "a\e\e+b" .sp .fi The strings get scanned twice, once as string and once as regular expression. On the string scan, \fB\*n\fP ignores the escape on non-escape characters while the AWK book advocates .I \ec be recognized as .I c which necessitates the double escaping of meta-characters in strings. POSIX explicitly declines to define the behavior which passively forces programs that must run under a variety of awks to use the more portable but less readable, double escape. .PP POSIX AWK does not recognize "/dev/std{in,out,err}". Some systems provide an actual device for this, allowing AWKs which do not implement the feature directly to support it. .PP POSIX AWK does not recognize \ex hex escape sequences in strings. Unlike ANSI C, \fB\*n\fP limits the number of digits that follows \ex to two as the current implementation only supports 8 bit characters. The built-in .B fflush first appeared in a recent (1993) AT&T awk released to netlib, and is not part of the POSIX standard. Aggregate deletion with .B delete .I array is not part of the POSIX standard. .PP POSIX explicitly leaves the behavior of .B FS = "" undefined, and mentions splitting the record into characters as a possible interpretation, but currently this use is not portable across implementations. .SS "Random numbers" .PP POSIX does not prescribe a method for initializing random numbers at startup. .PP In practice, most implementations do nothing special, which makes \fBsrand\fP and \fBrand\fP follow the C runtime library, making the initial seed value 1. Some implementations (Solaris XPG4 and Tru64) return 0 from the first call to \fBsrand\fP, although the results from \fBrand\fP behave as if the initial seed is 1. Other implementations return 1. .PP While \fB\*n\fP can call \fBsrand\fP at startup with no parameter (initializing random numbers from the clock), this feature may be suppressed using conditional compilation. . .SS "Extensions added for compatibility for GAWK and BWK" .PP .B Nextfile is a \fBgawk\fP extension (also implemented by BWK awk), is not yet part of the POSIX standard (as of October 2012), although it has been accepted for the next revision of the standard. .PP .BR Mktime , .BR strftime \ and .B systime are \fBgawk\fP extensions. .PP The "/dev/stdin" feature was added to \fBmawk\fP after 1.3.4, for compatibility with \fBgawk\fP and BWK awk. The corresponding "-" (alias for /dev/stdin) was present in \*n 1.3.3. . .SS "Subtle Differences not in POSIX or the AWK Book" .PP Finally, here is how \fB\*n\fP handles exceptional cases not discussed in the AWK book or the POSIX draft. It is unsafe to assume consistency across awks and safe to skip to the next section. .PP .RS 3 .bP substr(s, i, n) returns the characters of s in the intersection of the closed interval [1, length(s)] and the half-open interval [i, i+n). When this intersection is empty, the empty string is returned; so substr("ABC", 1, 0) = "" and substr("ABC", \-4, 6) = "A". .bP Every string, including the empty string, matches the empty string at the front so, s ~ // and s ~ "", are always 1 as is match(s, //) and match(s, ""). The last two set .B RLENGTH to 0. .bP index(s, t) is always the same as match(s, t1) where t1 is the same as t with metacharacters escaped. Hence consistency with match requires that index(s, "") always returns 1. Also the condition, index(s,t) != 0 if and only t is a substring of s, requires index("","") = 1. .bP If getline encounters end of file, getline var, leaves var unchanged. Similarly, on entry to the .B END actions, .BR $0 , the fields and .B NF have their value unaltered from the last record. .\" ************************************************************************** .SH ENVIRONMENT VARIABLES \fB\*N\fP recognizes these variables: .RS 3 .TP 3 MAWKBINMODE (see \fBCOMPATIBILITY ISSUES\fP) .TP MAWK_LONG_OPTIONS If this is set, \fB\*n\fP uses its value to decide what to do with GNU-style long options: .RS 5 .TP allow \fB\*N\fP allows the option to be checked against the (small) set of long options it recognizes. .TP error \fB\*N\fP prints an error message and exits. This is the default. .TP ignore \fB\*N\fP ignores the option. .TP warn Print an warning message and otherwise ignore the option. .RE .IP If the variable is unset, \fB\*n\fP prints an error message and exits. .TP WHINY_USERS This is an undocumented \fBgawk\fP feature. It tells \fB\*n\fP to sort array indices before it starts to iterate over the elements of an array. .RE .\" ************************************************************************** .SH SEE ALSO .PP \fBgrep\fP(1) .PP Aho, Kernighan and Weinberger, .IR "The AWK Programming Language" , Addison-Wesley Publishing, 1988, (the AWK book), defines the language, opening with a tutorial and advancing to many interesting programs that delve into issues of software design and analysis relevant to programming in any language. .PP .IR "The GAWK Manual" , The Free Software Foundation, 1991, is a tutorial and language reference that does not attempt the depth of the AWK book and assumes the reader may be a novice programmer. The section on AWK arrays is excellent. It also discusses POSIX requirements for AWK. .\" ************************************************************************** .SH BUGS .PP \fB\*n\fP implements printf() and sprintf() using the C library functions, printf and sprintf, so full ANSI compatibility requires an ANSI C library. In practice this means the h conversion qualifier may not be available. Also \fB\*n\fP inherits any bugs or limitations of the library functions. .PP Implementors of the AWK language have shown a consistent lack of imagination when naming their programs. .\" ************************************************************************** .SH AUTHOR Mike Brennan (brennan@whidbey.com). .br Thomas E. Dickey . mawk-1.3.4-20200120/scancode.h0000644000175100001440000000341611500456220014010 0ustar tomusers/******************************************** scancode.h copyright 2009, Jonathan Nieder copyright 1991, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: scancode.h,v 1.2 2010/12/10 17:00:00 tom Exp $ * @Log: scancode.h,v @ */ /* scancode.h */ #ifndef SCANCODE_H_INCLUDED #define SCANCODE_H_INCLUDED 1 extern char scan_code[256]; /* the scan codes to compactify the main switch */ #define SC_SPACE 1 #define SC_NL 2 #define SC_SEMI_COLON 3 #define SC_FAKE_SEMI_COLON 4 #define SC_LBRACE 5 #define SC_RBRACE 6 #define SC_QMARK 7 #define SC_COLON 8 #define SC_OR 9 #define SC_AND 10 #define SC_PLUS 11 #define SC_MINUS 12 #define SC_MUL 13 #define SC_DIV 14 #define SC_MOD 15 #define SC_POW 16 #define SC_LPAREN 17 #define SC_RPAREN 18 #define SC_LBOX 19 #define SC_RBOX 20 #define SC_IDCHAR 21 #define SC_DIGIT 22 #define SC_DQUOTE 23 #define SC_ESCAPE 24 #define SC_COMMENT 25 #define SC_EQUAL 26 #define SC_NOT 27 #define SC_LT 28 #define SC_GT 29 #define SC_COMMA 30 #define SC_DOT 31 #define SC_MATCH 32 #define SC_DOLLAR 33 #define SC_UNEXPECTED 34 #endif /* SCANCODE_H_INCLUDED */ mawk-1.3.4-20200120/code.h0000644000175100001440000000572213424172225013154 0ustar tomusers/******************************************** code.h copyright 2009-2012,2019, Thomas E. Dickey copyright 1991-1994,1995, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: code.h,v 1.11 2019/01/30 00:49:25 tom Exp $ */ /* code.h */ #ifndef MAWK_CODE_H #define MAWK_CODE_H #include "memory.h" #define PAGESZ 512 /* number of code instructions allocated at one time */ #define CODEWARN 16 /* coding scope */ #define SCOPE_MAIN 0 #define SCOPE_BEGIN 1 #define SCOPE_END 2 #define SCOPE_FUNCT 3 typedef struct { INST *base, *limit, *warn, *ptr; } CODEBLOCK; extern CODEBLOCK active_code; extern CODEBLOCK *main_code_p, *begin_code_p, *end_code_p; extern INST *main_start, *begin_start, *end_start; extern size_t main_size, begin_size; extern INST *execution_start; extern INST *next_label; /* next statements jump to here */ extern int dump_code_flag; #define CodeOffset(base) (int)(code_ptr - (base)) #define code_ptr active_code.ptr #define code_base active_code.base #define code_warn active_code.warn #define code_limit active_code.limit #define code_offset CodeOffset(code_base) #define INST_BYTES(x) (sizeof(INST)*(unsigned)(x)) extern CELL eval_stack[]; extern int exit_code; #define code1(x) code_ptr++ -> op = (x) /* shutup picky compilers */ #define code2(x,p) xcode2(x,(PTR)(p)) void xcode2(int, PTR); void code2op(int, int); INST *code_shrink(CODEBLOCK *, size_t *); void code_grow(void); void set_code(void); void be_setup(int); void dump_code(void); /* the machine opcodes */ /* to avoid confusion with a ptr FE_PUSHA must have op code 0 */ typedef enum { FE_PUSHA = 0 ,FE_PUSHI ,F_PUSHA ,F_PUSHI ,NF_PUSHI ,_HALT ,_STOP ,_PUSHC ,_PUSHD ,_PUSHS ,_PUSHINT ,_PUSHA ,_PUSHI ,L_PUSHA ,L_PUSHI ,AE_PUSHA ,AE_PUSHI ,A_PUSHA ,LAE_PUSHA ,LAE_PUSHI ,LA_PUSHA ,_POP ,_ADD ,_SUB ,_MUL ,_DIV ,_MOD ,_POW ,_NOT ,_TEST ,A_LENGTH ,A_TEST ,A_DEL ,ALOOP ,A_CAT ,_UMINUS ,_UPLUS ,_ASSIGN ,_ADD_ASG ,_SUB_ASG ,_MUL_ASG ,_DIV_ASG ,_MOD_ASG ,_POW_ASG ,F_ASSIGN ,F_ADD_ASG ,F_SUB_ASG ,F_MUL_ASG ,F_DIV_ASG ,F_MOD_ASG ,F_POW_ASG ,_CAT ,_BUILTIN ,_PRINT ,_POST_INC ,_POST_DEC ,_PRE_INC ,_PRE_DEC ,F_POST_INC ,F_POST_DEC ,F_PRE_INC ,F_PRE_DEC ,_JMP ,_JNZ ,_JZ ,_LJZ ,_LJNZ ,_EQ ,_NEQ ,_LT ,_LTE ,_GT ,_GTE ,_MATCH0 ,_MATCH1 ,_MATCH2 ,_EXIT ,_EXIT0 ,_NEXT ,_NEXTFILE ,_RANGE ,_CALL ,_RET ,_RET0 ,SET_ALOOP ,POP_AL ,OL_GL ,OL_GL_NR ,_OMAIN ,_JMAIN ,DEL_A } MAWK_OPCODES; #endif /* MAWK_CODE_H */ mawk-1.3.4-20200120/jmp.c0000644000175100001440000001273511500456220013016 0ustar tomusers/******************************************** jmp.c copyright 2009,2010, Thomas E. Dickey copyright 1991-1993,1995, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: jmp.c,v 1.6 2010/12/10 17:00:00 tom Exp $ * @Log: jmp.c,v @ * Revision 1.4 1995/06/18 19:42:19 mike * Remove some redundant declarations and add some prototypes * * Revision 1.3 1995/04/21 14:20:16 mike * move_level variable to fix bug in arglist patching of moved code. * * Revision 1.2 1993/07/14 13:17:49 mike * rm SIZE_T and run thru indent * * Revision 1.1.1.1 1993/07/03 18:58:15 mike * move source to cvs * * Revision 5.3 1993/01/09 19:03:44 mike * code_pop checks if the resolve_list needs relocation * * Revision 5.2 1993/01/07 02:50:33 mike * relative vs absolute code * * Revision 5.1 1991/12/05 07:56:10 brennan * 1.1 pre-release */ /* this module deals with back patching jumps, breaks and continues, and with save and restoring code when we move code. There are three stacks. If we encounter a compile error, the stacks are frozen, i.e., we do not attempt error recovery on the stacks */ #include "mawk.h" #include "symtype.h" #include "jmp.h" #include "code.h" #include "sizes.h" #include "init.h" #include "memory.h" #define error_state (compile_error_count>0) /*---------- back patching jumps ---------------*/ typedef struct jmp { struct jmp *link; int source_offset; } JMP; static JMP *jmp_top; void code_jmp(int jtype, INST * target) { if (error_state) return; /* WARNING: Don't emit any code before using target or relocation might make it invalid */ if (target) code2op(jtype, (int) (target - (code_ptr + 1))); else { register JMP *p = ZMALLOC(JMP); /* stack for back patch */ code2op(jtype, 0); p->source_offset = code_offset - 1; p->link = jmp_top; jmp_top = p; } } /* patch a jump on the jmp_stack */ void patch_jmp(INST * target) { register JMP *p; register INST *source; /* jmp starts here */ if (!error_state) { #ifdef DEBUG if (!jmp_top) bozo("jmp stack underflow"); #endif p = jmp_top; jmp_top = p->link; source = p->source_offset + code_base; source->op = (int) (target - source); ZFREE(p); } } /*-- break and continue -------*/ typedef struct bc { struct bc *link; /* stack as linked list */ int type; /* 'B' or 'C' or mark start with 0 */ int source_offset; /* position of _JMP */ } BC; static BC *bc_top; void BC_new(void) /* mark the start of a loop */ { BC_insert(0, (INST *) 0); } void BC_insert(int type, INST * address) { register BC *p; if (error_state) return; if (type && !bc_top) { compile_error("%s statement outside of loop", type == 'B' ? "break" : "continue"); return; } else { p = ZMALLOC(BC); p->type = type; p->source_offset = (int) (address - code_base); p->link = bc_top; bc_top = p; } } /* patch all break and continues for one loop */ void BC_clear(INST * B_address, INST * C_address) { register BC *p, *q; INST *source; if (error_state) return; p = bc_top; /* pop down to the mark node */ while (p->type) { source = code_base + p->source_offset; source->op = (int) ((p->type == 'B' ? B_address : C_address) - source); q = p; p = p->link; ZFREE(q); } /* remove the mark node */ bc_top = p->link; ZFREE(p); } /*----- moving code --------------------------*/ /* a stack to hold some pieces of code while reorganizing loops . */ typedef struct mc { /* mc -- move code */ struct mc *link; INST *code; /* the save code */ unsigned len; /* its length */ int scope; /* its scope */ int move_level; /* size of this stack when coded */ FBLOCK *fbp; /* if scope FUNCT */ int offset; /* distance from its code base */ } MC; static MC *mc_top; int code_move_level = 0; /* see comment in jmp.h */ #define NO_SCOPE -1 /* means relocation of resolve list not needed */ void code_push(INST * code, unsigned len, int scope, FBLOCK * fbp) { register MC *p; if (!error_state) { p = ZMALLOC(MC); p->len = len; p->link = mc_top; mc_top = p; if (len) { p->code = (INST *) zmalloc(sizeof(INST) * len); memcpy(p->code, code, sizeof(INST) * len); } if (!resolve_list) p->scope = NO_SCOPE; else { p->scope = scope; p->move_level = code_move_level; p->fbp = fbp; if (code) p->offset = (int) (code - code_base); else p->offset = 0; } } code_move_level++; } /* copy the code at the top of the mc stack to target. return the number of INSTs moved */ unsigned code_pop(INST * target) { register MC *p; unsigned len; int target_offset; if (error_state) return 0; #ifdef DEBUG if (!mc_top) bozo("mc underflow"); #endif p = mc_top; mc_top = p->link; len = p->len; while (target + len >= code_warn) { target_offset = (int) (target - code_base); code_grow(); target = code_base + target_offset; } if (len) { memcpy(target, p->code, len * sizeof(INST)); zfree(p->code, len * sizeof(INST)); } if (p->scope != NO_SCOPE) { target_offset = (int) (target - code_base); relocate_resolve_list(p->scope, p->move_level, p->fbp, p->offset, len, target_offset - p->offset); } ZFREE(p); code_move_level--; return len; } mawk-1.3.4-20200120/fcall.c0000644000175100001440000002220513604752452013317 0ustar tomusers/******************************************** fcall.c copyright 2009-2012,2020 Thomas E. Dickey copyright 1991-1993,1995, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: fcall.c,v 1.11 2020/01/07 00:47:38 tom Exp $ */ #include "mawk.h" #include "symtype.h" #include "code.h" /* This file has functions involved with type checking of function calls */ static void relocate_arglist(CA_REC *, int, unsigned, int); static int check_progress; /* flag that indicates call_arg_check() was able to type check some call arguments */ #if OPT_TRACE static void trace_arg_list(CA_REC * arg_list) { CA_REC *item; int count = 0; while ((item = arg_list) != 0) { arg_list = item->link; TRACE((" arg[%d] is %s\n", count, type_to_str(item->type))); ++count; } } #else #define trace_arg_list(arg_list) /* nothing */ #endif /* type checks a list of call arguments, returns a list of arguments whose type is still unknown */ static CA_REC * call_arg_check(FBLOCK * callee, CA_REC * entry_list, INST * start) { register CA_REC *q; CA_REC *exit_list = (CA_REC *) 0; TRACE(("call_arg_check\n")); check_progress = 0; /* loop : take q off entry_list test it if OK zfree(q) else put on exit_list */ while ((q = entry_list)) { entry_list = q->link; TRACE(("...arg is %s\n", type_to_str(q->type))); if (q->type == ST_NONE) { /* try to infer the type */ /* it might now be in symbol table */ if (q->sym_p->type == ST_VAR) { TRACE(("...use CA_EXPR\n")); /* set type and patch */ q->type = CA_EXPR; start[q->call_offset + 1].ptr = (PTR) q->sym_p->stval.cp; } else if (q->sym_p->type == ST_ARRAY) { TRACE(("...use CA_ARRAY\n")); q->type = CA_ARRAY; start[q->call_offset].op = A_PUSHA; start[q->call_offset + 1].ptr = (PTR) q->sym_p->stval.array; } else { /* try to infer from callee */ TRACE(("...infer?\n")); switch (callee->typev[q->arg_num]) { case ST_LOCAL_VAR: q->type = CA_EXPR; q->sym_p->type = ST_VAR; q->sym_p->stval.cp = ZMALLOC(CELL); q->sym_p->stval.cp->type = C_NOINIT; start[q->call_offset + 1].ptr = (PTR) q->sym_p->stval.cp; break; case ST_LOCAL_ARRAY: q->type = CA_ARRAY; q->sym_p->type = ST_ARRAY; q->sym_p->stval.array = new_ARRAY(); start[q->call_offset].op = A_PUSHA; start[q->call_offset + 1].ptr = (PTR) q->sym_p->stval.array; break; } } } else if (q->type == ST_LOCAL_NONE) { TRACE(("...infer2?\n")); /* try to infer the type */ if (*q->type_p == ST_LOCAL_VAR) { /* set type , don't need to patch */ q->type = CA_EXPR; } else if (*q->type_p == ST_LOCAL_ARRAY) { q->type = CA_ARRAY; start[q->call_offset].op = LA_PUSHA; /* offset+1 op is OK */ } else { /* try to infer from callee */ switch (callee->typev[q->arg_num]) { case ST_LOCAL_VAR: q->type = CA_EXPR; *q->type_p = ST_LOCAL_VAR; /* do not need to patch */ break; case ST_LOCAL_ARRAY: q->type = CA_ARRAY; *q->type_p = ST_LOCAL_ARRAY; start[q->call_offset].op = LA_PUSHA; break; } } } /* if we still do not know the type put on the new list else type check */ if (q->type == ST_NONE || q->type == ST_LOCAL_NONE) { q->link = exit_list; exit_list = q; } else { /* type known */ if (callee->typev[q->arg_num] == ST_LOCAL_NONE) { callee->typev[q->arg_num] = (char) q->type; } else if (q->type != callee->typev[q->arg_num]) { token_lineno = q->call_lineno; compile_error("type error in arg(%d) in call to %s", q->arg_num + 1, callee->name); } ZFREE(q); check_progress = 1; } } /* while */ return exit_list; } static int arg_cnt_ok(FBLOCK * fbp, CA_REC * q) { if ((int) q->arg_num >= (int) fbp->nargs) { token_lineno = q->call_lineno; compile_error("too many arguments in call to %s", fbp->name); return 0; } else return 1; } FCALL_REC *resolve_list; /* function calls whose arg types need checking are stored on this list */ /* on first pass thru the resolve list we check : if forward referenced functions were really defined if right number of arguments and compute call_start which is now known */ static FCALL_REC * first_pass(FCALL_REC * p) { FCALL_REC dummy; register FCALL_REC *q = &dummy; /* trails p */ q->link = p; while (p) { if (!p->callee->code) { /* callee never defined */ compile_error("function %s never defined", p->callee->name); /* delete p from list */ q->link = p->link; /* don't worry about freeing memory, we'll exit soon */ } /* note p->arg_list starts with last argument */ else if (!p->arg_list /* nothing to do */ || (!p->arg_cnt_checked && !arg_cnt_ok(p->callee, p->arg_list))) { q->link = p->link; /* delete p */ /* the ! arg_list case is not an error so free memory */ ZFREE(p); } else { /* keep p and set call_start */ q = p; switch (p->call_scope) { case SCOPE_MAIN: p->call_start = main_start; break; case SCOPE_BEGIN: p->call_start = begin_start; break; case SCOPE_END: p->call_start = end_start; break; case SCOPE_FUNCT: p->call_start = p->call->code; break; } } p = q->link; } return dummy.link; } /* continuously walk the resolve_list making type deductions until this list goes empty or no more progress can be made (An example where no more progress can be made is at end of file */ void resolve_fcalls(void) { register FCALL_REC *p, *old_list, *new_list; int progress; /* a flag */ TRACE(("resolve_fcalls\n")); old_list = first_pass(resolve_list); new_list = (FCALL_REC *) 0; progress = 0; while (1) { if (!old_list) { /* flop the lists */ old_list = new_list; if (!old_list /* nothing left */ || !progress /* can't do any more */ ) return; new_list = (FCALL_REC *) 0; progress = 0; } p = old_list; old_list = p->link; if ((p->arg_list = call_arg_check(p->callee, p->arg_list, p->call_start))) { /* still have work to do , put on new_list */ progress |= check_progress; p->link = new_list; new_list = p; } else { /* done with p */ progress = 1; ZFREE(p); } } } /* the parser has just reduced a function call ; the info needed to type check is passed in. If type checking can not be done yet (most common reason -- function referenced but not defined), a node is added to the resolve list. */ void check_fcall( FBLOCK * callee, int call_scope, int move_level, FBLOCK * call, CA_REC * arg_list) { FCALL_REC *p; TRACE(("check_fcall(%s)\n", callee->name)); if (!callee->code) { TRACE(("...forward reference\n")); /* forward reference to a function to be defined later */ p = ZMALLOC(FCALL_REC); p->callee = callee; p->call_scope = (short) call_scope; p->move_level = (short) move_level; p->call = call; p->arg_list = arg_list; p->arg_cnt_checked = 0; trace_arg_list(arg_list); /* add to resolve list */ p->link = resolve_list; resolve_list = p; } else if (arg_list && arg_cnt_ok(callee, arg_list)) { /* usually arg_list disappears here and all is well otherwise add to resolve list */ if ((arg_list = call_arg_check(callee, arg_list, code_base))) { p = ZMALLOC(FCALL_REC); p->callee = callee; p->call_scope = (short) call_scope; p->move_level = (short) move_level; p->call = call; p->arg_list = arg_list; p->arg_cnt_checked = 1; /* add to resolve list */ p->link = resolve_list; resolve_list = p; } } } /* code_pop() has just moved some code. If this code contains a function call, it might need to be relocated on the resolve list too. This function does it. delta == relocation distance */ void relocate_resolve_list( int scope, int move_level, FBLOCK * fbp, int orig_offset, unsigned len, int delta) { FCALL_REC *p = resolve_list; while (p) { if (scope == p->call_scope && move_level == p->move_level && (scope == SCOPE_FUNCT ? fbp == p->call : 1)) { relocate_arglist(p->arg_list, orig_offset, len, delta); } p = p->link; } } static void relocate_arglist( CA_REC * arg_list, int offset, unsigned len, int delta) { register CA_REC *p; if (!arg_list) return; p = arg_list; /* all nodes must be relocated or none, so test the first one */ /* Note: call_offset is always set even for args that don't need to be patched so that this check works. */ if (p->call_offset < offset || (unsigned) p->call_offset >= (unsigned) offset + len) return; /* relocate the whole list */ do { p->call_offset += delta; p = p->link; } while (p); } /* example where typing cannot progress { f(z) } function f(x) { print NR } # this is legal, does something useful, but absurdly written # We have to design so this works */ mawk-1.3.4-20200120/test/0000755000175100001440000000000013611312146013036 5ustar tomusersmawk-1.3.4-20200120/test/full-awk.dat0000644000175100001440000000024011061560657015257 0ustar tomusersThis has to be a small file to check if mawk handles write errors correctly even on a full disk. It has to be smaller than the write buffer of the C library. mawk-1.3.4-20200120/test/null-rs.out0000644000175100001440000000000311233077705015163 0ustar tomusers10 mawk-1.3.4-20200120/test/noloop.awk0000644000175100001440000000133411336752457015070 0ustar tomusers# From jhart@avcnet.bates.edu Sun Oct 6 16:05:21 2002 # Date: Sun, 6 Oct 2002 08:36:54 -0400 # Subject: Infinite loop in sub/gsub # From: jhart@avcnet.bates.edu # To: bug-gawk@gnu.org # Message-Id: <4BC4A4F0-D928-11D6-8E78-00039384A9CC@mail.avcnet.org> # # This command line: # # echo "''Italics with an apostrophe'' embedded''"|gawk -f test.awk # # where test.awk contains this instruction: # /''/ { sub(/''(.?[^']+)*''/, "&"); } # # puts gawk 3.11 into an infinite loop. Whereas, this command works: # # echo "''Italics with an apostrophe' embedded''"|gawk -f test.awk # # # # Platform: Mac OS X 10.1.5/Darwin Kernel Version 5.5: Thu May 30 14:51:26 # PDT 2002; root:xnu/xnu-201.42.3.obj~1/RELEASE_PPC # # mawk-1.3.4-20200120/test/mawknull.dat0000644000175100001440000000111711255541046015367 0ustar tomusers-r--r--r--1tomusers191993-07-0314:58fpetest1.awk -r--r--r--1tomusers911993-07-0314:58fpetest2.awk -r--r--r--1tomusers231993-07-0314:58fpetest3.awk -r--r--r--1tomusers1402009-07-2612:16null-rs.awk -r--r--r--1tomusers331993-07-0314:58reg0.awk -r--r--r--1tomusers411993-07-0314:58reg1.awk -r--r--r--1tomusers621993-07-0314:58reg2.awk -r--r--r--1tomusers4102009-09-1719:29reg4.awk -r--r--r--1tomusers7272009-09-1620:51reg5.awk -r--r--r--1tomusers331993-07-0314:58wc.awk -r--r--r--1tomusers16891993-07-0314:58wfrq0.awk mawk-1.3.4-20200120/test/fpetest3.awk0000644000175100001440000000076711500456220015306 0ustar tomusers# $MawkId: fpetest3.awk,v 1.2 2010/12/10 17:00:00 tom Exp $ # Test-script for MAWK ############################################################################### # copyright 1993, Michael D. Brennan # # This is a source file for mawk, an implementation of # the AWK programming language. # # Mawk is distributed without warranty under the terms of # the GNU General Public License, version 2, 1991. ############################################################################### BEGIN{ print log(-8) } mawk-1.3.4-20200120/test/wc.awk0000644000175100001440000000077311500456220014157 0ustar tomusers# $MawkId: wc.awk,v 1.2 2010/12/10 17:00:00 tom Exp $ # Test-script for MAWK ############################################################################### # copyright 1993, Michael D. Brennan # # This is a source file for mawk, an implementation of # the AWK programming language. # # Mawk is distributed without warranty under the terms of # the GNU General Public License, version 2, 1991. ############################################################################### {sum += NF} END{ print NR, sum} mawk-1.3.4-20200120/test/fpetest2.awk0000644000175100001440000000107311500456220015274 0ustar tomusers# $MawkId: fpetest2.awk,v 1.2 2010/12/10 17:00:00 tom Exp $ # Test-script for MAWK ############################################################################### # copyright 1993, Michael D. Brennan # # This is a source file for mawk, an implementation of # the AWK programming language. # # Mawk is distributed without warranty under the terms of # the GNU General Public License, version 2, 1991. ############################################################################### BEGIN { x = 100 do { y = x ; x *= 1000 } while ( y != x ) print "loop terminated" } mawk-1.3.4-20200120/test/mawktest0000755000175100001440000001365612403153256014641 0ustar tomusers#!/bin/sh # $MawkId: mawktest,v 1.36 2014/09/07 22:05:34 tom Exp $ ############################################################################### # copyright 2008-2012,2014, Thomas E. Dickey # copyright 2010, Guido Berhoerster # copyright 2010, Jonathan Nieder # copyright 2005, Aleksey Cheusov # copyright 1996, Michael D. Brennan # # This is a source file for mawk, an implementation of # the AWK programming language. # # Mawk is distributed without warranty under the terms of # the GNU General Public License, version 2, 1991. ############################################################################### # This is a simple test that a new made mawk seems to # be working OK. # It's certainly not exhaustive, but the last two tests in # particular use most features. # # It needs to be run from mawk/test # and mawk needs to be in mawk/test or in PATH # POSIX shells have functions... Fail() { echo "?? fail $*" FAIL=`expr $FAIL + 1` ERRS=`expr $ERRS + 1` } Begin() { echo echo "$*" OK=OK FAIL=0 } Finish() { if test $FAIL = 1 then echo "$* had one failure" elif test $FAIL != 0 then echo "$* had $FAIL failures" else echo "$* OK" fi } ERRS=0 Summary() { if test $ERRS = 1 then echo "$* had one failure" elif test $ERRS != 0 then echo "$* had $ERRS failures" else echo "$* OK" fi } PROG="${MAWK:-../mawk}" PATH=/bin:/usr/bin export PATH MAWKBINMODE=7 export MAWKBINMODE if test $# != 0 ; then SRC=$1 else SRC=.. fi dat=mawktest.dat nulldat=mawknull.dat STDOUT=${TMPDIR-/tmp}/mawk-out$$ STDERR=${TMPDIR-/tmp}/mawk-err$$ # The ulimit command interfers with valgrind (uncomment for ad hoc testing). #ulimit -v 25000 trap 'echo mawk_test failed ; rm -f $STDOUT $STDERR; exit 1' 0 # find out which mawk we're testing $PROG -W version NULLS=`$PROG -W version 2>&1 |fgrep regex |fgrep 'internal' 2>/dev/null` ################################# Begin "testing input and field splitting" LC_ALL=C $PROG -f wc.awk $dat | cmp -s - wc-awk.out || Fail "wc.awk" LC_ALL=C $PROG -f null-rs.awk null-rs.dat | cmp -s - null-rs.out || Fail "null-rs.awk" LC_ALL=C $PROG -F '(a?)*b' -f wc.awk $dat > $STDOUT LC_ALL=C $PROG -F 'a*b' -f wc.awk $dat | cmp -s - $STDOUT || Fail "case 2" LC_ALL=C $PROG -F '(a?)+b' -f wc.awk $dat > $STDOUT LC_ALL=C $PROG -F 'a*b' -f wc.awk $dat | cmp -s - $STDOUT || Fail "case 3" LC_ALL=C $PROG -F '[^^]' -f wc.awk $dat > $STDOUT LC_ALL=C $PROG -F '(.)' -f wc.awk $dat | cmp -s - $STDOUT || Fail "case 4" LC_ALL=C $PROG -F '[^]]' -f wc.awk $dat > $STDOUT LC_ALL=C $PROG -F '[[#a-zA-Z0-9/*!=<>+,;.&_%(){}" -]' -f wc.awk $dat | cmp -s - $STDOUT || Fail "case 5" LC_ALL=C $PROG -F '[a[]' -f wc.awk $dat > $STDOUT LC_ALL=C $PROG -F '[[a]' -f wc.awk $dat | cmp -s - $STDOUT || Fail "case 6" LC_ALL=C $PROG -F '(])' -f wc.awk $dat > $STDOUT LC_ALL=C $PROG -F '[]]' -f wc.awk $dat | cmp -s - $STDOUT || Fail "case 7" # check that the regexp [\ does not make mawk segfault LC_ALL=C $PROG -F '[\' 2> $STDERR || Fail "case 8" LC_ALL=C $PROG -F '(^)?)' -f wc.awk $dat > $STDOUT LC_ALL=C $PROG -F ')' -f wc.awk $dat | cmp -s - $STDOUT || Fail "case 9" echo baaab | LC_ALL=C $PROG -F 'a*+' '{print NF}' > $STDOUT echo baaab | LC_ALL=C $PROG -F 'a*' '{print NF}' | cmp -s - $STDOUT || Fail "case 10" if test -n "$NULLS" ; then LC_ALL=C $PROG -F '\000' -f nulls0.awk $nulldat > $STDOUT LC_ALL=C $PROG -F '[\000 ]' -f nulls0.awk $nulldat >> $STDOUT if ( cmp -s nulls.out $STDOUT ) then echo "... $PROG supports matches with NUL bytes" else echo "... $PROG does NOT supports matches with NUL bytes" fi fi Finish "input and field splitting" ##################################### Begin "testing regular expression matching" LC_ALL=C $PROG -f reg0.awk $dat > $STDOUT LC_ALL=C $PROG -f reg1.awk $dat >> $STDOUT LC_ALL=C $PROG -f reg2.awk $dat >> $STDOUT LC_ALL=C $PROG -f reg3.awk $dat >> $STDOUT LC_ALL=C $PROG -f reg4.awk $dat >> $STDOUT LC_ALL=C $PROG -f reg5.awk $dat >> $STDOUT LC_ALL=C $PROG -f reg6.awk $dat >> $STDOUT LC_ALL=C $PROG -f reg7.awk $dat >> $STDOUT cmp -s reg-awk.out $STDOUT || Fail "reg0-reg7 case" echo "''Italics with an apostrophe' embedded''" | LC_ALL=C $PROG -f noloop.awk || Fail "noloop2 test" echo "''Italics with an apostrophe'' embedded''" | LC_ALL=C $PROG -f noloop.awk || Fail "noloop1 test" LC_ALL=C $PROG '/^[^^]*$/' $dat > $STDOUT cmp -s $dat $STDOUT || Fail "case 1" LC_ALL=C $PROG '!/^[^]]*$/' $dat > $STDOUT LC_ALL=C $PROG '/]/' $dat | cmp -s - $STDOUT || Fail "case 2" LC_ALL=C $PROG '/[a[]/' $dat > $STDOUT LC_ALL=C $PROG '/[[a]/' $dat | cmp -s - $STDOUT || Fail "case 3" LC_ALL=C $PROG '/]/' $dat > $STDOUT LC_ALL=C $PROG '/[]]/' $dat | cmp -s - $STDOUT || Fail "case 4" echo aaa | LC_ALL=C $PROG '/a*+/' > $STDOUT echo aaa | LC_ALL=C $PROG '/a*/' | cmp -s - $STDOUT || Fail "case 5" echo aaa | cmp -s - $STDOUT || Fail "case 6" Finish "regular expression matching" ####################################### if [ -c /dev/full ]; then Begin "testing checking for write errors" # Check for write errors noticed when closing the file LC_ALL=C $PROG '{print}' /dev/full 2>/dev/null && Fail "case 1" # Check for write errors noticed on writing # The file has to be bigger than the buffer size of the libc LC_ALL=C $PROG '{print}' <$SRC/scan.c >/dev/full 2>/dev/null && Fail "case 2" Finish "checking for write errors" else echo echo "No /dev/full - check for write errors skipped" fi ####################################### Begin "testing arrays and flow of control" LC_ALL=C $PROG -f wfrq0.awk $dat | cmp -s - wfrq-awk.out || Fail Finish "array test" ####################################### Begin "testing nextfile" LC_ALL=C $PROG -f nextfile.awk full-awk.dat $dat | cmp -s - nextfile.out || Fail Finish "nextfile test" ################################# Begin "testing function calls and general stress test" LC_ALL=C $PROG -f $SRC/examples/decl.awk $dat | cmp -s - decl-awk.out || Fail Finish "general stress test" Summary "tested $PROG" trap 0 rm -f $STDOUT exit $ERRS mawk-1.3.4-20200120/test/reg5.awk0000644000175100001440000000217111500456220014402 0ustar tomusers# $MawkId: reg5.awk,v 1.3 2010/12/10 17:00:00 tom Exp $ # Test-script for MAWK ############################################################################### # copyright 2009, Thomas E. Dickey # # This is a source file for mawk, an implementation of # the AWK programming language. # # Mawk is distributed without warranty under the terms of # the GNU General Public License, version 2, 1991. ############################################################################### BEGIN { pat1="([[:upper:][:digit:]])+(_[[:upper:][:digit:]]+)+" pat2="0x[[:xdigit:]]+" } { if ($0 ~ /[^[:alnum:]]([[:upper:][:digit:]])+(_[[:upper:][:digit:]]+)+[^[:alnum:]]/) { match($0,pat1) printf "%d..%d:%s\n", RSTART, RLENGTH, $0 printf ("reg5.1<<%s>>\n",substr($0,RSTART,RLENGTH)) } if ($0 ~ pat1 ) { match($0,pat1) printf "%d..%d:%s\n", RSTART, RLENGTH, $0 printf ("reg5.2<<%s>>\n",substr($0,RSTART,RLENGTH)) } if ($0 ~ pat2 ) { match($0,pat2) printf "%d..%d:%s\n", RSTART, RLENGTH, $0 printf ("reg5.3<<%s>>\n",substr($0,RSTART,RLENGTH)) } # add patterns like those in reg4.awk which exercise [, ] at beginning } mawk-1.3.4-20200120/test/fpe_test.bat0000644000175100001440000000552311500456220015341 0ustar tomusersecho off rem $MawkId: fpe_test.bat,v 1.2 2010/12/10 17:00:00 tom Exp $ rem vile:rs=lf rem rem ########################################################################## rem copyright 1996, Michael D. Brennan rem rem This is a source file for mawk, an implementation of rem the AWK programming language. rem rem Mawk is distributed without warranty under the terms of rem the GNU General Public License, version 2, 1991. rem ########################################################################## rem rem tests if mawk has been compiled to correctly handle rem floating point exceptions echo testing division by zero type fpetest1.awk ..\mawk -f fpetest1.awk if errorlevel 128 goto :test1_128 if errorlevel 3 goto :test1_3 if errorlevel 2 goto :test1_2 if errorlevel 1 goto :test1_1 set ret1=0 goto :test2 :test1_128 set ret1=128 goto :test2 :test1_3 set ret1=3 goto :test2 :test1_2 set ret1=2 goto :test2 :test1_1 set ret1=1 :test2 echo testing overflow type fpetest2.awk ..\mawk -f fpetest2.awk if errorlevel 128 goto :test2_128 if errorlevel 3 goto :test2_3 if errorlevel 2 goto :test2_2 if errorlevel 1 goto :test2_1 set ret2=0 goto :test3 :test2_128 set ret2=128 goto :test3 :test2_3 set ret2=3 goto :test3 :test2_2 set ret2=2 goto :test3 :test2_1 set ret2=1 :test3 echo testing domain error type fpetest3.awk ..\mawk -f fpetest3.awk > temp$$ if errorlevel 128 goto :test3_128 if errorlevel 3 goto :test3_3 if errorlevel 2 goto :test3_2 if errorlevel 1 goto :test3_1 set ret3=0 goto :type3 :test3_128 set ret3=128 goto :type3 :test3_3 set ret3=3 goto :type3 :test3_2 set ret3=2 goto :type3 :test3_1 set ret3=1 :type3 type temp$$ rem the returns should all be zero or all 2 echo ************************************* echo return1 = %ret1% echo return2 = %ret2% echo return3 = %ret3% set exception=0 if %ret1% == 2 goto :okay1 if %ret1% == 0 goto :okay1 echo test1 failed set exception=1 :okay1 if %ret2% == 2 goto :okay2 if %ret2% == 0 goto :okay2 echo test2 failed set exception=1 :okay2 if %ret3% == 2 goto :okay3 if %ret3% == 0 goto :okay3 echo test3 failed set exception=1 :okay3 if %exception% == 1 goto :done set same=1 if %ret1% == %ret2% goto :same12 set same=0 :same12 if %ret2% == %ret3% goto :same23 set same=0 :same23 if %same% == 1 goto :same123 echo results are not consistent echo return values should all be 0 if ignoring FPEs (e.g. with IEEE754) echo or all 2 if trapping FPEs goto :cleanup :same123 if %ret1% == 0 goto :allzero echo results consistent: trapping floating exceptions goto :cleanup :allzero echo results consistent: ignoring floating exceptions grep -i nan temp$$ >NUL if not errorlevel 1 goto :cleanup echo but the library is not IEEE754 compatible echo test 3 failed :cleanup del temp$$ :done set ret1= set ret2= set ret3= set same= if %exception% == 1 goto :done1 set exception= exit 0 :done1 set exception= exit 1 exit %exception% mawk-1.3.4-20200120/test/reg4.awk0000644000175100001440000000150512763323033014410 0ustar tomusers# $MawkId: reg4.awk,v 1.9 2016/09/05 17:06:35 tom Exp $ # Test-script for MAWK ############################################################################### # copyright 2009,2016 Thomas E. Dickey # # This is a source file for mawk, an implementation of # the AWK programming language. # # Mawk is distributed without warranty under the terms of # the GNU General Public License, version 2, 1991. ############################################################################### { if ($0 ~/^[-+()0-9.,$%\/'"]*$/) { print ("reg4.1<<:",$0,">>") } if ($0 ~/^[]+()0-9.,$%\/'"-]*$/) { print ("reg4.2<<:",$0,">>") } if ($0 ~/^[^]+()0-9.,$%\/'"-]*$/) { print ("reg4.3<<:",$0,">>") } if ($0 ~/^[[+(){}0-9.,$%\/'"-]*$/) { print ("reg4.4<<:",$0,">>") } if ($0 ~/^[^[+(){}0-9.,$%\/'"-]*$/) { print ("reg4.5<<:",$0,">>") } } mawk-1.3.4-20200120/test/reg0.awk0000644000175100001440000000077511500456220014405 0ustar tomusers# $MawkId: reg0.awk,v 1.2 2010/12/10 17:00:00 tom Exp $ # Test-script for MAWK ############################################################################### # copyright 1993, Michael D. Brennan # # This is a source file for mawk, an implementation of # the AWK programming language. # # Mawk is distributed without warranty under the terms of # the GNU General Public License, version 2, 1991. ############################################################################### /return/ {cnt++} END{print cnt} mawk-1.3.4-20200120/test/reg1.awk0000644000175100001440000000100511500456220014371 0ustar tomusers# $MawkId: reg1.awk,v 1.2 2010/12/10 17:00:00 tom Exp $ # Test-script for MAWK ############################################################################### # copyright 1993, Michael D. Brennan # # This is a source file for mawk, an implementation of # the AWK programming language. # # Mawk is distributed without warranty under the terms of # the GNU General Public License, version 2, 1991. ############################################################################### /return|switch/ {cnt++} END{print cnt} mawk-1.3.4-20200120/test/wc-awk.out0000644000175100001440000000001005415353343014756 0ustar tomusers107 479 mawk-1.3.4-20200120/test/nextfile.out0000644000175100001440000000106511772610237015417 0ustar tomusersfull-awk.dat(1):This has to be a small file to check if mawk handles write errors correctly full-awk.dat(2):even on a full disk. It has to be smaller than the write buffer of the mawktest.dat(1): mawktest.dat(2):#include mawktest.dat(3): mawktest.dat(4):extern unsigned hash() ; mawktest.dat(5): mawktest.dat(6):/* An array A is a pointer to an array of struct array, mawktest.dat(7): which is two hash tables in one. One for strings mawktest.dat(8): and one for doubles. mawktest.dat(9): mawktest.dat(10): each array is of size A_HASH_PRIME. mawk-1.3.4-20200120/test/nextfile.awk0000644000175100001440000000103511772610151015362 0ustar tomusers# $MawkId: nextfile.awk,v 1.1 2012/06/27 13:53:45 tom Exp $ # Test-script for MAWK ############################################################################### # copyright 2012, Thomas E. Dickey # # This is a source file for mawk, an implementation of # the AWK programming language. # # Mawk is distributed without warranty under the terms of # the GNU General Public License, version 2, 1991. ############################################################################### {printf "%s(%d):", FILENAME, FNR; print $0; } /I/ {nextfile;} mawk-1.3.4-20200120/test/nulls.out0000644000175100001440000000126011255542516014733 0ustar tomusers 1: 8 - 1993-07-03 fpetest1.awk 2: 8 - 1993-07-03 fpetest2.awk 3: 8 - 1993-07-03 fpetest3.awk 4: 8 - 2009-07-26 null-rs.awk 5: 8 - 1993-07-03 reg0.awk 6: 8 - 1993-07-03 reg1.awk 7: 8 - 1993-07-03 reg2.awk 8: 8 - 2009-09-17 reg4.awk 9: 8 - 2009-09-16 reg5.awk 10: 8 - 1993-07-03 wc.awk 11: 8 - 1993-07-03 wfrq0.awk 1: 8 - 1993-07-03 fpetest1.awk 2: 8 - 1993-07-03 fpetest2.awk 3: 8 - 1993-07-03 fpetest3.awk 4: 8 - 2009-07-26 null-rs.awk 5: 8 - 1993-07-03 reg0.awk 6: 8 - 1993-07-03 reg1.awk 7: 8 - 1993-07-03 reg2.awk 8: 8 - 2009-09-17 reg4.awk 9: 8 - 2009-09-16 reg5.awk 10: 8 - 1993-07-03 wc.awk 11: 8 - 1993-07-03 wfrq0.awk mawk-1.3.4-20200120/test/mawktest.dat0000644000175100001440000000523305415353337015404 0ustar tomusers #include extern unsigned hash() ; /* An array A is a pointer to an array of struct array, which is two hash tables in one. One for strings and one for doubles. each array is of size A_HASH_PRIME. When an index is deleted via delete A[i], the ANODE is not removed from the hash chain. A[i].cp and A[i].sval are both freed and sval is set NULL. This method of deletion simplifies for( i in A ) loops. On the D_ANODE list, we use real deletion and move to the front on access. Separate nodes (as opposed to one type of node on two lists) to (1) d1 != d2, but sprintf(A_FMT,d1) == sprintf(A_FMT,d1) so two dnodes can point at the same anode. (2) Save a little data space(64K PC mentality). the cost is an extra level of indirection. Some care is needed so that things like A[1] = 2 ; delete A["1"] work . */ #define _dhash(d) (((int)(d)&0x7fff)%A_HASH_PRIME) #define DHASH(d) (last_dhash=_dhash(d)) static unsigned last_dhash ; /* switch =======;;;;;;hhhh */ static ANODE *find_by_sval(A, sval, cflag) ARRAY A ; STRING *sval ; int cflag ; /* create if on */ { char *s = sval->str ; unsigned h = hash(s) % A_HASH_PRIME ; register ANODE *p = A[h].link ; ANODE *q = 0 ; /* holds first deleted ANODE */ while ( p ) { if ( p->sval ) { if ( strcmp(s,p->sval->str) == 0 ) return p ; } else /* its deleted, mark with q */ if ( ! q ) q = p ; p = p->link ; } /* not there */ if ( cflag ) { if ( q ) p = q ; /* reuse the deleted node q */ else { p = (ANODE *)zmalloc(sizeof(ANODE)) ; p->link = A[h].link ; A[h].link = p ; } p->sval = sval ; sval->ref_cnt++ ; p->cp = (CELL *) zmalloc(sizeof(CELL)) ; p->cp->type = C_NOINIT ; } return p ; } /* on the D_ANODE list, when we find a node we move it to the front of the hash chain */ static D_ANODE *find_by_dval(A, d, cflag) ARRAY A ; double d ; int cflag ; { unsigned h = DHASH(d) ; register D_ANODE *p = A[h].dlink ; D_ANODE *q = 0 ; /* trails p for move to front */ ANODE *ap ; while ( p ) if ( p->dval == d ) { /* found */ if ( ! p->ap->sval ) /* but it was deleted by string */ { if ( q ) q->dlink = p->dlink ; else A[h].dlink = p->dlink ; zfree(p, sizeof(D_ANODE)) ; break ; } /* found */ if ( !q ) return p ; /* already at front */ else /* delete to put at front */ { q->dlink = p->dlink ; goto found ; } } else { q = p ; p = p->dlink ; } void (*signal())() ; mawk-1.3.4-20200120/test/reg6.awk0000644000175100001440000000137311500456220014406 0ustar tomusers# $MawkId: reg6.awk,v 1.3 2010/12/10 17:00:00 tom Exp $ # Test-script for MAWK ############################################################################### # copyright 2010, Jonathan Nieder # # This is a source file for mawk, an implementation of # the AWK programming language. # # Mawk is distributed without warranty under the terms of # the GNU General Public License, version 2, 1991. ############################################################################### BEGIN { patterns = "(a?)+bles /(^)+e/a(a?)*b/(a?)+*bles\\." n = split(patterns, pattern, "/") } { for (i = 1; i <= n; i++) { if ($0 ~ pattern[i]) { match($0, pattern[i]) printf "%d..%d:%s\n", RSTART, RLENGTH, $0 printf "reg6.%d<<%s>>\n", i, substr($0,RSTART,RLENGTH) } } } mawk-1.3.4-20200120/test/nulls0.awk0000644000175100001440000000101611500456220014752 0ustar tomusers# $MawkId: nulls0.awk,v 1.2 2010/12/10 17:00:00 tom Exp $ # Test-script for MAWK ############################################################################### # copyright 2009, Thomas E. Dickey # # This is a source file for mawk, an implementation of # the AWK programming language. # # Mawk is distributed without warranty under the terms of # the GNU General Public License, version 2, 1991. ############################################################################### { printf "%3d: %2d - %s %s\n", NR, NF, $6, $8; } mawk-1.3.4-20200120/test/null-rs.dat0000644000175100001440000000002511233077547015134 0ustar tomusers12345678910mawk-1.3.4-20200120/test/reg7.awk0000644000175100001440000000263212375177117014426 0ustar tomusers# $MawkId: reg7.awk,v 1.1 2014/08/20 20:00:15 tom Exp $ # Test-script for MAWK ############################################################################### # copyright 2014, Thomas E. Dickey # # This is a source file for mawk, an implementation of # the AWK programming language. # # Mawk is distributed without warranty under the terms of # the GNU General Public License, version 2, 1991. ############################################################################### BEGIN { str = "abc"; print gsub("b+", "FOO", str), str str = "abc"; print gsub("x*", "X", str), str str = "abc"; print gsub("b*", "X", str), str str = "abc"; print gsub("c", "X", str), str str = "abc"; print gsub("c+", "X", str), str str = "abc"; print gsub("x*$", "X", str), str str = "abc"; print gsub("b|$", "X", str), str str = "abc"; print gsub("b+", "FOO", str), str str = "abc"; print gsub("x*", "X", str), str str = "abc"; print gsub("b*", "X", str), str str = "abc"; print gsub("c", "X", str), str str = "abc"; print gsub("c+", "X", str), str str = "abc"; print gsub("x*$", "X", str), str str = "abc"; print gsub("b+", "(&)", str), str str = "abc"; print gsub("x*", "{&}", str), str str = "abc"; print gsub("b*", "{&}", str), str str = "abbcb"; print gsub("b*", "{&}", str), str str = "abbcb"; print gsub("b+", "(&)", str), str str = "a b c"; print gsub(/^[ ]*/, "", str), str str = " a b c"; print gsub(/^[ ]*/, "", str), str } mawk-1.3.4-20200120/test/reg-awk.out0000644000175100001440000001102212375177400015130 0ustar tomusers3 4 1 0 -1 reg4.1<<: >> reg4.2<<: >> reg4.3<<: >> reg4.4<<: >> reg4.5<<: >> reg4.1<<: >> reg4.2<<: >> reg4.3<<: >> reg4.4<<: >> reg4.5<<: >> reg4.1<<: >> reg4.2<<: >> reg4.3<<: >> reg4.4<<: >> reg4.5<<: >> reg4.1<<: >> reg4.2<<: >> reg4.3<<: >> reg4.4<<: >> reg4.5<<: >> reg4.1<<: >> reg4.2<<: >> reg4.3<<: >> reg4.4<<: >> reg4.5<<: >> reg4.1<<: >> reg4.2<<: >> reg4.3<<: >> reg4.4<<: >> reg4.5<<: >> reg4.1<<: >> reg4.2<<: >> reg4.3<<: >> reg4.4<<: >> reg4.5<<: >> reg4.3<<: to >> reg4.5<<: to >> reg4.1<<: >> reg4.2<<: >> reg4.3<<: >> reg4.4<<: >> reg4.5<<: >> reg4.1<<: >> reg4.2<<: >> reg4.3<<: >> reg4.4<<: >> reg4.5<<: >> reg4.3<<: Some care is needed so that things like >> reg4.5<<: Some care is needed so that things like >> reg4.1<<: >> reg4.2<<: >> reg4.3<<: >> reg4.4<<: >> reg4.5<<: >> reg4.3<<: static unsigned last_dhash ; >> reg4.5<<: static unsigned last_dhash ; >> reg4.1<<: >> reg4.2<<: >> reg4.3<<: >> reg4.4<<: >> reg4.5<<: >> reg4.1<<: >> reg4.2<<: >> reg4.3<<: >> reg4.4<<: >> reg4.5<<: >> reg4.3<<: ARRAY A ; >> reg4.5<<: ARRAY A ; >> reg4.3<<: STRING *sval ; >> reg4.5<<: STRING *sval ; >> reg4.3<<: { >> reg4.1<<: >> reg4.2<<: >> reg4.3<<: >> reg4.4<<: >> reg4.5<<: >> reg4.3<<: { >> reg4.1<<: >> reg4.2<<: >> reg4.3<<: >> reg4.4<<: >> reg4.5<<: >> reg4.3<<: } >> reg4.1<<: >> reg4.2<<: >> reg4.3<<: >> reg4.4<<: >> reg4.5<<: >> reg4.3<<: { >> reg4.3<<: else >> reg4.5<<: else >> reg4.3<<: } >> reg4.1<<: >> reg4.2<<: >> reg4.3<<: >> reg4.4<<: >> reg4.5<<: >> reg4.3<<: } >> reg4.3<<: return p ; >> reg4.5<<: return p ; >> reg4.3<<: } >> reg4.4<<: } >> reg4.1<<: >> reg4.2<<: >> reg4.3<<: >> reg4.4<<: >> reg4.5<<: >> reg4.1<<: >> reg4.2<<: >> reg4.3<<: >> reg4.4<<: >> reg4.5<<: >> reg4.1<<: >> reg4.2<<: >> reg4.3<<: >> reg4.4<<: >> reg4.5<<: >> reg4.3<<: ARRAY A ; >> reg4.5<<: ARRAY A ; >> reg4.3<<: double d ; >> reg4.5<<: double d ; >> reg4.3<<: int cflag ; >> reg4.5<<: int cflag ; >> reg4.3<<: { >> reg4.4<<: { >> reg4.3<<: ANODE *ap ; >> reg4.5<<: ANODE *ap ; >> reg4.1<<: >> reg4.2<<: >> reg4.3<<: >> reg4.4<<: >> reg4.5<<: >> reg4.3<<: break ; >> reg4.5<<: break ; >> reg4.3<<: } >> reg4.3<<: } >> reg4.3<<: else >> reg4.5<<: else >> reg4.1<<: >> reg4.2<<: >> reg4.3<<: >> reg4.4<<: >> reg4.5<<: >> reg4.1<<: >> reg4.2<<: >> reg4.3<<: >> reg4.4<<: >> reg4.5<<: >> 26..12: each array is of size A_HASH_PRIME. reg5.1<> 26..12: each array is of size A_HASH_PRIME. reg5.2<> 11..7: On the D_ANODE list, we use real deletion and move to the reg5.1<> 11..7: On the D_ANODE list, we use real deletion and move to the reg5.2<> 32..5: (1) d1 != d2, but sprintf(A_FMT,d1) == sprintf(A_FMT,d1) reg5.1<> 32..5: (1) d1 != d2, but sprintf(A_FMT,d1) == sprintf(A_FMT,d1) reg5.2<> 42..12:#define _dhash(d) (((int)(d)&0x7fff)%A_HASH_PRIME) reg5.1<> 42..12:#define _dhash(d) (((int)(d)&0x7fff)%A_HASH_PRIME) reg5.2<> 34..6:#define _dhash(d) (((int)(d)&0x7fff)%A_HASH_PRIME) reg5.3<<0x7fff>> 27..12: unsigned h = hash(s) % A_HASH_PRIME ; reg5.1<> 27..12: unsigned h = hash(s) % A_HASH_PRIME ; reg5.2<> 22..8: p->cp->type = C_NOINIT ; reg5.1<> 22..8: p->cp->type = C_NOINIT ; reg5.2<> 11..7:/* on the D_ANODE list, when we find a node we move it reg5.1<> 11..7:/* on the D_ANODE list, when we find a node we move it reg5.2<> 8..7:static D_ANODE *find_by_dval(A, d, cflag) reg5.1<> 8..7:static D_ANODE *find_by_dval(A, d, cflag) reg5.2<> 12..7: register D_ANODE *p = A[h].dlink ; reg5.1<> 12..7: register D_ANODE *p = A[h].dlink ; reg5.2<> 3..7: D_ANODE *q = 0 ; /* trails p for move to front */ reg5.1<> 3..7: D_ANODE *q = 0 ; /* trails p for move to front */ reg5.2<> 28..7: zfree(p, sizeof(D_ANODE)) ; reg5.1<> 28..7: zfree(p, sizeof(D_ANODE)) ; reg5.2<> 1..1:extern unsigned hash() ; reg6.2<> 23..6: which is two hash tables in one. One for strings reg6.1<> 23..2: which is two hash tables in one. One for strings reg6.3<> 19..5: and one for doubles. reg6.4<> 1 aFOOc 4 XaXbXcX 3 XaXcX 1 abX 1 abX 1 abcX 2 aXcX 1 aFOOc 4 XaXbXcX 3 XaXcX 1 abX 1 abX 1 abcX 1 a(b)c 4 {}a{}b{}c{} 3 {}a{b}c{} 3 {}a{bb}c{b} 2 a(bb)c(b) 1 a b c 1 a b c mawk-1.3.4-20200120/test/null-rs.awk0000644000175100001440000000115111500456220015131 0ustar tomusers# $MawkId: null-rs.awk,v 1.3 2010/12/10 17:00:00 tom Exp $ # Test-script for MAWK ############################################################################### # copyright 2009, Thomas E. Dickey # # This is a source file for mawk, an implementation of # the AWK programming language. # # Mawk is distributed without warranty under the terms of # the GNU General Public License, version 2, 1991. ############################################################################### # the test-data was generated on Linux using bash: #for ((i = 1; i <= 10; ++i)) ;do echo -ne "$i\0"; done BEGIN {RS = "\0"}; END {print NR} mawk-1.3.4-20200120/test/reg3.awk0000644000175100001440000000104611500456220014400 0ustar tomusers# $MawkId: reg3.awk,v 1.2 2010/12/10 17:00:00 tom Exp $ # Test-script for MAWK ############################################################################### # copyright 2010, Thomas E. Dickey # # This is a source file for mawk, an implementation of # the AWK programming language. # # Mawk is distributed without warranty under the terms of # the GNU General Public License, version 2, 1991. ############################################################################### BEGIN { test = "MFG" match(test, "[^0-9A-Za-z]") print RSTART, RLENGTH } mawk-1.3.4-20200120/test/fpe_test0000755000175100001440000000524411500456220014577 0ustar tomusers#!/bin/sh # $MawkId: fpe_test,v 1.7 2010/12/10 17:00:00 tom Exp $ ############################################################################### # copyright 2009,2010, Thomas E. Dickey # copyright 2010, Guido Berhoerster # copyright 1994,1995, Michael D. Brennan # # This is a source file for mawk, an implementation of # the AWK programming language. # # Mawk is distributed without warranty under the terms of # the GNU General Public License, version 2, 1991. ############################################################################### # tests if mawk has been compiled to correctly handle # floating point exceptions # # @Log: fpe_test,v @ # Revision 1.3 1995/08/29 14:17:18 mike # exit 2 changes # # Revision 1.2 1994/12/18 18:51:55 mike # recognize NAN printed as ? for hpux # PROG="${MAWK:-../mawk}" PATH=/bin:/usr/bin export PATH echo "testing floating point exception handling" STDOUT=${TMPDIR-/tmp}/mawktest$$ test1='BEGIN{ print 4/0 }' test2='BEGIN { x = 100 do { y = x ; x *= 1000 } while ( y != x ) print "loop terminated" }' # this used to test log(-8), but that was too challenging for cygwin hackers test3='BEGIN{ print sqrt(-8) }' echo "testing division by zero" echo $PROG "$test1" $PROG "$test1" ret1=$? echo echo "testing overflow" echo $PROG "$test2" $PROG "$test2" ret2=$? echo echo "testing domain error" echo $PROG "$test3" $PROG "$test3" > $STDOUT ret3=$? cat $STDOUT echo # the returns should all be zero or all 2 # core dumps not allowed trap ' echo compilation defines for floating point are incorrect rm -f $STDOUT exit 1' 0 echo echo ============================== echo return1 = $ret1 echo return2 = $ret2 echo return3 = $ret3 [ $ret1 -gt 128 ] && { echo test1 failed ; exception=1 ; } [ $ret2 -gt 128 ] && { echo test2 failed ; exception=1 ; } [ $ret3 -gt 128 ] && { echo test3 failed ; exception=1 ; } [ "$exception" = 1 ] && { rm -f *core* $STDOUT ; exit 1 ; } same=0 [ $ret1 = $ret2 ] && [ $ret2 = $ret3 ] && same=1 if [ $same = 1 ] then if [ $ret1 = 0 ] then echo "results consistent: ignoring floating exceptions" # some versions of hpux print NAN as ? if egrep '[nN][aA][nN]|\?' $STDOUT > /dev/null then : # MSYS / MinGW uses a different string... elif fgrep '#IND' $STDOUT > /dev/null then echo "found MinGW hack for NaN..." else echo "but the library is not IEEE754 compatible" echo "test 3 failed" exit 1 fi else echo "results consistent: trapping floating exceptions" fi trap 0 rm -f $STDOUT exit 0 else cat <<-EOF results are not consistent return values should all be 0 if ignoring FPEs (e.g. with IEEE754) or all 2 if trapping FPEs EOF exit 1 fi mawk-1.3.4-20200120/test/decl-awk.out0000644000175100001440000000034605415353342015267 0ustar tomusershash: function returning unsigned (extern) last_dhash: unsigned (static) A: ARRAY sval: pointer to STRING cflag: int A: ARRAY d: double cflag: int ap: pointer to ANODE signal: function returning pointer to function returning void mawk-1.3.4-20200120/test/wfrq0.awk0000644000175100001440000000417213611312146014605 0ustar tomusers# $MawkId: wfrq0.awk,v 1.3 2020/01/20 11:52:06 tom Exp $ # Test-script for MAWK ############################################################################### # copyright 1993, Michael D. Brennan # # This is a source file for mawk, an implementation of # the AWK programming language. # # Mawk is distributed without warranty under the terms of # the GNU General Public License, version 2, 1991. ############################################################################### # this program finds the twenty most frequent # words in document using a heap sort at the end # # function down_heap(i, k,hold) { while ( 1 ) { if ( compare(heap[2*i], heap[2*i+1]) <= 0 ) k = 2*i else k = 2*i + 1 if ( compare(heap[i],heap[k]) <= 0 ) return hold = heap[k] ; heap[k] = heap[i] ; heap[i] = hold i = k } } # compares two values of form "number word" # by number and breaks ties by word (reversed) function compare(s1, s2, t, X) { t = (s1+0) - (s2+0) # forces types to number if ( t == 0 ) { split(s1, X); s1 = X[2] split(s2, X); s2 = X[2] if ( s2 < s1 ) return -1 return s1 < s2 } return t } BEGIN { RS = "[^a-zA-Z]+" ; BIG = "999999:" } { cnt[$0]++ } END { delete cnt[ "" ] # load twenty values j = 1 for( i in cnt ) { heap[j] = num_word( cnt[i] , i ) delete cnt[i] ; if ( ++j == 21 ) break ; } # make some sentinels for( i = j ; i < 43 ; i++ ) heap[i] = BIG h_empty = j # save the first empty slot # make a heap with the smallest in slot 1 for( i = h_empty - 1 ; i > 0 ; i-- ) down_heap(i) # examine the rest of the values for ( i in cnt ) { j = num_word(cnt[i], i) if ( compare(j, heap[1]) > 0 ) { # its bigger # take the smallest out of the heap and readjust heap[1] = j down_heap(1) } } h_empty-- ; # what's left are the twenty largest # smallest at the top # i = 20 while ( h_empty > 1 ) { buffer[i--] = heap[1] heap[1] = heap[h_empty] heap[h_empty] = BIG down_heap(1) h_empty-- } buffer[i--] = heap[1] for(j = 1 ; j <= 20 ; j++ ) print buffer[j] } function num_word(num, word) { return sprintf("%3d %s", num, word) } mawk-1.3.4-20200120/test/fpetest1.awk0000644000175100001440000000076311500456220015300 0ustar tomusers# $MawkId: fpetest1.awk,v 1.2 2010/12/10 17:00:00 tom Exp $ # Test-script for MAWK ############################################################################### # copyright 1993, Michael D. Brennan # # This is a source file for mawk, an implementation of # the AWK programming language. # # Mawk is distributed without warranty under the terms of # the GNU General Public License, version 2, 1991. ############################################################################### BEGIN{ print 4/0 } mawk-1.3.4-20200120/test/mawktest.bat0000644000175100001440000001004712375177214015402 0ustar tomusers@echo off rem $MawkId: mawktest.bat,v 1.12 2014/08/20 20:01:16 tom Exp $ rem vile:rs=lf rem rem ########################################################################## rem copyright 2010-2012,2014 Thomas E. Dickey rem copyright 1996, Michael D. Brennan rem rem This is a source file for mawk, an implementation of rem the AWK programming language. rem rem Mawk is distributed without warranty under the terms of rem the GNU General Public License, version 2, 1991. rem ########################################################################## rem rem This is a simple test that a new-made mawk seems to rem be working OK. rem It's certainly not exhaustive, but the last two tests in rem particular use most features. rem rem It needs to be run from mawk/test. rem You also need a binary-compare utility, e.g., "cmp". setlocal set dat=mawktest.dat if %CMP%.==. set CMP=cmp set PROG=..\mawk set MAWKBINMODE=7 set STDOUT=temp$$ rem find out which mawk we're testing %PROG% -Wv rem ################################ call :begin testing input and field splitting %PROG% -f null-rs.awk null-rs.dat > %STDOUT% call :compare "null-rs.awk" %STDOUT% null-rs.out %PROG% -f wc.awk %dat% > %STDOUT% call :compare "wc.awk" %STDOUT% wc-awk.out call :cmpsp2 "(a?)*b" "a*b" call :cmpsp2 "(a?)+b" "a*b" call :cmpsp2 "[^^]" "(.)" rem call :cmpsp2 "[^]]" "[[#a-zA-Z0-9/*!=<>+,;.&_%(){}" -]" call :cmpsp2 "[a[]" "[[a]" rem call :cmpsp2 "(])" "[]]" call :chkone "[\" rem call :cmpsp2 "(^)?)" ")" call :cmpsp3 "a*+" "a*" %PROG% -F "\000" -f nulls0.awk mawknull.dat > %STDOUT% %PROG% -F "[\000 ]" -f nulls0.awk mawknull.dat >> %STDOUT% call :compare "nulls" %STDOUT% nulls.out rem #################################### call :begin testing regular expression matching %PROG% -f reg0.awk %dat% > %STDOUT% %PROG% -f reg1.awk %dat% >> %STDOUT% %PROG% -f reg2.awk %dat% >> %STDOUT% %PROG% -f reg3.awk %dat% >> %STDOUT% %PROG% -f reg4.awk %dat% >> %STDOUT% %PROG% -f reg5.awk %dat% >> %STDOUT% %PROG% -f reg6.awk %dat% >> %STDOUT% %PROG% -f reg7.awk %dat% >> %STDOUT% call :compare "reg0-reg7" %STDOUT% reg-awk.out echo ''Italics with an apostrophe' embedded'' | %PROG% -f noloop.awk echo ''Italics with an apostrophe'' embedded'' | %PROG% -f noloop.awk %PROG% "/^[^^]*$/" %dat% > %STDOUT% call :compare "case 1" %STDOUT% %dat% rem call :cmpsp0 "!/^[^]]*$/" "/]/" rem call :cmpsp0 "/[a[]/" "/[[a]/" rem call :cmpsp0 "/]/" "/[]]/" rem ###################################### call :begin testing arrays and flow of control %PROG% -f wfrq0.awk %dat% > %STDOUT% call :compare "array-test" %STDOUT% wfrq-awk.out rem ###################################### call :begin testing nextfile %PROG% -f nextfile.awk full-awk.dat %dat% > %STDOUT% call :compare "nextfile-test" %STDOUT% nextfile.out rem ################################ call :begin testing function calls and general stress test %PROG% -f ../examples/decl.awk %dat% > %STDOUT% call :compare "general" %STDOUT% decl-awk.out echo. echo if %CMP% always encountered "no differences", then the tested mawk seems OK del %STDOUT% endlocal goto :eof :cmpsp0 echo ...checking %1 vs %2 %PROG% -F "%1" %dat% > %STDOUT% %PROG% -F "%2" %dat% | cmp -s - %STDOUT% if errorlevel 1 goto :errsp0 echo ...ok goto :eof :errsp0 echo ...fail goto :eof :chkone echo ...checking %1 %PROG% -F "%1" 2> %STDOUT% if errorlevel 1 goto :errsp1 echo ...ok goto :eof :errsp1 echo ...fail goto :eof :cmpsp2 echo ...checking %1 vs %2 %PROG% -F "%1" -f wc.awk %dat% > %STDOUT% %PROG% -F "%2" -f wc.awk %dat% | cmp -s - %STDOUT% if errorlevel 1 goto :errsp2 echo ...ok goto :eof :errsp2 echo ...fail goto :eof :cmpsp3 echo ...checking %1 vs %2 %PROG% -F "%1" "{print NF}" > %STDOUT% %PROG% -F "%2" "{print NF}" | cmp -s - %STDOUT% if errorlevel 1 goto :errsp3 echo ...ok goto :eof :errsp3 echo ...fail goto :eof :begin echo. echo %* goto :eof :compare set TESTNAME=%1 echo ...checking %2 %3 %CMP% %2 %3 if errorlevel 1 goto :failed echo ...ok goto :eof :failed echo ...fail goto :eof mawk-1.3.4-20200120/test/reg2.awk0000644000175100001440000000103211500456220014372 0ustar tomusers# $MawkId: reg2.awk,v 1.2 2010/12/10 17:00:00 tom Exp $ # Test-script for MAWK ############################################################################### # copyright 1993, Michael D. Brennan # # This is a source file for mawk, an implementation of # the AWK programming language. # # Mawk is distributed without warranty under the terms of # the GNU General Public License, version 2, 1991. ############################################################################### /[A-Za-z_][A-Za-z0-9_]*\[.*\][ \t]*=/ {cnt++} END{print cnt} mawk-1.3.4-20200120/test/wfrq-awk.out0000644000175100001440000000024005415353344015332 0ustar tomusers 29 p 21 A 14 ANODE 13 q 12 d 12 sval 10 if 10 the 8 dlink 8 h 8 is 7 to 6 D 6 of 5 cflag 5 deleted 5 else 5 front 5 hash 5 link mawk-1.3.4-20200120/parse.y0000644000175100001440000011252013611311742013365 0ustar tomusers/******************************************** parse.y copyright 2008-2016,2020, Thomas E. Dickey copyright 1991-1994,1995, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: parse.y,v 1.23 2020/01/20 11:49:54 tom Exp $ */ %{ #include #include "mawk.h" #include "symtype.h" #include "code.h" #include "memory.h" #include "bi_funct.h" #include "bi_vars.h" #include "jmp.h" #include "field.h" #include "files.h" #define YYMAXDEPTH 200 extern void eat_nl(void); static SYMTAB *save_arglist(const char *); static int init_arglist(void); static void RE_as_arg(void); static void check_array(SYMTAB *); static void check_var(SYMTAB *); static void code_array(SYMTAB *); static void code_call_id(CA_REC *, SYMTAB *); static void field_A2I(void); static void free_arglist(void); static void improve_arglist(const char *); static void resize_fblock(FBLOCK *); static void switch_code_to_main(void); static int scope; static FBLOCK *active_funct; static CA_REC *active_arglist; /* when scope is SCOPE_FUNCT */ #define code_address(x) if( is_local(x) ) \ code2op(L_PUSHA, (x)->offset) ;\ else code2(_PUSHA, (x)->stval.cp) #define CDP(x) (code_base+(x)) /* WARNING: These CDP() calculations become invalid after calls that might change code_base. Which are: code2(), code2op(), code_jmp() and code_pop(). */ /* this nonsense caters to MSDOS large model */ #define CODE_FE_PUSHA() code_ptr->ptr = (PTR) 0 ; code1(FE_PUSHA) %} %union{ CELL *cp ; SYMTAB *stp ; int start ; /* code starting address as offset from code_base */ PF_CP fp ; /* ptr to a (print/printf) or (sub/gsub) function */ const BI_REC *bip ; /* ptr to info about a builtin */ FBLOCK *fbp ; /* ptr to a function block */ ARG2_REC *arg2p ; CA_REC *ca_p ; int ival ; PTR ptr ; } /* two tokens to help with errors */ %token UNEXPECTED /* unexpected character */ %token BAD_DECIMAL %token NL %token SEMI_COLON %token LBRACE RBRACE %token LBOX RBOX %token COMMA %token IO_OUT /* > or output pipe */ %right ASSIGN ADD_ASG SUB_ASG MUL_ASG DIV_ASG MOD_ASG POW_ASG %right QMARK COLON %left OR %left AND %left IN %left MATCH /* ~ or !~ */ %left EQ NEQ LT LTE GT GTE %left CAT %left GETLINE %left PLUS MINUS %left MUL DIV MOD %left NOT UMINUS %nonassoc IO_IN PIPE %right POW %left INC_or_DEC %left DOLLAR FIELD /* last to remove a SR conflict with getline */ %right LPAREN RPAREN /* removes some SR conflicts */ %token DOUBLE STRING_ RE %token ID D_ID %token FUNCT_ID %token BUILTIN LENGTH %token FIELD %token PRINT PRINTF SPLIT MATCH_FUNC SUB GSUB /* keywords */ %token DO WHILE FOR BREAK CONTINUE IF ELSE IN %token DELETE BEGIN END EXIT NEXT NEXTFILE RETURN FUNCTION %type block block_or_separator %type statement_list statement mark %type pr_args %type arg2 %type builtin %type getline_file %type lvalue field fvalue %type expr cat_expr p_expr %type while_front if_front %type for1 for2 %type array_loop_front %type return_statement %type split_front re_arg sub_back %type arglist args %type print sub_or_gsub %type funct_start funct_head %type call_args ca_front ca_back %type f_arglist f_args %% /* productions */ program : program_block | program program_block ; program_block : PA_block /* pattern-action */ | function_def | outside_error block ; PA_block : block { /* this do nothing action removes a vacuous warning from Bison */ } | BEGIN { be_setup(scope = SCOPE_BEGIN) ; } block { switch_code_to_main() ; } | END { be_setup(scope = SCOPE_END) ; } block { switch_code_to_main() ; } | expr /* this works just like an if statement */ { code_jmp(_JZ, (INST*)0) ; } block_or_separator { patch_jmp( code_ptr ) ; } /* range pattern, see comment in execute.c near _RANGE */ | expr COMMA { INST *p1 = CDP($1) ; int len ; code_push(p1, (unsigned) CodeOffset(p1), scope, active_funct) ; code_ptr = p1 ; code2op(_RANGE, 1) ; code_ptr += 3 ; len = (int) code_pop(code_ptr) ; code_ptr += len ; code1(_STOP) ; p1 = CDP($1) ; p1[2].op = CodeOffset(p1 + 1) ; } expr { code1(_STOP) ; } block_or_separator { INST *p1 = CDP($1) ; p1[3].op = (int) (CDP($6) - (p1 + 1)) ; p1[4].op = CodeOffset(p1 + 1) ; } ; block : LBRACE statement_list RBRACE { $$ = $2 ; } | LBRACE error RBRACE { $$ = code_offset ; /* does nothing won't be executed */ print_flag = getline_flag = paren_cnt = 0 ; yyerrok ; } ; block_or_separator : block | separator /* default print action */ { $$ = code_offset ; code1(_PUSHINT) ; code1(0) ; code2(_PRINT, bi_print) ; } ; statement_list : statement | statement_list statement ; statement : block | expr separator { code1(_POP) ; } | /* empty */ separator { $$ = code_offset ; } | error separator { $$ = code_offset ; print_flag = getline_flag = 0 ; paren_cnt = 0 ; yyerrok ; } | BREAK separator { $$ = code_offset ; BC_insert('B', code_ptr+1) ; code2(_JMP, 0) /* don't use code_jmp ! */ ; } | CONTINUE separator { $$ = code_offset ; BC_insert('C', code_ptr+1) ; code2(_JMP, 0) ; } | return_statement { if ( scope != SCOPE_FUNCT ) compile_error("return outside function body") ; } | NEXT separator { if ( scope != SCOPE_MAIN ) compile_error( "improper use of next" ) ; $$ = code_offset ; code1(_NEXT) ; } | NEXTFILE separator { if ( scope != SCOPE_MAIN ) compile_error( "improper use of nextfile" ) ; $$ = code_offset ; code1(_NEXTFILE) ; } ; separator : NL | SEMI_COLON ; expr : cat_expr | lvalue ASSIGN expr { code1(_ASSIGN) ; } | lvalue ADD_ASG expr { code1(_ADD_ASG) ; } | lvalue SUB_ASG expr { code1(_SUB_ASG) ; } | lvalue MUL_ASG expr { code1(_MUL_ASG) ; } | lvalue DIV_ASG expr { code1(_DIV_ASG) ; } | lvalue MOD_ASG expr { code1(_MOD_ASG) ; } | lvalue POW_ASG expr { code1(_POW_ASG) ; } | expr EQ expr { code1(_EQ) ; } | expr NEQ expr { code1(_NEQ) ; } | expr LT expr { code1(_LT) ; } | expr LTE expr { code1(_LTE) ; } | expr GT expr { code1(_GT) ; } | expr GTE expr { code1(_GTE) ; } | expr MATCH expr { INST *p3 = CDP($3) ; if ( p3 == code_ptr - 2 ) { if ( p3->op == _MATCH0 ) p3->op = _MATCH1 ; else /* check for string */ if ( p3->op == _PUSHS ) { CELL *cp = ZMALLOC(CELL) ; cp->type = C_STRING ; cp->ptr = p3[1].ptr ; cast_to_RE(cp) ; no_leaks_re_ptr(cp->ptr) ; code_ptr -= 2 ; code2(_MATCH1, cp->ptr) ; ZFREE(cp) ; } else code1(_MATCH2) ; } else code1(_MATCH2) ; if ( !$2 ) code1(_NOT) ; } /* short circuit boolean evaluation */ | expr OR { code1(_TEST) ; code_jmp(_LJNZ, (INST*)0) ; } expr { code1(_TEST) ; patch_jmp(code_ptr) ; } | expr AND { code1(_TEST) ; code_jmp(_LJZ, (INST*)0) ; } expr { code1(_TEST) ; patch_jmp(code_ptr) ; } | expr QMARK { code_jmp(_JZ, (INST*)0) ; } expr COLON { code_jmp(_JMP, (INST*)0) ; } expr { patch_jmp(code_ptr) ; patch_jmp(CDP($7)) ; } ; cat_expr : p_expr %prec CAT | cat_expr p_expr %prec CAT { code1(_CAT) ; } ; p_expr : DOUBLE { $$ = code_offset ; code2(_PUSHD, $1) ; } | STRING_ { $$ = code_offset ; code2(_PUSHS, $1) ; } | ID %prec AND /* anything less than IN */ { check_var($1) ; $$ = code_offset ; if ( is_local($1) ) { code2op(L_PUSHI, $1->offset) ; } else code2(_PUSHI, $1->stval.cp) ; } | LPAREN expr RPAREN { $$ = $2 ; } ; p_expr : RE { $$ = code_offset ; code2(_MATCH0, $1) ; no_leaks_re_ptr($1); } ; p_expr : p_expr PLUS p_expr { code1(_ADD) ; } | p_expr MINUS p_expr { code1(_SUB) ; } | p_expr MUL p_expr { code1(_MUL) ; } | p_expr DIV p_expr { code1(_DIV) ; } | p_expr MOD p_expr { code1(_MOD) ; } | p_expr POW p_expr { code1(_POW) ; } | NOT p_expr { $$ = $2 ; code1(_NOT) ; } | PLUS p_expr %prec UMINUS { $$ = $2 ; code1(_UPLUS) ; } | MINUS p_expr %prec UMINUS { $$ = $2 ; code1(_UMINUS) ; } | builtin ; p_expr : ID INC_or_DEC { check_var($1) ; $$ = code_offset ; code_address($1) ; if ( $2 == '+' ) code1(_POST_INC) ; else code1(_POST_DEC) ; } | INC_or_DEC lvalue { $$ = $2 ; if ( $1 == '+' ) code1(_PRE_INC) ; else code1(_PRE_DEC) ; } ; p_expr : field INC_or_DEC { if ($2 == '+' ) code1(F_POST_INC ) ; else code1(F_POST_DEC) ; } | INC_or_DEC field { $$ = $2 ; if ( $1 == '+' ) code1(F_PRE_INC) ; else code1( F_PRE_DEC) ; } ; lvalue : ID { $$ = code_offset ; check_var($1) ; code_address($1) ; } ; arglist : /* empty */ { $$ = 0 ; } | args ; args : expr %prec LPAREN { $$ = 1 ; } | args COMMA expr { $$ = $1 + 1 ; } ; builtin : BUILTIN mark LPAREN ID RPAREN { const BI_REC *p = $1 ; $$ = $2 ; if ( (int)p->min_args > 1 || (int)p->max_args < 1 ) compile_error( "wrong number of arguments in call to %s" , p->name ) ; /* if we have length(array), emit a different code */ if ( p->fp == bi_length && is_array($4) ) { check_array($4) ; code_array($4) ; { code1(_PUSHINT) ; code1(1) ; } code1(A_LENGTH) ; } else { check_var($4); if ( is_local($4) ) { code1(L_PUSHI); code1($4->offset) ; } else { code2(_PUSHI, $4->stval.cp) ; } if ( p->min_args != p->max_args ) /* variable args */ { code1(_PUSHINT) ; code1(1) ; } code2(_BUILTIN, p->fp) ; } } | BUILTIN mark LPAREN arglist RPAREN { const BI_REC *p = $1 ; $$ = $2 ; if ( (int)p->min_args > $4 || (int)p->max_args < $4 ) compile_error( "wrong number of arguments in call to %s" , p->name ) ; if ( p->min_args != p->max_args ) /* variable args */ { code1(_PUSHINT) ; code1($4) ; } code2(_BUILTIN , p->fp) ; } | LENGTH /* this is an irritation */ { $$ = code_offset ; code1(_PUSHINT) ; code1(0) ; code2(_BUILTIN, $1->fp) ; } ; /* an empty production to store the code_ptr */ mark : /* empty */ { $$ = code_offset ; } ; /* print_statement */ statement : print mark pr_args pr_direction separator { code2(_PRINT, $1) ; if ( $1 == bi_printf && $3 == 0 ) compile_error("no arguments in call to printf") ; print_flag = 0 ; $$ = $2 ; } ; print : PRINT { $$ = bi_print ; print_flag = 1 ;} | PRINTF { $$ = bi_printf ; print_flag = 1 ; } ; pr_args : arglist { code2op(_PUSHINT, $1) ; } | LPAREN arg2 RPAREN { $$ = $2->cnt ; zfree($2,sizeof(ARG2_REC)) ; code2op(_PUSHINT, $$) ; } | LPAREN RPAREN { $$=0 ; code2op(_PUSHINT, 0) ; } ; arg2 : expr COMMA expr { $$ = (ARG2_REC*) zmalloc(sizeof(ARG2_REC)) ; $$->start = $1 ; $$->cnt = 2 ; } | arg2 COMMA expr { $$ = $1 ; $$->cnt++ ; } ; pr_direction : /* empty */ | IO_OUT expr { code2op(_PUSHINT, $1) ; } ; /* IF and IF-ELSE */ if_front : IF LPAREN expr RPAREN { $$ = $3 ; eat_nl() ; code_jmp(_JZ, (INST*)0) ; } ; /* if_statement */ statement : if_front statement { patch_jmp( code_ptr ) ; } ; else : ELSE { eat_nl() ; code_jmp(_JMP, (INST*)0) ; } ; /* if_else_statement */ statement : if_front statement else statement { patch_jmp(code_ptr) ; patch_jmp(CDP($4)) ; } ; /* LOOPS */ do : DO { eat_nl() ; BC_new() ; } ; /* do_statement */ statement : do statement WHILE LPAREN expr RPAREN separator { $$ = $2 ; code_jmp(_JNZ, CDP($2)) ; BC_clear(code_ptr, CDP($5)) ; } ; while_front : WHILE LPAREN expr RPAREN { eat_nl() ; BC_new() ; $$ = $3 ; /* check if const expression */ if ( code_ptr - 2 == CDP($3) && code_ptr[-2].op == _PUSHD && *(double*)code_ptr[-1].ptr != 0.0 ) code_ptr -= 2 ; else { INST *p3 = CDP($3) ; code_push(p3, (unsigned) CodeOffset(p3), scope, active_funct) ; code_ptr = p3 ; code2(_JMP, (INST*)0) ; /* code2() not code_jmp() */ } } ; /* while_statement */ statement : while_front statement { int saved_offset ; int len ; INST *p1 = CDP($1) ; INST *p2 = CDP($2) ; if ( p1 != p2 ) /* real test in loop */ { p1[1].op = CodeOffset(p1 + 1) ; saved_offset = code_offset ; len = (int) code_pop(code_ptr) ; code_ptr += len ; code_jmp(_JNZ, CDP($2)) ; BC_clear(code_ptr, CDP(saved_offset)) ; } else /* while(1) */ { code_jmp(_JMP, p1) ; BC_clear(code_ptr, CDP($2)) ; } } ; /* for_statement */ statement : for1 for2 for3 statement { int cont_offset = code_offset ; unsigned len = code_pop(code_ptr) ; INST *p2 = CDP($2) ; INST *p4 = CDP($4) ; code_ptr += len ; if ( p2 != p4 ) /* real test in for2 */ { p4[-1].op = CodeOffset(p4 - 1) ; len = code_pop(code_ptr) ; code_ptr += len ; code_jmp(_JNZ, CDP($4)) ; } else /* for(;;) */ code_jmp(_JMP, p4) ; BC_clear(code_ptr, CDP(cont_offset)) ; } ; for1 : FOR LPAREN SEMI_COLON { $$ = code_offset ; } | FOR LPAREN expr SEMI_COLON { $$ = $3 ; code1(_POP) ; } ; for2 : SEMI_COLON { $$ = code_offset ; } | expr SEMI_COLON { if ( code_ptr - 2 == CDP($1) && code_ptr[-2].op == _PUSHD && * (double*) code_ptr[-1].ptr != 0.0 ) code_ptr -= 2 ; else { INST *p1 = CDP($1) ; code_push(p1, (unsigned) CodeOffset(p1), scope, active_funct) ; code_ptr = p1 ; code2(_JMP, (INST*)0) ; } } ; for3 : RPAREN { eat_nl() ; BC_new() ; code_push((INST*)0,0, scope, active_funct) ; } | expr RPAREN { INST *p1 = CDP($1) ; eat_nl() ; BC_new() ; code1(_POP) ; code_push(p1, (unsigned) CodeOffset(p1), scope, active_funct) ; code_ptr -= code_ptr - p1 ; } ; /* arrays */ expr : expr IN ID { check_array($3) ; code_array($3) ; code1(A_TEST) ; } | LPAREN arg2 RPAREN IN ID { $$ = $2->start ; code2op(A_CAT, $2->cnt) ; zfree($2, sizeof(ARG2_REC)) ; check_array($5) ; code_array($5) ; code1(A_TEST) ; } ; lvalue : ID mark LBOX args RBOX { if ( $4 > 1 ) { code2op(A_CAT, $4) ; } check_array($1) ; if( is_local($1) ) { code2op(LAE_PUSHA, $1->offset) ; } else code2(AE_PUSHA, $1->stval.array) ; $$ = $2 ; } ; p_expr : ID mark LBOX args RBOX %prec AND { if ( $4 > 1 ) { code2op(A_CAT, $4) ; } check_array($1) ; if( is_local($1) ) { code2op(LAE_PUSHI, $1->offset) ; } else code2(AE_PUSHI, $1->stval.array) ; $$ = $2 ; } | ID mark LBOX args RBOX INC_or_DEC { if ( $4 > 1 ) { code2op(A_CAT,$4) ; } check_array($1) ; if( is_local($1) ) { code2op(LAE_PUSHA, $1->offset) ; } else code2(AE_PUSHA, $1->stval.array) ; if ( $6 == '+' ) code1(_POST_INC) ; else code1(_POST_DEC) ; $$ = $2 ; } ; /* delete A[i] or delete A */ statement : DELETE ID mark LBOX args RBOX separator { $$ = $3 ; if ( $5 > 1 ) { code2op(A_CAT, $5) ; } check_array($2) ; code_array($2) ; code1(A_DEL) ; } | DELETE ID separator { $$ = code_offset ; check_array($2) ; code_array($2) ; code1(DEL_A) ; } ; /* for ( i in A ) statement */ array_loop_front : FOR LPAREN ID IN ID RPAREN { eat_nl() ; BC_new() ; $$ = code_offset ; check_var($3) ; code_address($3) ; check_array($5) ; code_array($5) ; code2(SET_ALOOP, (INST*)0) ; } ; /* array_loop */ statement : array_loop_front statement { INST *p2 = CDP($2) ; p2[-1].op = CodeOffset(p2 - 1) ; BC_clear( code_ptr+2 , code_ptr) ; code_jmp(ALOOP, p2) ; code1(POP_AL) ; } ; /* fields D_ID is a special token , same as an ID, but yylex() only returns it after a '$'. In essence, DOLLAR D_ID is really one token. */ field : FIELD { $$ = code_offset ; code2(F_PUSHA, $1) ; } | DOLLAR D_ID { check_var($2) ; $$ = code_offset ; if ( is_local($2) ) { code2op(L_PUSHI, $2->offset) ; } else code2(_PUSHI, $2->stval.cp) ; CODE_FE_PUSHA() ; } | DOLLAR D_ID mark LBOX args RBOX { if ( $5 > 1 ) { code2op(A_CAT, $5) ; } check_array($2) ; if( is_local($2) ) { code2op(LAE_PUSHI, $2->offset) ; } else code2(AE_PUSHI, $2->stval.array) ; CODE_FE_PUSHA() ; $$ = $3 ; } | DOLLAR p_expr { $$ = $2 ; CODE_FE_PUSHA() ; } | LPAREN field RPAREN { $$ = $2 ; } ; p_expr : field %prec CAT /* removes field (++|--) sr conflict */ { field_A2I() ; } ; expr : field ASSIGN expr { code1(F_ASSIGN) ; } | field ADD_ASG expr { code1(F_ADD_ASG) ; } | field SUB_ASG expr { code1(F_SUB_ASG) ; } | field MUL_ASG expr { code1(F_MUL_ASG) ; } | field DIV_ASG expr { code1(F_DIV_ASG) ; } | field MOD_ASG expr { code1(F_MOD_ASG) ; } | field POW_ASG expr { code1(F_POW_ASG) ; } ; /* split is handled different than a builtin because it takes an array and optionally a regular expression as args */ p_expr : split_front split_back { code2(_BUILTIN, bi_split) ; } ; split_front : SPLIT LPAREN expr COMMA ID { $$ = $3 ; check_array($5) ; code_array($5) ; } ; split_back : RPAREN { code2(_PUSHI, &fs_shadow) ; } | COMMA expr RPAREN { if ( CDP($2) == code_ptr - 2 ) { if ( code_ptr[-2].op == _MATCH0 ) RE_as_arg() ; else if ( code_ptr[-2].op == _PUSHS ) { CELL *cp = ZMALLOC(CELL) ; cp->type = C_STRING ; cp->ptr = code_ptr[-1].ptr ; cast_for_split(cp) ; code_ptr[-2].op = _PUSHC ; code_ptr[-1].ptr = (PTR) cp ; no_leaks_cell(cp); } } } ; /* match(expr, RE) */ p_expr : MATCH_FUNC LPAREN expr COMMA re_arg RPAREN { $$ = $3 ; code2(_BUILTIN, bi_match) ; } ; re_arg : expr { INST *p1 = CDP($1) ; if ( p1 == code_ptr - 2 ) { if ( p1->op == _MATCH0 ) RE_as_arg() ; else if ( p1->op == _PUSHS ) { CELL *cp = ZMALLOC(CELL) ; cp->type = C_STRING ; cp->ptr = p1[1].ptr ; cast_to_RE(cp) ; p1->op = _PUSHC ; p1[1].ptr = (PTR) cp ; no_leaks_cell(cp); } } } ; /* exit_statement */ statement : EXIT separator { $$ = code_offset ; code1(_EXIT0) ; } | EXIT expr separator { $$ = $2 ; code1(_EXIT) ; } ; return_statement : RETURN separator { $$ = code_offset ; code1(_RET0) ; } | RETURN expr separator { $$ = $2 ; code1(_RET) ; } ; /* getline */ p_expr : getline %prec GETLINE { $$ = code_offset ; code2(F_PUSHA, &field[0]) ; code1(_PUSHINT) ; code1(0) ; code2(_BUILTIN, bi_getline) ; getline_flag = 0 ; } | getline fvalue %prec GETLINE { $$ = $2 ; code1(_PUSHINT) ; code1(0) ; code2(_BUILTIN, bi_getline) ; getline_flag = 0 ; } | getline_file p_expr %prec IO_IN { code1(_PUSHINT) ; code1(F_IN) ; code2(_BUILTIN, bi_getline) ; /* getline_flag already off in yylex() */ } | p_expr PIPE GETLINE { code2(F_PUSHA, &field[0]) ; code1(_PUSHINT) ; code1(PIPE_IN) ; code2(_BUILTIN, bi_getline) ; } | p_expr PIPE GETLINE fvalue { code1(_PUSHINT) ; code1(PIPE_IN) ; code2(_BUILTIN, bi_getline) ; } ; getline : GETLINE { getline_flag = 1 ; } ; fvalue : lvalue | field ; getline_file : getline IO_IN { $$ = code_offset ; code2(F_PUSHA, field+0) ; } | getline fvalue IO_IN { $$ = $2 ; } ; /*========================================== sub and gsub ==========================================*/ p_expr : sub_or_gsub LPAREN re_arg COMMA expr sub_back { INST *p5 = CDP($5) ; INST *p6 = CDP($6) ; if ( p6 - p5 == 2 && p5->op == _PUSHS ) { /* cast from STRING to REPL at compile time */ CELL *cp = ZMALLOC(CELL) ; cp->type = C_STRING ; cp->ptr = p5[1].ptr ; cast_to_REPL(cp) ; p5->op = _PUSHC ; p5[1].ptr = (PTR) cp ; no_leaks_cell(cp); } code2(_BUILTIN, $1) ; $$ = $3 ; } ; sub_or_gsub : SUB { $$ = bi_sub ; } | GSUB { $$ = bi_gsub ; } ; sub_back : RPAREN /* substitute into $0 */ { $$ = code_offset ; code2(F_PUSHA, &field[0]) ; } | COMMA fvalue RPAREN { $$ = $2 ; } ; /*================================================ user defined functions *=================================*/ function_def : funct_start block { resize_fblock($1) ; restore_ids() ; switch_code_to_main() ; } ; funct_start : funct_head LPAREN f_arglist RPAREN { eat_nl() ; scope = SCOPE_FUNCT ; active_funct = $1 ; *main_code_p = active_code ; $1->nargs = (unsigned short) $3 ; if ( $3 ) $1->typev = (char *) memset( zmalloc((size_t) $3), ST_LOCAL_NONE, (size_t) $3) ; else $1->typev = (char *) 0 ; code_ptr = code_base = (INST *) zmalloc(INST_BYTES(PAGESZ)); code_limit = code_base + PAGESZ ; code_warn = code_limit - CODEWARN ; improve_arglist($1->name); free_arglist(); } ; funct_head : FUNCTION ID { FBLOCK *fbp ; if ( $2->type == ST_NONE ) { $2->type = ST_FUNCT ; fbp = $2->stval.fbp = (FBLOCK *) zmalloc(sizeof(FBLOCK)) ; fbp->name = $2->name ; fbp->code = (INST*) 0 ; } else { type_error( $2 ) ; /* this FBLOCK will not be put in the symbol table */ fbp = (FBLOCK*) zmalloc(sizeof(FBLOCK)) ; fbp->name = "" ; } $$ = fbp ; } | FUNCTION FUNCT_ID { $$ = $2 ; if ( $2->code ) compile_error("redefinition of %s" , $2->name) ; } ; f_arglist : /* empty */ { $$ = init_arglist() ; } | f_args ; f_args : ID { init_arglist(); $1 = save_arglist($1->name) ; $1->offset = 0 ; $$ = 1 ; } | f_args COMMA ID { if ( is_local($3) ) compile_error("%s is duplicated in argument list", $3->name) ; else { $3 = save_arglist($3->name) ; $3->offset = (unsigned char) $1 ; $$ = $1 + 1 ; } } ; outside_error : error { /* we may have to recover from a bungled function definition */ /* can have local ids, before code scope changes */ restore_ids() ; switch_code_to_main() ; } ; /* a call to a user defined function */ p_expr : FUNCT_ID mark call_args { $$ = $2 ; code2(_CALL, $1) ; if ( $3 ) code1($3->arg_num+1) ; else code1(0) ; check_fcall($1, scope, code_move_level, active_funct, $3) ; } ; call_args : LPAREN RPAREN { $$ = (CA_REC *) 0 ; } | ca_front ca_back { $$ = $2 ; $$->link = $1 ; $$->arg_num = (short) ($1 ? $1->arg_num+1 : 0) ; $$->call_lineno = token_lineno; } ; /* The funny definition of ca_front with the COMMA bound to the ID is to force a shift to avoid a reduce/reduce conflict ID->id or ID->array Or to avoid a decision, if the type of the ID has not yet been determined */ ca_front : LPAREN { $$ = (CA_REC *) 0 ; } | ca_front expr COMMA { $$ = ZMALLOC(CA_REC) ; $$->link = $1 ; $$->type = CA_EXPR ; $$->arg_num = (short) ($1 ? $1->arg_num+1 : 0) ; $$->call_offset = code_offset ; $$->call_lineno = token_lineno; } | ca_front ID COMMA { $$ = ZMALLOC(CA_REC) ; $$->type = ST_NONE ; $$->link = $1 ; $$->arg_num = (short) ($1 ? $1->arg_num+1 : 0) ; $$->call_lineno = token_lineno; code_call_id($$, $2) ; } ; ca_back : expr RPAREN { $$ = ZMALLOC(CA_REC) ; $$->type = CA_EXPR ; $$->call_offset = code_offset ; } | ID RPAREN { $$ = ZMALLOC(CA_REC) ; $$->type = ST_NONE ; code_call_id($$, $1) ; } ; %% /* * Check for special case where there is a forward reference to a newly * declared function using an array parameter. Because the parameter * mechanism for arrays uses a different byte code, we would like to know * if this is the case so that the function's contents can handle the array * type. */ static void improve_arglist(const char *name) { CA_REC *p, *p2; FCALL_REC *q; for (p = active_arglist; p != 0; p = p->link) { if (p->type == ST_LOCAL_NONE) { for (q = resolve_list; q != 0; q = q->link) { if (!strcmp(q->callee->name, name)) { for (p2 = q->arg_list; p2 != 0; p2 = p2->link) { if (p2->arg_num == p->arg_num) { switch (p2->type) { case ST_NONE: case ST_LOCAL_NONE: break; default: p->type = p2->type; p->sym_p->type = (char) p2->type; TRACE(("...set argument %d of %s to %s\n", p->arg_num, name, type_to_str(p->type))); break; } } } if (p->type != ST_LOCAL_NONE) break; } } if (p->type != ST_LOCAL_NONE) break; } } } /* maintain data for f_arglist to make it visible in funct_start */ static int init_arglist(void) { free_arglist(); return 0; } static SYMTAB * save_arglist(const char *s) { SYMTAB *result = save_id(s); CA_REC *saveit = ZMALLOC(CA_REC); CA_REC *p, *q; if (saveit != 0) { int arg_num = 0; for (p = active_arglist, q = 0; p != 0; q = p, p = p->link) { ++arg_num; } saveit->link = 0; saveit->type = ST_LOCAL_NONE; saveit->arg_num = (short) arg_num; saveit->call_lineno = token_lineno; saveit->sym_p = result; if (q != 0) { q->link = saveit; } else { active_arglist = saveit; } } return result; } static void free_arglist(void) { while (active_arglist != 0) { CA_REC *next = active_arglist->link; ZFREE(active_arglist); active_arglist = next; } } /* resize the code for a user function */ static void resize_fblock(FBLOCK * fbp) { CODEBLOCK *p = ZMALLOC(CODEBLOCK); code2op(_RET0, _HALT); /* make sure there is always a return */ *p = active_code; fbp->code = code_shrink(p, &fbp->size); /* code_shrink() zfrees p */ if (dump_code_flag) add_to_fdump_list(fbp); } /* convert FE_PUSHA to FE_PUSHI or F_PUSH to F_PUSHI */ static void field_A2I(void) { CELL *cp; if (code_ptr[-1].op == FE_PUSHA && code_ptr[-1].ptr == (PTR) 0) { /* On most architectures, the two tests are the same; a good compiler might eliminate one. On LM_DOS, and possibly other segmented architectures, they are not */ code_ptr[-1].op = FE_PUSHI; } else { cp = (CELL *) code_ptr[-1].ptr; if ((cp == field) || ((cp > NF) && (cp <= LAST_PFIELD))) { code_ptr[-2].op = _PUSHI; } else if (cp == NF) { code_ptr[-2].op = NF_PUSHI; code_ptr--; } else { code_ptr[-2].op = F_PUSHI; code_ptr->op = field_addr_to_index(code_ptr[-1].ptr); code_ptr++; } } } /* we've seen an ID in a context where it should be a VAR, check that's consistent with previous usage */ static void check_var(SYMTAB * p) { switch (p->type) { case ST_NONE: /* new id */ p->type = ST_VAR; p->stval.cp = ZMALLOC(CELL); p->stval.cp->type = C_NOINIT; break; case ST_LOCAL_NONE: p->type = ST_LOCAL_VAR; active_funct->typev[p->offset] = ST_LOCAL_VAR; break; case ST_VAR: case ST_LOCAL_VAR: break; default: type_error(p); break; } } /* we've seen an ID in a context where it should be an ARRAY, check that's consistent with previous usage */ static void check_array(SYMTAB * p) { switch (p->type) { case ST_NONE: /* a new array */ p->type = ST_ARRAY; p->stval.array = new_ARRAY(); no_leaks_array(p->stval.array); break; case ST_ARRAY: case ST_LOCAL_ARRAY: break; case ST_LOCAL_NONE: p->type = ST_LOCAL_ARRAY; active_funct->typev[p->offset] = ST_LOCAL_ARRAY; break; default: type_error(p); break; } } static void code_array(SYMTAB * p) { if (is_local(p)) code2op(LA_PUSHA, p->offset); else code2(A_PUSHA, p->stval.array); } /* we've seen an ID as an argument to a user defined function */ static void code_call_id(CA_REC * p, SYMTAB * ip) { static CELL dummy; p->call_offset = code_offset; /* This always gets set now. So that fcall:relocate_arglist works. */ switch (ip->type) { case ST_VAR: p->type = CA_EXPR; code2(_PUSHI, ip->stval.cp); break; case ST_LOCAL_VAR: p->type = CA_EXPR; code2op(L_PUSHI, ip->offset); break; case ST_ARRAY: p->type = CA_ARRAY; code2(A_PUSHA, ip->stval.array); break; case ST_LOCAL_ARRAY: p->type = CA_ARRAY; code2op(LA_PUSHA, ip->offset); break; /* not enough info to code it now; it will have to be patched later */ case ST_NONE: p->type = ST_NONE; p->sym_p = ip; code2(_PUSHI, &dummy); break; case ST_LOCAL_NONE: p->type = ST_LOCAL_NONE; p->type_p = &active_funct->typev[ip->offset]; code2op(L_PUSHI, ip->offset); break; #ifdef DEBUG default: bozo("code_call_id"); #endif } } /* an RE by itself was coded as _MATCH0 , change to push as an expression */ static void RE_as_arg(void) { CELL *cp = ZMALLOC(CELL); code_ptr -= 2; cp->type = C_RE; cp->ptr = code_ptr[1].ptr; code2(_PUSHC, cp); no_leaks_cell_ptr(cp); } /* reset the active_code back to the MAIN block */ static void switch_code_to_main(void) { switch (scope) { case SCOPE_BEGIN: *begin_code_p = active_code; active_code = *main_code_p; break; case SCOPE_END: *end_code_p = active_code; active_code = *main_code_p; break; case SCOPE_FUNCT: active_code = *main_code_p; break; case SCOPE_MAIN: break; } active_funct = (FBLOCK *) 0; scope = SCOPE_MAIN; } void parse(void) { if (yyparse() || compile_error_count != 0) mawk_exit(2); scan_cleanup(); set_code(); /* code must be set before call to resolve_fcalls() */ if (resolve_list) resolve_fcalls(); if (compile_error_count != 0) mawk_exit(2); if (dump_code_flag) { dump_code(); mawk_exit(0); } } mawk-1.3.4-20200120/aclocal.m40000644000175100001440000022513513611310562013727 0ustar tomusersdnl $MawkId: aclocal.m4,v 1.88 2020/01/20 11:39:30 tom Exp $ dnl custom mawk macros for autoconf dnl dnl The symbols beginning "CF_MAWK_" were originally written by Mike Brennan, dnl renamed for consistency by Thomas E Dickey. dnl dnl --------------------------------------------------------------------------- dnl Copyright: 2008-2019,2020 by Thomas E. Dickey dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the dnl "Software"), to deal in the Software without restriction, including dnl without limitation the rights to use, copy, modify, merge, publish, dnl distribute, distribute with modifications, sublicense, and/or sell dnl copies of the Software, and to permit persons to whom the Software is dnl furnished to do so, subject to the following conditions: dnl dnl The above copyright notice and this permission notice shall be included dnl in all copies or portions of the Software. dnl dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. dnl dnl Except as contained in this notice, the name(s) of the above copyright dnl holders shall not be used in advertising or otherwise to promote the dnl sale, use or other dealings in this Software without prior written dnl authorization. dnl dnl --------------------------------------------------------------------------- dnl See dnl https://invisible-island.net/autoconf/autoconf.html dnl https://invisible-island.net/autoconf/my-autoconf.html dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- dnl CF_ACVERSION_CHECK version: 5 updated: 2014/06/04 19:11:49 dnl ------------------ dnl Conditionally generate script according to whether we're using a given autoconf. dnl dnl $1 = version to compare against dnl $2 = code to use if AC_ACVERSION is at least as high as $1. dnl $3 = code to use if AC_ACVERSION is older than $1. define([CF_ACVERSION_CHECK], [ ifdef([AC_ACVERSION], ,[ifdef([AC_AUTOCONF_VERSION],[m4_copy([AC_AUTOCONF_VERSION],[AC_ACVERSION])],[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])])dnl ifdef([m4_version_compare], [m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1, [$3], [$2])], [CF_ACVERSION_COMPARE( AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), AC_ACVERSION, [$2], [$3])])])dnl dnl --------------------------------------------------------------------------- dnl CF_ACVERSION_COMPARE version: 3 updated: 2012/10/03 18:39:53 dnl -------------------- dnl CF_ACVERSION_COMPARE(MAJOR1, MINOR1, TERNARY1, dnl MAJOR2, MINOR2, TERNARY2, dnl PRINTABLE2, not FOUND, FOUND) define([CF_ACVERSION_COMPARE], [ifelse(builtin([eval], [$2 < $5]), 1, [ifelse([$8], , ,[$8])], [ifelse([$9], , ,[$9])])])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_CFLAGS version: 13 updated: 2017/02/25 18:57:40 dnl ------------- dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS dnl The second parameter if given makes this macro verbose. dnl dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS, dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily dnl confused by the quotes (which require backslashes to keep them usable). AC_DEFUN([CF_ADD_CFLAGS], [ cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $1 do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags) continue elif test "${cf_tst_cflags}" = "\"'" ; then CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags) continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags) ;; esac CF_APPEND_TEXT(cf_new_cppflags,$cf_add_cflags) ;; esac ;; (*) CF_APPEND_TEXT(cf_new_cflags,$cf_add_cflags) ;; esac ;; (yes) CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) CF_APPEND_TEXT(CFLAGS,$cf_new_cflags) fi if test -n "$cf_new_cppflags" ; then ifelse([$2],,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)]) CF_APPEND_TEXT(CPPFLAGS,$cf_new_cppflags) fi if test -n "$cf_new_extra_cppflags" ; then ifelse([$2],,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)]) CF_APPEND_TEXT(EXTRA_CPPFLAGS,$cf_new_extra_cppflags) fi AC_SUBST(EXTRA_CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_LIB version: 2 updated: 2010/06/02 05:03:05 dnl ---------- dnl Add a library, used to enforce consistency. dnl dnl $1 = library to add, without the "-l" dnl $2 = variable to update (default $LIBS) AC_DEFUN([CF_ADD_LIB],[CF_ADD_LIBS(-l$1,ifelse($2,,LIBS,[$2]))])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_LIBS version: 3 updated: 2019/11/02 16:47:33 dnl ----------- dnl Add one or more libraries, used to enforce consistency. Libraries are dnl prepended to an existing list, since their dependencies are assumed to dnl already exist in the list. dnl dnl $1 = libraries to add, with the "-l", etc. dnl $2 = variable to update (default $LIBS) AC_DEFUN([CF_ADD_LIBS],[ cf_add_libs="[$]ifelse($2,,LIBS,[$2])" # reverse order cf_add_0lib= for cf_add_1lib in $1; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done # filter duplicates for cf_add_1lib in $cf_add_0lib; do for cf_add_2lib in $cf_add_libs; do if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done ifelse($2,,LIBS,[$2])="$cf_add_libs" ])dnl dnl --------------------------------------------------------------------------- dnl CF_APPEND_TEXT version: 1 updated: 2017/02/25 18:58:55 dnl -------------- dnl use this macro for appending text without introducing an extra blank at dnl the beginning define([CF_APPEND_TEXT], [ test -n "[$]$1" && $1="[$]$1 " $1="[$]{$1}$2" ])dnl dnl --------------------------------------------------------------------------- dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31 dnl -------------- dnl Allow user to disable a normally-on option. AC_DEFUN([CF_ARG_DISABLE], [CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl dnl --------------------------------------------------------------------------- dnl CF_ARG_ENABLE version: 3 updated: 1999/03/30 17:24:31 dnl ------------- dnl Allow user to enable a normally-off option. AC_DEFUN([CF_ARG_ENABLE], [CF_ARG_OPTION($1,[$2],[$3],[$4],no)])dnl dnl --------------------------------------------------------------------------- dnl CF_ARG_OPTION version: 5 updated: 2015/05/10 19:52:14 dnl ------------- dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus dnl values. dnl dnl Parameters: dnl $1 = option name dnl $2 = help-string dnl $3 = action to perform if option is not default dnl $4 = action if perform if option is default dnl $5 = default option value (either 'yes' or 'no') AC_DEFUN([CF_ARG_OPTION], [AC_ARG_ENABLE([$1],[$2],[test "$enableval" != ifelse([$5],no,yes,no) && enableval=ifelse([$5],no,no,yes) if test "$enableval" != "$5" ; then ifelse([$3],,[ :]dnl ,[ $3]) ifelse([$4],,,[ else $4]) fi],[enableval=$5 ifelse([$4],,,[ $4 ])dnl ])])dnl dnl --------------------------------------------------------------------------- dnl CF_BUILD_CC version: 8 updated: 2018/01/04 20:31:04 dnl ----------- dnl If we're cross-compiling, allow the user to override the tools and their dnl options. The configure script is oriented toward identifying the host dnl compiler, etc., but we need a build compiler to generate parts of the dnl source. dnl dnl $1 = default for $CPPFLAGS dnl $2 = default for $LIBS AC_DEFUN([CF_BUILD_CC],[ CF_ACVERSION_CHECK(2.52,, [AC_REQUIRE([CF_PROG_EXT])]) if test "$cross_compiling" = yes ; then # defaults that we might want to override : ${BUILD_CFLAGS:=''} : ${BUILD_CPPFLAGS:='ifelse([$1],,,[$1])'} : ${BUILD_LDFLAGS:=''} : ${BUILD_LIBS:='ifelse([$2],,,[$2])'} : ${BUILD_EXEEXT:='$x'} : ${BUILD_OBJEXT:='o'} AC_ARG_WITH(build-cc, [ --with-build-cc=XXX the build C compiler ($BUILD_CC)], [BUILD_CC="$withval"], [AC_CHECK_PROGS(BUILD_CC, [gcc clang c99 c89 cc cl],none)]) AC_MSG_CHECKING(for native build C compiler) AC_MSG_RESULT($BUILD_CC) AC_MSG_CHECKING(for native build C preprocessor) AC_ARG_WITH(build-cpp, [ --with-build-cpp=XXX the build C preprocessor ($BUILD_CPP)], [BUILD_CPP="$withval"], [BUILD_CPP='${BUILD_CC} -E']) AC_MSG_RESULT($BUILD_CPP) AC_MSG_CHECKING(for native build C flags) AC_ARG_WITH(build-cflags, [ --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)], [BUILD_CFLAGS="$withval"]) AC_MSG_RESULT($BUILD_CFLAGS) AC_MSG_CHECKING(for native build C preprocessor-flags) AC_ARG_WITH(build-cppflags, [ --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)], [BUILD_CPPFLAGS="$withval"]) AC_MSG_RESULT($BUILD_CPPFLAGS) AC_MSG_CHECKING(for native build linker-flags) AC_ARG_WITH(build-ldflags, [ --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)], [BUILD_LDFLAGS="$withval"]) AC_MSG_RESULT($BUILD_LDFLAGS) AC_MSG_CHECKING(for native build linker-libraries) AC_ARG_WITH(build-libs, [ --with-build-libs=XXX the build libraries (${BUILD_LIBS})], [BUILD_LIBS="$withval"]) AC_MSG_RESULT($BUILD_LIBS) # this assumes we're on Unix. BUILD_EXEEXT= BUILD_OBJEXT=o : ${BUILD_CC:='${CC}'} if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then AC_MSG_ERROR([Cross-build requires two compilers. Use --with-build-cc to specify the native compiler.]) fi else : ${BUILD_CC:='${CC}'} : ${BUILD_CPP:='${CPP}'} : ${BUILD_CFLAGS:='${CFLAGS}'} : ${BUILD_CPPFLAGS:='${CPPFLAGS}'} : ${BUILD_LDFLAGS:='${LDFLAGS}'} : ${BUILD_LIBS:='${LIBS}'} : ${BUILD_EXEEXT:='$x'} : ${BUILD_OBJEXT:='o'} fi AC_SUBST(BUILD_CC) AC_SUBST(BUILD_CPP) AC_SUBST(BUILD_CFLAGS) AC_SUBST(BUILD_CPPFLAGS) AC_SUBST(BUILD_LDFLAGS) AC_SUBST(BUILD_LIBS) AC_SUBST(BUILD_EXEEXT) AC_SUBST(BUILD_OBJEXT) ])dnl dnl --------------------------------------------------------------------------- dnl CF_CC_ENV_FLAGS version: 9 updated: 2018/07/29 18:03:26 dnl --------------- dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content dnl into CC. This will not help with broken scripts that wrap the compiler dnl with options, but eliminates a more common category of user confusion. dnl dnl In particular, it addresses the problem of being able to run the C dnl preprocessor in a consistent manner. dnl dnl Caveat: this also disallows blanks in the pathname for the compiler, but dnl the nuisance of having inconsistent settings for compiler and preprocessor dnl outweighs that limitation. AC_DEFUN([CF_CC_ENV_FLAGS], [ # This should have been defined by AC_PROG_CC : ${CC:=cc} AC_MSG_CHECKING(\$CFLAGS variable) case "x$CFLAGS" in (*-[[IUD]]*) AC_MSG_RESULT(broken) AC_MSG_WARN(your environment uses the CFLAGS variable to hold CPPFLAGS options) cf_flags="$CFLAGS" CFLAGS= for cf_arg in $cf_flags do CF_ADD_CFLAGS($cf_arg) done ;; (*) AC_MSG_RESULT(ok) ;; esac AC_MSG_CHECKING(\$CC variable) case "$CC" in (*[[\ \ ]]-*) AC_MSG_RESULT(broken) AC_MSG_WARN(your environment uses the CC variable to hold CFLAGS/CPPFLAGS options) # humor him... cf_prog=`echo "$CC" | sed -e 's/ / /g' -e 's/[[ ]]* / /g' -e 's/[[ ]]*[[ ]]-[[^ ]].*//'` cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", [substr]([$]0,1+length(prog))); }'` CC="$cf_prog" for cf_arg in $cf_flags do case "x$cf_arg" in (x-[[IUDfgOW]]*) CF_ADD_CFLAGS($cf_arg) ;; (*) CC="$CC $cf_arg" ;; esac done CF_VERBOSE(resulting CC: '$CC') CF_VERBOSE(resulting CFLAGS: '$CFLAGS') CF_VERBOSE(resulting CPPFLAGS: '$CPPFLAGS') ;; (*) AC_MSG_RESULT(ok) ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_CHECK_CACHE version: 12 updated: 2012/10/02 20:55:03 dnl -------------- dnl Check if we're accidentally using a cache from a different machine. dnl Derive the system name, as a check for reusing the autoconf cache. dnl dnl If we've packaged config.guess and config.sub, run that (since it does a dnl better job than uname). Normally we'll use AC_CANONICAL_HOST, but allow dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM dnl which is useful in cross-compiles. dnl dnl Note: we would use $ac_config_sub, but that is one of the places where dnl autoconf 2.5x broke compatibility with autoconf 2.13 AC_DEFUN([CF_CHECK_CACHE], [ if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then ifelse([$1],,[AC_CANONICAL_HOST],[$1]) system_name="$host_os" else system_name="`(uname -s -r) 2>/dev/null`" if test -z "$system_name" ; then system_name="`(hostname) 2>/dev/null`" fi fi test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name",[Define to the system name.]) AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"]) test -z "$system_name" && system_name="$cf_cv_system_name" test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name) if test ".$system_name" != ".$cf_cv_system_name" ; then AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)) AC_MSG_ERROR("Please remove config.cache and try again.") fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_CHECK_ENVIRON version: 3 updated: 2010/05/26 16:44:57 dnl ---------------- dnl Check for data that is usually declared in , e.g., the 'environ' dnl variable. Define a DECL_xxx symbol if we must declare it ourselves. dnl dnl $1 = the name to check dnl $2 = the assumed type AC_DEFUN([CF_CHECK_ENVIRON], [ AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[ AC_TRY_COMPILE([ #ifdef HAVE_STDLIB_H #include #endif #include ], ifelse([$2],,int,[$2]) x = (ifelse([$2],,int,[$2])) $1, [cf_cv_dcl_$1=yes], [cf_cv_dcl_$1=no]) ]) if test "$cf_cv_dcl_$1" = no ; then CF_UPPER(cf_result,decl_$1) AC_DEFINE_UNQUOTED($cf_result) fi # It's possible (for near-UNIX clones) that the data doesn't exist CF_CHECK_EXTERN_DATA($1,ifelse([$2],,int,[$2])) ])dnl dnl --------------------------------------------------------------------------- dnl CF_CHECK_EXTERN_DATA version: 4 updated: 2015/04/18 08:56:57 dnl -------------------- dnl Check for existence of external data in the current set of libraries. If dnl we can modify it, it's real enough. dnl $1 = the name to check dnl $2 = its type AC_DEFUN([CF_CHECK_EXTERN_DATA], [ AC_CACHE_CHECK(if external $1 exists, cf_cv_have_$1,[ AC_TRY_LINK([ #undef $1 extern $2 $1; ], [$1 = 2], [cf_cv_have_$1=yes], [cf_cv_have_$1=no]) ]) if test "$cf_cv_have_$1" = yes ; then CF_UPPER(cf_result,have_$1) AC_DEFINE_UNQUOTED($cf_result) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_CLANG_COMPILER version: 2 updated: 2013/11/19 19:23:35 dnl ----------------- dnl Check if the given compiler is really clang. clang's C driver defines dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does dnl not ignore some gcc options. dnl dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from dnl the wrappers for gcc and g++ warnings. dnl dnl $1 = GCC (default) or GXX dnl $2 = CLANG_COMPILER (default) dnl $3 = CFLAGS (default) or CXXFLAGS AC_DEFUN([CF_CLANG_COMPILER],[ ifelse([$2],,CLANG_COMPILER,[$2])=no if test "$ifelse([$1],,[$1],GCC)" = yes ; then AC_MSG_CHECKING(if this is really Clang ifelse([$1],GXX,C++,C) compiler) cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])" ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -Qunused-arguments" AC_TRY_COMPILE([],[ #ifdef __clang__ #else make an error #endif ],[ifelse([$2],,CLANG_COMPILER,[$2])=yes cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments" ],[]) ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2])) fi ]) dnl --------------------------------------------------------------------------- dnl CF_CONST_X_STRING version: 3 updated: 2020/01/11 18:39:22 dnl ----------------- dnl The X11R4-X11R6 Xt specification uses an ambiguous String type for most dnl character-strings. dnl dnl It is ambiguous because the specification accommodated the pre-ANSI dnl compilers bundled by more than one vendor in lieu of providing a standard C dnl compiler other than by costly add-ons. Because of this, the specification dnl did not take into account the use of const for telling the compiler that dnl string literals would be in readonly memory. dnl dnl As a workaround, one could (starting with X11R5) define XTSTRINGDEFINES, to dnl let the compiler decide how to represent Xt's strings which were #define'd. dnl That does not solve the problem of using the block of Xt's strings which dnl are compiled into the library (and is less efficient than one might want). dnl dnl Xt specification 7 introduces the _CONST_X_STRING symbol which is used both dnl when compiling the library and compiling using the library, to tell the dnl compiler that String is const. AC_DEFUN([CF_CONST_X_STRING], [ AC_REQUIRE([AC_PATH_XTRA]) CF_SAVE_XTRA_FLAGS([CF_CONST_X_STRING]) AC_TRY_COMPILE( [ #include #include ], [String foo = malloc(1)],[ AC_CACHE_CHECK(for X11/Xt const-feature,cf_cv_const_x_string,[ AC_TRY_COMPILE( [ #define _CONST_X_STRING /* X11R7.8 (perhaps) */ #undef XTSTRINGDEFINES /* X11R5 and later */ #include #include ],[String foo = malloc(1); *foo = 0],[ cf_cv_const_x_string=no ],[ cf_cv_const_x_string=yes ]) ]) CF_RESTORE_XTRA_FLAGS([CF_CONST_X_STRING]) case $cf_cv_const_x_string in (no) CF_APPEND_TEXT(CPPFLAGS,-DXTSTRINGDEFINES) ;; (*) CF_APPEND_TEXT(CPPFLAGS,-D_CONST_X_STRING) ;; esac ]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_DISABLE_ECHO version: 13 updated: 2015/04/18 08:56:57 dnl --------------- dnl You can always use "make -n" to see the actual options, but it's hard to dnl pick out/analyze warning messages when the compile-line is long. dnl dnl Sets: dnl ECHO_LT - symbol to control if libtool is verbose dnl ECHO_LD - symbol to prefix "cc -o" lines dnl RULE_CC - symbol to put before implicit "cc -c" lines (e.g., .c.o) dnl SHOW_CC - symbol to put before explicit "cc -c" lines dnl ECHO_CC - symbol to put before any "cc" line dnl AC_DEFUN([CF_DISABLE_ECHO],[ AC_MSG_CHECKING(if you want to see long compiling messages) CF_ARG_DISABLE(echo, [ --disable-echo do not display "compiling" commands], [ ECHO_LT='--silent' ECHO_LD='@echo linking [$]@;' RULE_CC='@echo compiling [$]<' SHOW_CC='@echo compiling [$]@' ECHO_CC='@' ],[ ECHO_LT='' ECHO_LD='' RULE_CC='' SHOW_CC='' ECHO_CC='' ]) AC_MSG_RESULT($enableval) AC_SUBST(ECHO_LT) AC_SUBST(ECHO_LD) AC_SUBST(RULE_CC) AC_SUBST(SHOW_CC) AC_SUBST(ECHO_CC) ])dnl dnl --------------------------------------------------------------------------- dnl CF_DISABLE_LEAKS version: 7 updated: 2012/10/02 20:55:03 dnl ---------------- dnl Combine no-leak checks with the libraries or tools that are used for the dnl checks. AC_DEFUN([CF_DISABLE_LEAKS],[ AC_REQUIRE([CF_WITH_DMALLOC]) AC_REQUIRE([CF_WITH_DBMALLOC]) AC_REQUIRE([CF_WITH_VALGRIND]) AC_MSG_CHECKING(if you want to perform memory-leak testing) AC_ARG_ENABLE(leaks, [ --disable-leaks test: free permanent memory, analyze leaks], [if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi], : ${with_no_leaks:=no}) AC_MSG_RESULT($with_no_leaks) if test "$with_no_leaks" = yes ; then AC_DEFINE(NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.]) AC_DEFINE(YY_NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_ENABLE_TRACE version: 3 updated: 2012/10/04 05:24:07 dnl --------------- AC_DEFUN([CF_ENABLE_TRACE],[ AC_MSG_CHECKING(if you want to enable debugging trace) CF_ARG_ENABLE(trace, [ --enable-trace test: turn on debug-tracing], [with_trace=yes], [with_trace=no]) AC_MSG_RESULT($with_trace) if test "$with_trace" = "yes" then AC_DEFINE(OPT_TRACE,1,[Define to 1 if you want to enable debugging trace]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_ENABLE_WARNINGS version: 5 updated: 2017/09/29 20:01:16 dnl ------------------ dnl Configure-option to enable gcc warnings AC_DEFUN([CF_ENABLE_WARNINGS],[ if ( test "$GCC" = yes || test "$GXX" = yes ) then AC_MSG_CHECKING(if you want to turn on gcc warnings) CF_ARG_ENABLE(warnings, [ --enable-warnings test: turn on gcc compiler warnings], [with_warnings=yes], [with_warnings=no]) AC_MSG_RESULT($with_warnings) if test "$with_warnings" = "yes" then CF_GCC_ATTRIBUTES CF_GCC_WARNINGS($1) fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_GCC_ATTRIBUTES version: 17 updated: 2015/04/12 15:39:00 dnl ----------------- dnl Test for availability of useful gcc __attribute__ directives to quiet dnl compiler warnings. Though useful, not all are supported -- and contrary dnl to documentation, unrecognized directives cause older compilers to barf. AC_DEFUN([CF_GCC_ATTRIBUTES], [ if test "$GCC" = yes then cat > conftest.i < conftest.$ac_ext <&AC_FD_CC case $cf_attribute in (printf) cf_printf_attribute=yes cat >conftest.h <conftest.h <conftest.h <>confdefs.h case $cf_attribute in (noreturn) AC_DEFINE_UNQUOTED(GCC_NORETURN,$cf_directive,[Define to noreturn-attribute for gcc]) ;; (printf) cf_value='/* nothing */' if test "$cf_printf_attribute" != no ; then cf_value='__attribute__((format(printf,fmt,var)))' AC_DEFINE(GCC_PRINTF,1,[Define to 1 if the compiler supports gcc-like printf attribute.]) fi AC_DEFINE_UNQUOTED(GCC_PRINTFLIKE(fmt,var),$cf_value,[Define to printf-attribute for gcc]) ;; (scanf) cf_value='/* nothing */' if test "$cf_scanf_attribute" != no ; then cf_value='__attribute__((format(scanf,fmt,var)))' AC_DEFINE(GCC_SCANF,1,[Define to 1 if the compiler supports gcc-like scanf attribute.]) fi AC_DEFINE_UNQUOTED(GCC_SCANFLIKE(fmt,var),$cf_value,[Define to sscanf-attribute for gcc]) ;; (unused) AC_DEFINE_UNQUOTED(GCC_UNUSED,$cf_directive,[Define to unused-attribute for gcc]) ;; esac fi done else fgrep define conftest.i >>confdefs.h fi rm -rf conftest* fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_GCC_VERSION version: 8 updated: 2019/09/07 13:38:36 dnl -------------- dnl Find version of gcc, and (because icc/clang pretend to be gcc without being dnl compatible), attempt to determine if icc/clang is actually used. AC_DEFUN([CF_GCC_VERSION],[ AC_REQUIRE([AC_PROG_CC]) GCC_VERSION=none if test "$GCC" = yes ; then AC_MSG_CHECKING(version of $CC) GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[[^)]]*) //' -e 's/^.*(Debian[[^)]]*) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown AC_MSG_RESULT($GCC_VERSION) fi CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS) CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_GCC_WARNINGS version: 37 updated: 2020/01/05 20:04:12 dnl --------------- dnl Check if the compiler supports useful warning options. There's a few that dnl we don't use, simply because they're too noisy: dnl dnl -Wconversion (useful in older versions of gcc, but not in gcc 2.7.x) dnl -Winline (usually not worthwhile) dnl -Wredundant-decls (system headers make this too noisy) dnl -Wtraditional (combines too many unrelated messages, only a few useful) dnl -Wwrite-strings (too noisy, but should review occasionally). This dnl is enabled for ncurses using "--enable-const". dnl -pedantic dnl dnl Parameter: dnl $1 is an optional list of gcc warning flags that a particular dnl application might want to use, e.g., "no-unused" for dnl -Wno-unused dnl Special: dnl If $with_ext_const is "yes", add a check for -Wwrite-strings dnl AC_DEFUN([CF_GCC_WARNINGS], [ AC_REQUIRE([CF_GCC_VERSION]) if test "x$have_x" = xyes; then CF_CONST_X_STRING fi cat > conftest.$ac_ext <],[ #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0 return 0; #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0 return 0; #else # error not GNU C library #endif], [cf_cv_gnu_library=yes], [cf_cv_gnu_library=no]) ]) if test x$cf_cv_gnu_library = xyes; then # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE # was changed to help a little. newlib incorporated the change about 4 # years later. AC_CACHE_CHECK(if _DEFAULT_SOURCE can be used as a basis,cf_cv_gnu_library_219,[ cf_save="$CPPFLAGS" CF_APPEND_TEXT(CPPFLAGS,-D_DEFAULT_SOURCE) AC_TRY_COMPILE([#include ],[ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2) return 0; #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3) return 0; #else # error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old #endif], [cf_cv_gnu_library_219=yes], [cf_cv_gnu_library_219=no]) CPPFLAGS="$cf_save" ]) if test "x$cf_cv_gnu_library_219" = xyes; then cf_save="$CPPFLAGS" AC_CACHE_CHECK(if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE,cf_cv_gnu_dftsrc_219,[ CF_ADD_CFLAGS(-D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source) AC_TRY_COMPILE([ #include #include ],[ #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1) return 0; #else # error GNU C library is too old #endif], [cf_cv_gnu_dftsrc_219=yes], [cf_cv_gnu_dftsrc_219=no]) ]) test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save" else cf_cv_gnu_dftsrc_219=maybe fi if test "x$cf_cv_gnu_dftsrc_219" != xyes; then AC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[ AC_TRY_COMPILE([#include ],[ #ifndef _XOPEN_SOURCE #error expected _XOPEN_SOURCE to be defined #endif], [cf_cv_gnu_source=no], [cf_save="$CPPFLAGS" CF_ADD_CFLAGS(-D_GNU_SOURCE) AC_TRY_COMPILE([#include ],[ #ifdef _XOPEN_SOURCE #error expected _XOPEN_SOURCE to be undefined #endif], [cf_cv_gnu_source=no], [cf_cv_gnu_source=yes]) CPPFLAGS="$cf_save" ]) ]) if test "$cf_cv_gnu_source" = yes then AC_CACHE_CHECK(if we should also define _DEFAULT_SOURCE,cf_cv_default_source,[ CF_APPEND_TEXT(CPPFLAGS,-D_GNU_SOURCE) AC_TRY_COMPILE([#include ],[ #ifdef _DEFAULT_SOURCE #error expected _DEFAULT_SOURCE to be undefined #endif], [cf_cv_default_source=no], [cf_cv_default_source=yes]) ]) if test "$cf_cv_default_source" = yes then CF_APPEND_TEXT(CPPFLAGS,-D_DEFAULT_SOURCE) fi fi fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_HELP_MESSAGE version: 4 updated: 2019/12/31 08:53:54 dnl --------------- dnl Insert text into the help-message, for readability, from AC_ARG_WITH. AC_DEFUN([CF_HELP_MESSAGE], [CF_ACVERSION_CHECK(2.53,[],[ AC_DIVERT_HELP($1)])dnl ])dnl dnl --------------------------------------------------------------------------- dnl CF_INTEL_COMPILER version: 7 updated: 2015/04/12 15:39:00 dnl ----------------- dnl Check if the given compiler is really the Intel compiler for Linux. It dnl tries to imitate gcc, but does not return an error when it finds a mismatch dnl between prototypes, e.g., as exercised by CF_MISSING_CHECK. dnl dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from dnl the wrappers for gcc and g++ warnings. dnl dnl $1 = GCC (default) or GXX dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS dnl $3 = CFLAGS (default) or CXXFLAGS AC_DEFUN([CF_INTEL_COMPILER],[ AC_REQUIRE([AC_CANONICAL_HOST]) ifelse([$2],,INTEL_COMPILER,[$2])=no if test "$ifelse([$1],,[$1],GCC)" = yes ; then case $host_os in (linux*|gnu*) AC_MSG_CHECKING(if this is really Intel ifelse([$1],GXX,C++,C) compiler) cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])" ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -no-gcc" AC_TRY_COMPILE([],[ #ifdef __INTEL_COMPILER #else make an error #endif ],[ifelse([$2],,INTEL_COMPILER,[$2])=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147" ],[]) ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2])) ;; esac fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_LARGEFILE version: 11 updated: 2018/06/20 20:23:13 dnl ------------ dnl Add checks for large file support. AC_DEFUN([CF_LARGEFILE],[ ifdef([AC_FUNC_FSEEKO],[ AC_SYS_LARGEFILE if test "$enable_largefile" != no ; then AC_FUNC_FSEEKO # Normally we would collect these definitions in the config.h, # but (like _XOPEN_SOURCE), some environments rely on having these # defined before any of the system headers are included. Another # case comes up with C++, e.g., on AIX the compiler compiles the # header files by themselves before looking at the body files it is # told to compile. For ncurses, those header files do not include # the config.h if test "$ac_cv_sys_large_files" != no then CF_APPEND_TEXT(CPPFLAGS,-D_LARGE_FILES) fi if test "$ac_cv_sys_largefile_source" != no then CF_APPEND_TEXT(CPPFLAGS,-D_LARGEFILE_SOURCE) fi if test "$ac_cv_sys_file_offset_bits" != no then CF_APPEND_TEXT(CPPFLAGS,-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits) fi AC_CACHE_CHECK(whether to use struct dirent64, cf_cv_struct_dirent64,[ AC_TRY_COMPILE([ #pragma GCC diagnostic error "-Wincompatible-pointer-types" #include #include ],[ /* if transitional largefile support is setup, this is true */ extern struct dirent64 * readdir(DIR *); struct dirent64 *x = readdir((DIR *)0); struct dirent *y = readdir((DIR *)0); int z = x - y; ], [cf_cv_struct_dirent64=yes], [cf_cv_struct_dirent64=no]) ]) test "$cf_cv_struct_dirent64" = yes && AC_DEFINE(HAVE_STRUCT_DIRENT64,1,[Define to 1 if we have struct dirent64]) fi ]) ]) dnl --------------------------------------------------------------------------- dnl CF_LOCALE version: 5 updated: 2012/10/06 11:17:15 dnl --------- dnl Check if we have setlocale() and its header, dnl The optional parameter $1 tells what to do if we do have locale support. AC_DEFUN([CF_LOCALE], [ AC_MSG_CHECKING(for setlocale()) AC_CACHE_VAL(cf_cv_locale,[ AC_TRY_LINK([#include ], [setlocale(LC_ALL, "")], [cf_cv_locale=yes], [cf_cv_locale=no]) ]) AC_MSG_RESULT($cf_cv_locale) test $cf_cv_locale = yes && { ifelse($1,,AC_DEFINE(LOCALE,1,[Define to 1 if we have locale support]),[$1]) } ])dnl dnl --------------------------------------------------------------------------- dnl CF_MAKEFLAGS version: 18 updated: 2018/02/21 21:26:03 dnl ------------ dnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make' dnl options to lower-levels. It's very useful for "make -n" -- if we have it. dnl (GNU 'make' does both, something POSIX 'make', which happens to make the dnl ${MAKEFLAGS} variable incompatible because it adds the assignments :-) AC_DEFUN([CF_MAKEFLAGS], [ AC_CACHE_CHECK(for makeflags variable, cf_cv_makeflags,[ cf_cv_makeflags='' for cf_option in '-${MAKEFLAGS}' '${MFLAGS}' do cat >cf_makeflags.tmp </dev/null | fgrep -v "ing directory" | sed -e 's,[[ ]]*$,,'` case "$cf_result" in (.*k|.*kw) cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` case "$cf_result" in (.*CC=*) cf_cv_makeflags= ;; (*) cf_cv_makeflags=$cf_option ;; esac break ;; (.-) ;; (*) CF_MSG_LOG(given option \"$cf_option\", no match \"$cf_result\") ;; esac done rm -f cf_makeflags.tmp ]) AC_SUBST(cf_cv_makeflags) ])dnl dnl --------------------------------------------------------------------------- dnl CF_MAKE_TAGS version: 6 updated: 2010/10/23 15:52:32 dnl ------------ dnl Generate tags/TAGS targets for makefiles. Do not generate TAGS if we have dnl a monocase filesystem. AC_DEFUN([CF_MAKE_TAGS],[ AC_REQUIRE([CF_MIXEDCASE_FILENAMES]) AC_CHECK_PROGS(CTAGS, exctags ctags) AC_CHECK_PROGS(ETAGS, exetags etags) AC_CHECK_PROG(MAKE_LOWER_TAGS, ${CTAGS:-ctags}, yes, no) if test "$cf_cv_mixedcase" = yes ; then AC_CHECK_PROG(MAKE_UPPER_TAGS, ${ETAGS:-etags}, yes, no) else MAKE_UPPER_TAGS=no fi if test "$MAKE_UPPER_TAGS" = yes ; then MAKE_UPPER_TAGS= else MAKE_UPPER_TAGS="#" fi if test "$MAKE_LOWER_TAGS" = yes ; then MAKE_LOWER_TAGS= else MAKE_LOWER_TAGS="#" fi AC_SUBST(CTAGS) AC_SUBST(ETAGS) AC_SUBST(MAKE_UPPER_TAGS) AC_SUBST(MAKE_LOWER_TAGS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_MAWK_CHECK_LIMITS_MSG version: 1 updated: 2008/09/09 19:18:22 dnl ------------------------ dnl Write error-message if CF_MAWK_FIND_MAX_INT fails. AC_DEFUN([CF_MAWK_CHECK_LIMITS_MSG], [AC_MSG_ERROR(C program to compute maxint and maxlong failed. Please send bug report to CF_MAWK_MAINTAINER.)])dnl dnl --------------------------------------------------------------------------- dnl CF_MAWK_CHECK_SIZE_T version: 3 updated: 2012/10/25 20:41:47 dnl -------------------- dnl Check if size_t is found in the given header file, unless we have already dnl found it. dnl $1 = header to check dnl $2 = symbol to define if size_t is found there. dnl Find size_t. AC_DEFUN([CF_MAWK_CHECK_SIZE_T],[ if test "x$cf_mawk_check_size_t" != xyes ; then AC_CACHE_VAL(cf_cv_size_t_$2,[ AC_CHECK_HEADER($1,cf_mawk_check_size=ok) if test "x$cf_mawk_check_size" = xok ; then AC_CACHE_CHECK(if size_t is declared in $1,cf_cv_size_t_$2,[ AC_TRY_COMPILE([#include <$1>],[size_t *n], [cf_cv_size_t_$2=yes], [cf_cv_size_t_$2=no])]) fi ]) if test "x$cf_cv_size_t_$2" = xyes ; then AC_DEFINE_UNQUOTED($2,1,[Define to 1 if we have $1 header]) cf_mawk_check_size_t=yes fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_MAWK_FIND_MAX_INT version: 6 updated: 2017/10/16 20:54:11 dnl -------------------- dnl Try to find a definition of MAX__INT from limits.h else compute. AC_DEFUN([CF_MAWK_FIND_MAX_INT], [AC_CHECK_HEADER(limits.h,cf_limits_h=yes) if test "$cf_limits_h" = yes ; then : else AC_CHECK_HEADER(values.h,cf_values_h=yes) if test "$cf_values_h" = yes ; then AC_TRY_RUN( [#include #include int main(void) { FILE *out = fopen("conftest.out", "w") ; unsigned max_uint = 0; if ( ! out ) exit(1) ; fprintf(out, "MAX__INT 0x%x\n", MAXINT) ; fprintf(out, "MAX__LONG 0x%lx\n", MAXLONG) ; #ifdef MAXUINT max_uint = MAXUINT; /* not likely (SunOS/Solaris lacks it) */ #else max_uint = MAXINT; max_uint <<= 1; max_uint |= 1; #endif fprintf(out, "MAX__UINT 0x%lx\n", max_uint) ; exit(0) ; return(0) ; } ], cf_maxint_set=yes,[CF_MAWK_CHECK_LIMITS_MSG]) fi if test "x$cf_maxint_set" != xyes ; then # compute it -- assumes two's complement AC_TRY_RUN(CF_MAWK_MAX__INT_PROGRAM,:,[CF_MAWK_CHECK_LIMITS_MSG]) fi cat conftest.out | while true do read name value test -z "$name" && break AC_DEFINE_UNQUOTED($name,$value) done rm -f conftest.out fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_MAWK_FIND_SIZE_T version: 1 updated: 2008/09/09 19:18:22 dnl ------------------- AC_DEFUN([CF_MAWK_FIND_SIZE_T], [CF_MAWK_CHECK_SIZE_T(stddef.h,SIZE_T_STDDEF_H) CF_MAWK_CHECK_SIZE_T(sys/types.h,SIZE_T_TYPES_H)])dnl dnl --------------------------------------------------------------------------- dnl CF_MAWK_FPE_SIGINFO version: 8 updated: 2012/10/25 20:41:47 dnl ------------------- dnl SYSv and Solaris FPE checks AC_DEFUN([CF_MAWK_FPE_SIGINFO], [ if test "x$cf_cv_use_sv_siginfo" = "xno" then AC_CHECK_FUNC(sigvec,cf_have_sigvec=1) echo "FPE_CHECK 2:get_fpe_codes" >&AC_FD_CC if test "$cf_have_sigvec" = 1 && ./fpe_check$ac_exeext phoney_arg >> defines.out ; then : else dnl FIXME - look for sigprocmask if we have sigaction AC_DEFINE(NOINFO_SIGFPE,1,[Define to 1 if we cannot use SYSv siginfo]) fi fi]) dnl --------------------------------------------------------------------------- dnl CF_MAWK_MAINTAINER version: 2 updated: 2009/07/12 09:10:33 dnl ------------------ AC_DEFUN([CF_MAWK_MAINTAINER], [dickey@invisible-island.net]) dnl --------------------------------------------------------------------------- dnl CF_MAWK_MATHLIB version: 3 updated: 2009/12/19 13:18:53 dnl --------------- dnl Look for math library. AC_DEFUN([CF_MAWK_MATHLIB],[ if test "${MATHLIB+set}" != set ; then AC_CHECK_LIB(m,log,[MATHLIB=-lm ; LIBS="-lm $LIBS"], [# maybe don't need separate math library AC_CHECK_FUNC(log, log=yes) if test "$log" = yes then MATHLIB='' # evidently don't need one else AC_MSG_ERROR( Cannot find a math library. You need to set MATHLIB in config.user) fi])dnl fi AC_SUBST(MATHLIB)])dnl dnl --------------------------------------------------------------------------- dnl CF_MAWK_MAX__INT_PROGRAM version: 4 updated: 2017/10/16 20:54:11 dnl ------------------------ dnl C program to compute MAX__INT and MAX__LONG if looking at headers fails AC_DEFUN([CF_MAWK_MAX__INT_PROGRAM], [[#include int main(void) { int y ; unsigned yu; long yy ; FILE *out ; if ( !(out = fopen("conftest.out","w")) ) exit(1) ; /* find max int and max long */ y = 0x1000 ; while ( y > 0 ) { yu = y; y *= 2 ; } fprintf(out,"MAX__INT 0x%x\n", y-1) ; yu = yu - 1; yu <<= 1; yu |= 1; fprintf(out,"MAX__UINT 0x%x\n", y-1) ; yy = 0x1000 ; while ( yy > 0 ) yy *= 2 ; fprintf(out,"MAX__LONG 0x%lx\n", yy-1) ; exit(0) ; return 0 ; }]])dnl dnl --------------------------------------------------------------------------- dnl CF_MAWK_RUN_FPE_TESTS version: 15 updated: 2020/01/18 12:30:33 dnl --------------------- dnl These are mawk's dreaded FPE tests. AC_DEFUN([CF_MAWK_RUN_FPE_TESTS], [ AC_CHECK_FUNCS(isnan sigaction) test "$ac_cv_func_sigaction" = yes && sigaction=1 AC_CHECK_HEADERS(siginfo.h) test "$ac_cv_header_siginfo_h" = yes && siginfo_h=1 AC_CACHE_CHECK(if we should use siginfo,cf_cv_use_sv_siginfo,[ if test "$sigaction" = 1 && test "$siginfo_h" = 1 ; then cf_cv_use_sv_siginfo=yes else cf_cv_use_sv_siginfo=no fi ]) AC_TYPE_SIGNAL AC_CACHE_CHECK(if we should use sigaction.sa_sigaction,cf_cv_use_sa_sigaction, [ cf_cv_use_sa_sigaction=no if test "$ac_cv_func_sigaction" = yes then AC_TRY_COMPILE([#include ],[ struct sigaction foo; foo.sa_sigaction = 0; ],[cf_cv_use_sa_sigaction=yes]) fi ]) test "$cf_cv_use_sa_sigaction" = yes && AC_DEFINE(HAVE_SIGACTION_SA_SIGACTION,1,[Define to 1 if we should use sigaction.sa_sigaction,cf_cv_use_sa_sigaction]) cf_FPE_DEFS="$CPPFLAGS" cf_FPE_LIBS="$LIBS" cf_FPE_SRCS="$srcdir/fpe_check.c" CPPFLAGS="$CPPFLAGS -I. -DRETSIGTYPE=$ac_cv_type_signal" test "$ac_cv_func_isnan" = yes && CPPFLAGS="$CPPFLAGS -DHAVE_ISNAN" test "$ac_cv_func_nanf" = yes && CPPFLAGS="$CPPFLAGS -DHAVE_NANF" test "$ac_cv_func_sigaction" = yes && CPPFLAGS="$CPPFLAGS -DHAVE_SIGACTION" test "$ac_cv_header_siginfo_h" = yes && CPPFLAGS="$CPPFLAGS -DHAVE_SIGINFO_H" test "$cf_cv_use_sa_sigaction" = yes && CPPFLAGS="$CPPFLAGS -DHAVE_SIGACTION_SA_SIGACTION" LIBS="$MATHLIB $LIBS" echo checking handling of floating point exceptions cat >conftest.$ac_ext < CF_EOF rm -f conftest$ac_exeext if AC_TRY_EVAL(ac_link); then echo "FPE_CHECK 1:check_fpe_traps" >&AC_FD_CC ./conftest 2>/dev/null cf_status=$? else echo "$cf_FPE_SRCS failed to compile" 1>&2 cf_status=100 fi echo "FPE_CHECK status=$cf_status" >&AC_FD_CC case $cf_status in (0) ;; # good news do nothing (3) # reasonably good news AC_DEFINE(FPE_TRAPS_ON,1,[Define to 1 if floating-point exception traps are enabled]) CF_MAWK_FPE_SIGINFO ;; (1|2|4) # bad news have to turn off traps # only know how to do this on systemV and solaris AC_CHECK_HEADER(ieeefp.h, cf_have_ieeefp_h=1) AC_CHECK_FUNC(fpsetmask, cf_have_fpsetmask=1) if test "$cf_have_ieeefp_h" = 1 && test "$cf_have_fpsetmask" = 1 ; then AC_DEFINE(FPE_TRAPS_ON) AC_DEFINE(USE_IEEEFP_H,1,[Define to 1 we should include ieeefp.h]) AC_DEFINE_UNQUOTED([TURN_ON_FPE_TRAPS], [fpsetmask(fpgetmask() | (FP_X_DZ|FP_X_OFL))], [Define to expression for turning on FPE traps]) AC_DEFINE_UNQUOTED([TURN_OFF_FPE_TRAPS], [fpsetmask(fpgetmask() & ~(FP_X_DZ|FP_X_OFL))], [Define to expression for turning off FPE traps]) CF_MAWK_FPE_SIGINFO # look for strtod overflow bug AC_MSG_CHECKING([strtod bug on overflow]) rm -f conftest$ac_exeext CPPFLAGS="$CPPFLAGS -DUSE_IEEEFP_H" cat >conftest.$ac_ext < CF_EOF if AC_TRY_EVAL(ac_link); then echo "FPE_CHECK 3:check_strtod_ovf" >&AC_FD_CC if ./conftest phoney_arg phoney_arg 2>/dev/null then AC_MSG_RESULT([no bug]) else AC_MSG_RESULT([buggy -- will use work around]) AC_DEFINE_UNQUOTED(HAVE_STRTOD_OVF_BUG,1,[Define to 1 if strtod has overflow bug]) fi else AC_MSG_RESULT([$cf_FPE_SRCS failed to compile]) fi else if test $cf_status != 4 ; then AC_DEFINE(FPE_TRAPS_ON) CF_MAWK_FPE_SIGINFO fi [case $cf_status in (1) cat 1>&2 <<-'EOF' Warning: Your system defaults generate floating point exception on divide by zero but not on overflow. You need to #define TURN_ON_FPE_TRAPS to handle overflow. EOF ;; (2) cat 1>&2 <<-'EOF' Warning: Your system defaults generate floating point exception on overflow but not on divide by zero. You need to #define TURN_ON_FPE_TRAPS to handle divide by zero. EOF ;; (4) cat 1>&2 <<-'EOF' Warning: Your system defaults do not generate floating point exceptions, but your math library does not support this behavior. You need to #define TURN_ON_FPE_TRAPS to use fp exceptions for consistency. EOF ;; esac] cat 1>&2 <<-'EOF' Please report this so I can fix this script to do it automatically. CF_MAWK_MAINTAINER You can continue with the build and the resulting mawk will be usable, but getting FPE_TRAPS_ON correct eventually is best. EOF fi ;; (*) # some sort of disaster if test "x$cross_compiling" = xno then cat 1>&2 <<-EOF The program \`fpe_check' compiled from $cf_FPE_SRCS seems to have unexpectly blown up. Please report this to CF_MAWK_MAINTAINER EOF # quit or not ??? else cat 1>&2 <<-EOF The program \`fpe_check' will not work for cross-compiling. You can continue with the build and the resulting mawk will be usable, but getting FPE_TRAPS_ON correct eventually is best. EOF fi ;; esac CPPFLAGS="$cf_FPE_DEFS" LIBS="$cf_FPE_LIBS" rm -f conftest.$ac_ext fpe_check$ac_exeext # whew!! ]) dnl --------------------------------------------------------------------------- dnl CF_MIXEDCASE_FILENAMES version: 7 updated: 2015/04/12 15:39:00 dnl ---------------------- dnl Check if the file-system supports mixed-case filenames. If we're able to dnl create a lowercase name and see it as uppercase, it doesn't support that. AC_DEFUN([CF_MIXEDCASE_FILENAMES], [ AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[ if test "$cross_compiling" = yes ; then case $target_alias in (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*) cf_cv_mixedcase=no ;; (*) cf_cv_mixedcase=yes ;; esac else rm -f conftest CONFTEST echo test >conftest if test -f CONFTEST ; then cf_cv_mixedcase=no else cf_cv_mixedcase=yes fi rm -f conftest CONFTEST fi ]) test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES,1,[Define to 1 if filesystem supports mixed-case filenames.]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32 dnl ---------- dnl Write a debug message to config.log, along with the line number in the dnl configure script. AC_DEFUN([CF_MSG_LOG],[ echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC ])dnl dnl --------------------------------------------------------------------------- dnl CF_NO_LEAKS_OPTION version: 6 updated: 2015/04/12 15:39:00 dnl ------------------ dnl see CF_WITH_NO_LEAKS AC_DEFUN([CF_NO_LEAKS_OPTION],[ AC_MSG_CHECKING(if you want to use $1 for testing) AC_ARG_WITH($1, [$2], [AC_DEFINE_UNQUOTED($3,1,"Define to 1 if you want to use $1 for testing.")ifelse([$4],,[ $4 ]) : ${with_cflags:=-g} : ${with_no_leaks:=yes} with_$1=yes], [with_$1=]) AC_MSG_RESULT(${with_$1:-no}) case .$with_cflags in (.*-g*) case .$CFLAGS in (.*-g*) ;; (*) CF_ADD_CFLAGS([-g]) ;; esac ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_PATH_SYNTAX version: 16 updated: 2015/04/18 08:56:57 dnl -------------- dnl Check the argument to see that it looks like a pathname. Rewrite it if it dnl begins with one of the prefix/exec_prefix variables, and then again if the dnl result begins with 'NONE'. This is necessary to work around autoconf's dnl delayed evaluation of those symbols. AC_DEFUN([CF_PATH_SYNTAX],[ if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" else cf_path_syntax="$ac_default_prefix" fi case ".[$]$1" in (.\[$]\(*\)*|.\'*\'*) ;; (..|./*|.\\*) ;; (.[[a-zA-Z]]:[[\\/]]*) # OS/2 EMX ;; (.\[$]{*prefix}*|.\[$]{*dir}*) eval $1="[$]$1" case ".[$]$1" in (.NONE/*) $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%` ;; esac ;; (.no|.NONE/*) $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%` ;; (*) ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2) ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_POSIX_C_SOURCE version: 11 updated: 2018/12/31 20:46:17 dnl ----------------- dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed. dnl dnl POSIX.1-1990 _POSIX_SOURCE dnl POSIX.1-1990 and _POSIX_SOURCE and dnl POSIX.2-1992 C-Language _POSIX_C_SOURCE=2 dnl Bindings Option dnl POSIX.1b-1993 _POSIX_C_SOURCE=199309L dnl POSIX.1c-1996 _POSIX_C_SOURCE=199506L dnl X/Open 2000 _POSIX_C_SOURCE=200112L dnl dnl Parameters: dnl $1 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_POSIX_C_SOURCE], [AC_REQUIRE([CF_POSIX_VISIBLE])dnl if test "$cf_cv_posix_visible" = no; then cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1]) cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" CF_REMOVE_DEFINE(cf_trim_CFLAGS,$cf_save_CFLAGS,_POSIX_C_SOURCE) CF_REMOVE_DEFINE(cf_trim_CPPFLAGS,$cf_save_CPPFLAGS,_POSIX_C_SOURCE) AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_posix_c_source,[ CF_MSG_LOG(if the symbol is already defined go no further) AC_TRY_COMPILE([#include ],[ #ifndef _POSIX_C_SOURCE make an error #endif], [cf_cv_posix_c_source=no], [cf_want_posix_source=no case .$cf_POSIX_C_SOURCE in (.[[12]]??*) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" ;; (.2) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" cf_want_posix_source=yes ;; (.*) cf_want_posix_source=yes ;; esac if test "$cf_want_posix_source" = yes ; then AC_TRY_COMPILE([#include ],[ #ifdef _POSIX_SOURCE make an error #endif],[], cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE") fi CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE) CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" CF_APPEND_TEXT(CPPFLAGS,$cf_cv_posix_c_source) CF_MSG_LOG(if the second compile does not leave our definition intact error) AC_TRY_COMPILE([#include ],[ #ifndef _POSIX_C_SOURCE make an error #endif],, [cf_cv_posix_c_source=no]) CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" ]) ]) if test "$cf_cv_posix_c_source" != no ; then CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" CF_ADD_CFLAGS($cf_cv_posix_c_source) fi fi # cf_cv_posix_visible ])dnl dnl --------------------------------------------------------------------------- dnl CF_POSIX_VISIBLE version: 1 updated: 2018/12/31 20:46:17 dnl ---------------- dnl POSIX documents test-macros which an application may set before any system dnl headers are included to make features available. dnl dnl Some BSD platforms (originally FreeBSD, but copied by a few others) dnl diverged from POSIX in 2002 by setting symbols which make all of the most dnl recent features visible in the system header files unless the application dnl overrides the corresponding test-macros. Doing that introduces portability dnl problems. dnl dnl This macro makes a special check for the symbols used for this, to avoid a dnl conflicting definition. AC_DEFUN([CF_POSIX_VISIBLE], [ AC_CACHE_CHECK(if the POSIX test-macros are already defined,cf_cv_posix_visible,[ AC_TRY_COMPILE([#include ],[ #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \ && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \ && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \ && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0) #error conflicting symbols found #endif ],[cf_cv_posix_visible=no],[cf_cv_posix_visible=yes]) ]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_CC version: 5 updated: 2019/12/31 08:53:54 dnl ---------- dnl standard check for CC, plus followup sanity checks dnl $1 = optional parameter to pass to AC_PROG_CC to specify compiler name AC_DEFUN([CF_PROG_CC],[ CF_ACVERSION_CHECK(2.53, [AC_MSG_WARN(this will incorrectly handle gnatgcc choice) AC_REQUIRE([AC_PROG_CC])], []) ifelse($1,,[AC_PROG_CC],[AC_PROG_CC($1)]) CF_GCC_VERSION CF_ACVERSION_CHECK(2.52, [AC_PROG_CC_STDC], [CF_ANSI_CC_REQD]) CF_CC_ENV_FLAGS ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_GROFF version: 3 updated: 2018/01/07 13:16:19 dnl ------------- dnl Check if groff is available, for cases (such as html output) where nroff dnl is not enough. AC_DEFUN([CF_PROG_GROFF],[ AC_PATH_PROG(GROFF_PATH,groff,no) AC_PATH_PROGS(NROFF_PATH,nroff mandoc,no) AC_PATH_PROG(TBL_PATH,tbl,cat) if test "x$GROFF_PATH" = xno then NROFF_NOTE= GROFF_NOTE="#" else NROFF_NOTE="#" GROFF_NOTE= fi AC_SUBST(GROFF_NOTE) AC_SUBST(NROFF_NOTE) ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_LINT version: 4 updated: 2019/11/20 18:55:37 dnl ------------ AC_DEFUN([CF_PROG_LINT], [ AC_CHECK_PROGS(LINT, lint cppcheck splint) case "x$LINT" in (xcppcheck|x*/cppcheck) test -z "$LINT_OPTS" && LINT_OPTS="--enable=all" ;; esac AC_SUBST(LINT_OPTS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_REGEX version: 12 updated: 2015/04/18 08:56:57 dnl -------- dnl Attempt to determine if we've got one of the flavors of regular-expression dnl code that we can support. AC_DEFUN([CF_REGEX], [ cf_regex_func=no cf_regex_libs="regex re" case $host_os in (mingw*) cf_regex_libs="gnurx $cf_regex_libs" ;; esac AC_CHECK_FUNC(regcomp,[cf_regex_func=regcomp],[ for cf_regex_lib in $cf_regex_libs do AC_CHECK_LIB($cf_regex_lib,regcomp,[ CF_ADD_LIB($cf_regex_lib) cf_regex_func=regcomp break]) done ]) if test "$cf_regex_func" = no ; then AC_CHECK_FUNC(compile,[cf_regex_func=compile],[ AC_CHECK_LIB(gen,compile,[ CF_ADD_LIB(gen) cf_regex_func=compile])]) fi if test "$cf_regex_func" = no ; then AC_MSG_WARN(cannot find regular expression library) fi AC_CACHE_CHECK(for regular-expression headers,cf_cv_regex_hdrs,[ cf_cv_regex_hdrs=no case $cf_regex_func in (compile) for cf_regex_hdr in regexp.h regexpr.h do AC_TRY_LINK([#include <$cf_regex_hdr>],[ char *p = compile("", "", "", 0); int x = step("", ""); ],[ cf_cv_regex_hdrs=$cf_regex_hdr break ]) done ;; (*) for cf_regex_hdr in regex.h do AC_TRY_LINK([#include #include <$cf_regex_hdr>],[ regex_t *p; int x = regcomp(p, "", 0); int y = regexec(p, "", 0, 0, 0); regfree(p); ],[ cf_cv_regex_hdrs=$cf_regex_hdr break ]) done ;; esac ]) case $cf_cv_regex_hdrs in (no) AC_MSG_WARN(no regular expression header found) ;; (regex.h) AC_DEFINE(HAVE_REGEX_H_FUNCS,1,[Define to 1 to include regex.h for regular expressions]) ;; (regexp.h) AC_DEFINE(HAVE_REGEXP_H_FUNCS,1,[Define to 1 to include regexp.h for regular expressions]) ;; (regexpr.h) AC_DEFINE(HAVE_REGEXPR_H_FUNCS,1,[Define to 1 to include regexpr.h for regular expressions]) ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50 dnl ---------------- dnl Remove all -U and -D options that refer to the given symbol from a list dnl of C compiler options. This works around the problem that not all dnl compilers process -U and -D options from left-to-right, so a -U option dnl cannot be used to cancel the effect of a preceding -D option. dnl dnl $1 = target (which could be the same as the source variable) dnl $2 = source (including '$') dnl $3 = symbol to remove define([CF_REMOVE_DEFINE], [ $1=`echo "$2" | \ sed -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[[ ]]/ /g' \ -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'` ])dnl dnl --------------------------------------------------------------------------- dnl CF_RESTORE_XTRA_FLAGS version: 1 updated: 2020/01/11 16:47:45 dnl --------------------- dnl Restore flags saved in CF_SAVE_XTRA_FLAGS dnl $1 = name of current macro define([CF_RESTORE_XTRA_FLAGS], [ LIBS="$cf_save_LIBS_$1" CFLAGS="$cf_save_CFLAGS_$1" CPPFLAGS="$cf_save_CPPFLAGS_$1" ])dnl dnl --------------------------------------------------------------------------- dnl CF_SAVE_XTRA_FLAGS version: 1 updated: 2020/01/11 16:46:44 dnl ------------------ dnl Use this macro to save CFLAGS/CPPFLAGS/LIBS before checks against X headers dnl and libraries which do not update those variables. dnl dnl $1 = name of current macro define([CF_SAVE_XTRA_FLAGS], [ cf_save_LIBS_$1="$LIBS" cf_save_CFLAGS_$1="$CFLAGS" cf_save_CPPFLAGS_$1="$CPPFLAGS" LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}" for cf_X_CFLAGS in $X_CFLAGS do case "x$cf_X_CFLAGS" in x-[[IUD]]*) CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS" ;; *) CFLAGS="$CFLAGS $cf_X_CFLAGS" ;; esac done ])dnl dnl --------------------------------------------------------------------------- dnl CF_SET_MATH_LIB_VERSION version: 1 updated: 2013/12/26 20:21:00 dnl ----------------------- dnl Check if math.h declares _LIB_VERSION, and if so, whether we can modify it dnl at runtime. Cygwin is known to be broken in this regard (late 2013). AC_DEFUN([CF_SET_MATH_LIB_VERSION],[ AC_CACHE_CHECK(if math.h declares _LIB_VERSION,cf_cv_get_math_lib_version,[ AC_TRY_LINK([ #include ], [int foo = _LIB_VERSION], [cf_cv_get_math_lib_version=yes], [cf_cv_get_math_lib_version=no]) ]) if test "x$cf_cv_get_math_lib_version" = xyes then AC_CACHE_CHECK(if we can update _LIB_VERSION,cf_cv_set_math_lib_version,[ AC_TRY_LINK([ #include ], [_LIB_VERSION = _IEEE_], [cf_cv_set_math_lib_version=yes], [cf_cv_set_math_lib_version=no]) ]) if test "x$cf_cv_set_math_lib_version" = xyes then AC_DEFINE(HAVE_MATH__LIB_VERSION,1,[Define to 1 if we can set math.h variable _LIB_VERSION]) else AC_MSG_WARN(this is probably due to a defect in your system headers) fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_SRAND version: 13 updated: 2016/09/05 12:39:46 dnl -------- dnl Check for functions similar to srand() and rand(). lrand48() and random() dnl return a 31-bit value, while rand() returns a value less than RAND_MAX dnl which usually is only 16-bits. dnl dnl On MirOS, use arc4random_push() and arc4random(). dnl Some systems support an asymmetric variation of this interface. dnl dnl $1 = optional prefix for resulting shell variables. The default "my_" dnl gives $my_srand and $my_rand to the caller, as well as MY_RAND_MAX. dnl These are all AC_SUBST'd and AC_DEFINE'd. AC_DEFUN([CF_SRAND],[ AC_CACHE_CHECK(for random-integer functions, cf_cv_srand_func,[ cf_cv_srand_func=unknown for cf_func in arc4random_push/arc4random arc4random_stir/arc4random srandom/random srand48/lrand48 srand/rand do CF_SRAND_PARSE($cf_func,cf_srand_func,cf_rand_func) AC_TRY_LINK([ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_LIMITS_H #include #endif ],[long seed = 1; $cf_srand_func(seed); seed = $cf_rand_func()], [cf_cv_srand_func=$cf_func break]) done ]) if test "$cf_cv_srand_func" != unknown ; then AC_CACHE_CHECK(for range of random-integers, cf_cv_rand_max,[ case $cf_cv_srand_func in (srand/rand) cf_cv_rand_max=RAND_MAX cf_rand_max=16 ;; (*/arc4random) cf_cv_rand_max=0xFFFFFFFFUL cf_rand_max=32 ;; (*) cf_cv_rand_max=INT_MAX cf_rand_max=31 ;; esac AC_TRY_COMPILE([ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_LIMITS_H #include #endif ],[long x = $cf_cv_rand_max],, [cf_cv_rand_max="(1UL<<$cf_rand_max)-1"]) ]) case $cf_cv_srand_func in (*/arc4random) AC_MSG_CHECKING(if should be included) AC_TRY_COMPILE([#include ], [void *arc4random(int); void *x = arc4random(1)], [cf_bsd_stdlib_h=no], [AC_TRY_COMPILE([#include ], [unsigned x = arc4random()], [cf_bsd_stdlib_h=yes], [cf_bsd_stdlib_h=no])]) AC_MSG_RESULT($cf_bsd_stdlib_h) if test "$cf_bsd_stdlib_h" = yes then AC_DEFINE(HAVE_BSD_STDLIB_H,1,[Define to 1 if bsd/stdlib.h header should be used]) else AC_MSG_CHECKING(if should be included) AC_TRY_COMPILE([#include ], [void *arc4random(int); void *x = arc4random(1)], [cf_bsd_random_h=no], [AC_TRY_COMPILE([#include ], [unsigned x = arc4random()], [cf_bsd_random_h=yes], [cf_bsd_random_h=no])]) AC_MSG_RESULT($cf_bsd_random_h) if test "$cf_bsd_random_h" = yes then AC_DEFINE(HAVE_BSD_RANDOM_H,1,[Define to 1 if bsd/random.h header should be used]) else AC_MSG_WARN(no header file found for arc4random) fi fi ;; esac CF_SRAND_PARSE($cf_func,cf_srand_func,cf_rand_func) CF_UPPER(cf_rand_max,ifelse($1,,my_,$1)rand_max) AC_DEFINE_UNQUOTED(ifelse($1,,my_,$1)srand,$cf_srand_func,[Define to the name for the srand function]) AC_DEFINE_UNQUOTED(ifelse($1,,my_,$1)rand, $cf_rand_func,[Define to the name for the rand function]) AC_DEFINE_UNQUOTED([$]cf_rand_max, $cf_cv_rand_max,[Define to the name for the RAND_MAX constant]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_SRAND_PARSE version: 2 updated: 2015/04/15 19:08:48 dnl -------------- dnl Parse the loop variable for CF_SRAND, with a workaround for asymmetric dnl variations. define([CF_SRAND_PARSE],[ $2=`echo $1 | sed -e 's%/.*%%'` $3=`echo $1 | sed -e 's%.*/%%'` case [$]$2 in (arc4random_stir) $2='(void)' ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_TRY_XOPEN_SOURCE version: 2 updated: 2018/06/20 20:23:13 dnl ------------------- dnl If _XOPEN_SOURCE is not defined in the compile environment, check if we dnl can define it successfully. AC_DEFUN([CF_TRY_XOPEN_SOURCE],[ AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[ AC_TRY_COMPILE([ #include #include #include ],[ #ifndef _XOPEN_SOURCE make an error #endif], [cf_cv_xopen_source=no], [cf_save="$CPPFLAGS" CF_APPEND_TEXT(CPPFLAGS,-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE) AC_TRY_COMPILE([ #include #include #include ],[ #ifdef _XOPEN_SOURCE make an error #endif], [cf_cv_xopen_source=no], [cf_cv_xopen_source=$cf_XOPEN_SOURCE]) CPPFLAGS="$cf_save" ]) ]) if test "$cf_cv_xopen_source" != no ; then CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE) CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE) cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" CF_ADD_CFLAGS($cf_temp_xopen_source) fi ]) dnl --------------------------------------------------------------------------- dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59 dnl -------- dnl Make an uppercase version of a variable dnl $1=uppercase($2) AC_DEFUN([CF_UPPER], [ $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` ])dnl dnl --------------------------------------------------------------------------- dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12 dnl ---------- dnl Use AC_VERBOSE w/o the warnings AC_DEFUN([CF_VERBOSE], [test -n "$verbose" && echo " $1" 1>&AC_FD_MSG CF_MSG_LOG([$1]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_DBMALLOC version: 7 updated: 2010/06/21 17:26:47 dnl ---------------- dnl Configure-option for dbmalloc. The optional parameter is used to override dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests. AC_DEFUN([CF_WITH_DBMALLOC],[ CF_NO_LEAKS_OPTION(dbmalloc, [ --with-dbmalloc test: use Conor Cahill's dbmalloc library], [USE_DBMALLOC]) if test "$with_dbmalloc" = yes ; then AC_CHECK_HEADER(dbmalloc.h, [AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse([$1],,[],[,$1]))]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_DMALLOC version: 7 updated: 2010/06/21 17:26:47 dnl --------------- dnl Configure-option for dmalloc. The optional parameter is used to override dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests. AC_DEFUN([CF_WITH_DMALLOC],[ CF_NO_LEAKS_OPTION(dmalloc, [ --with-dmalloc test: use Gray Watson's dmalloc library], [USE_DMALLOC]) if test "$with_dmalloc" = yes ; then AC_CHECK_HEADER(dmalloc.h, [AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse([$1],,[],[,$1]))]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_MAN2HTML version: 8 updated: 2018/06/27 18:44:03 dnl ---------------- dnl Check for man2html and groff. Prefer man2html over groff, but use groff dnl as a fallback. See dnl dnl http://invisible-island.net/scripts/man2html.html dnl dnl Generate a shell script which hides the differences between the two. dnl dnl We name that "man2html.tmp". dnl dnl The shell script can be removed later, e.g., using "make distclean". AC_DEFUN([CF_WITH_MAN2HTML],[ AC_REQUIRE([CF_PROG_GROFF]) case "x${with_man2html}" in (xno) cf_man2html=no ;; (x|xyes) AC_PATH_PROG(cf_man2html,man2html,no) case "x$cf_man2html" in (x/*) AC_MSG_CHECKING(for the modified Earl Hood script) if ( $cf_man2html -help 2>&1 | grep 'Make an index of headers at the end' >/dev/null ) then cf_man2html_ok=yes else cf_man2html=no cf_man2html_ok=no fi AC_MSG_RESULT($cf_man2html_ok) ;; (*) cf_man2html=no ;; esac esac AC_MSG_CHECKING(for program to convert manpage to html) AC_ARG_WITH(man2html, [ --with-man2html=XXX use XXX rather than groff], [cf_man2html=$withval], [cf_man2html=$cf_man2html]) cf_with_groff=no case $cf_man2html in (yes) AC_MSG_RESULT(man2html) AC_PATH_PROG(cf_man2html,man2html,no) ;; (no|groff|*/groff*) cf_with_groff=yes cf_man2html=$GROFF_PATH AC_MSG_RESULT($cf_man2html) ;; (*) AC_MSG_RESULT($cf_man2html) ;; esac MAN2HTML_TEMP="man2html.tmp" cat >$MAN2HTML_TEMP <>$MAN2HTML_TEMP <conftest.in <conftest.out cf_man2html_1st=`fgrep -n MARKER conftest.out |sed -e 's/^[[^0-9]]*://' -e 's/:.*//'` cf_man2html_top=`expr $cf_man2html_1st - 2` cf_man2html_bot=`wc -l conftest.out |sed -e 's/[[^0-9]]//g'` cf_man2html_bot=`expr $cf_man2html_bot - 2 - $cf_man2html_top` cf_man2html_top_bot="-topm=$cf_man2html_top -botm=$cf_man2html_bot" AC_MSG_RESULT($cf_man2html_top_bot) AC_MSG_CHECKING(for pagesize to use) for cf_block in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 do cat >>conftest.in <conftest.out cf_man2html_page=`fgrep -n HEAD1 conftest.out |sed -n '$p' |sed -e 's/^[[^0-9]]*://' -e 's/:.*//'` test -z "$cf_man2html_page" && cf_man2html_page=99999 test "$cf_man2html_page" -gt 100 && cf_man2html_page=99999 rm -rf conftest* AC_MSG_RESULT($cf_man2html_page) cat >>$MAN2HTML_TEMP < and other headers which use u_int / u_short types cf_XOPEN_SOURCE= CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) ;; (netbsd*) cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw ;; (openbsd[[4-9]]*) # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw cf_xopen_source="-D_BSD_SOURCE" cf_XOPEN_SOURCE=600 ;; (openbsd*) # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw ;; (osf[[45]]*) cf_xopen_source="-D_OSF_SOURCE" ;; (nto-qnx*) cf_xopen_source="-D_QNX_SOURCE" ;; (sco*) # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer ;; (solaris2.*) cf_xopen_source="-D__EXTENSIONS__" cf_cv_xopen_source=broken ;; (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2) cf_XOPEN_SOURCE= cf_POSIX_C_SOURCE= ;; (*) CF_TRY_XOPEN_SOURCE CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) ;; esac if test -n "$cf_xopen_source" ; then CF_ADD_CFLAGS($cf_xopen_source,true) fi dnl In anything but the default case, we may have system-specific setting dnl which is still not guaranteed to provide all of the entrypoints that dnl _XOPEN_SOURCE would yield. if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then AC_MSG_CHECKING(if _XOPEN_SOURCE really is set) AC_TRY_COMPILE([#include ],[ #ifndef _XOPEN_SOURCE make an error #endif], [cf_XOPEN_SOURCE_set=yes], [cf_XOPEN_SOURCE_set=no]) AC_MSG_RESULT($cf_XOPEN_SOURCE_set) if test $cf_XOPEN_SOURCE_set = yes then AC_TRY_COMPILE([#include ],[ #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE make an error #endif], [cf_XOPEN_SOURCE_set_ok=yes], [cf_XOPEN_SOURCE_set_ok=no]) if test $cf_XOPEN_SOURCE_set_ok = no then AC_MSG_WARN(_XOPEN_SOURCE is lower than requested) fi else CF_TRY_XOPEN_SOURCE fi fi fi # cf_cv_posix_visible ]) mawk-1.3.4-20200120/version.c0000644000175100001440000000312413604602732013715 0ustar tomusers/******************************************** version.c copyright 2008-2019,2020 Thomas E. Dickey copyright 1991-1996,2014 Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: version.c,v 1.27 2020/01/06 10:03:06 tom Exp $ */ #include "mawk.h" #include "init.h" #include "patchlev.h" #define VERSION_STRING \ "mawk %d.%d%s %s\n\ Copyright 2008-2019,2020, Thomas E. Dickey\n\ Copyright 1991-1996,2014, Michael D. Brennan\n\n" #define FMT_N "%-20s%.0f\n" #define FMT_S "%-20s%s\n" /* print VERSION and exit */ void print_version(void) { printf(VERSION_STRING, PATCH_BASE, PATCH_LEVEL, PATCH_STRING, DATE_STRING); fflush(stdout); #define SHOW_RANDOM "random-funcs:" #if defined(NAME_RANDOM) fprintf(stderr, FMT_S, SHOW_RANDOM, NAME_RANDOM); #else fprintf(stderr, FMT_S, SHOW_RANDOM, "internal"); #endif #define SHOW_REGEXP "regex-funcs:" #ifdef LOCAL_REGEXP fprintf(stderr, FMT_S, SHOW_REGEXP, "internal"); #else fprintf(stderr, FMT_S, SHOW_REGEXP, "external"); #endif fprintf(stderr, "compiled limits:\n"); fprintf(stderr, FMT_N, "sprintf buffer", (double) SPRINTF_LIMIT); fprintf(stderr, FMT_N, "maximum-integer", (double) MAX__INT); #if 0 /* we could show these, but for less benefit: */ fprintf(stderr, FMT_N, "maximum-unsigned", (double) MAX__UINT); fprintf(stderr, FMT_N, "maximum-long", (double) MAX__LONG); #endif mawk_exit(0); } mawk-1.3.4-20200120/install-sh0000755000175100001440000001572307762207755014116 0ustar tomusers#! /bin/sh # # install - install a program, script, or datafile # # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd=$cpprog shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "$0: no input file specified" >&2 exit 1 else : fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d "$dst" ]; then instcmd=: chmodcmd="" else instcmd=$mkdirprog fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f "$src" ] || [ -d "$src" ] then : else echo "$0: $src does not exist" >&2 exit 1 fi if [ x"$dst" = x ] then echo "$0: no destination specified" >&2 exit 1 else : fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d "$dst" ] then dst=$dst/`basename "$src"` else : fi fi ## this sed command emulates the dirname command dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` IFS=$oIFS pathcomp='' while [ $# -ne 0 ] ; do pathcomp=$pathcomp$1 shift if [ ! -d "$pathcomp" ] ; then $mkdirprog "$pathcomp" else : fi pathcomp=$pathcomp/ done fi if [ x"$dir_arg" != x ] then $doit $instcmd "$dst" && if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename "$dst"` else dstfile=`basename "$dst" $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename "$dst"` else : fi # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/#inst.$$# rmtmp=$dstdir/#rm.$$# # Trap to clean up temp files at exit. trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 trap '(exit $?); exit' 1 2 13 15 # Move or copy the file name to the temp name $doit $instcmd "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi && # Now remove or move aside any old file at destination location. We try this # two ways since rm can't unlink itself on some systems and the destination # file might be busy for other reasons. In this case, the final cleanup # might fail but the new file should still install successfully. { if [ -f "$dstdir/$dstfile" ] then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" fi && # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit } mawk-1.3.4-20200120/zmalloc.h0000644000175100001440000000171711500456220013674 0ustar tomusers/******************************************** zmalloc.h copyright 2009,2010, Thomas E. Dickey copyright 1991,1993, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: zmalloc.h,v 1.7 2010/12/10 17:00:00 tom Exp $ * @Log: zmalloc.h,v @ * Revision 1.2 1993/07/04 12:52:22 mike * start on autoconfig changes * * Revision 1.1.1.1 1993/07/03 18:58:23 mike * move source to cvs * * Revision 5.1 1991/12/05 07:59:41 brennan * 1.1 pre-release * */ /* zmalloc.h */ #ifndef ZMALLOC_H #define ZMALLOC_H #include "nstd.h" extern PTR zmalloc(size_t); extern void zfree(PTR, size_t); extern PTR zrealloc(PTR, size_t, size_t); #define ZMALLOC(type) ((type*)zmalloc(sizeof(type))) #define ZFREE(p) zfree(p,sizeof(*(p))) #endif /* ZMALLOC_H */ mawk-1.3.4-20200120/msdos/0000755000175100001440000000000012405413413013203 5ustar tomusersmawk-1.3.4-20200120/msdos/examples/0000755000175100001440000000000005415353355015034 5ustar tomusersmawk-1.3.4-20200120/msdos/examples/doslist.awk0000644000175100001440000000104105415353353017213 0ustar tomusers # print truncated DOS file names # from packing.list (packing.lis) # # mawk -f doslist.awk packing.lis # discard blanks and comments /^#/ || /^[ \t]*$/ {next} function dos_name(s, n, front, X) { #lowercase, split on extension and truncate pieces s = tolower(s) n = split(s, X, ".") front = substr(X[1],1,8) if ( n == 1 ) return front else return front "." substr(X[2], 1, 3) } { n = split($1, X, "/") new = dos_name(X[1]) for( i = 2 ; i <= n ; i++ ) new = new "\\" dos_name(X[i]) printf "%-30s%s\n", $1, new } mawk-1.3.4-20200120/msdos/examples/objstat.awk0000644000175100001440000000111205415353354017200 0ustar tomusers# Ben Myers <0003571400@mcimail.com> # Sum up sizes of OBJ files in current directory # A clumsy script to count OBJs and sum up their sizes # run with # bmawk -fobjsize.awk workfile # or similar command syntax with your awk program # where workfile is a work file BEGIN { # redirection done by shelled command system("dir *.obj >" ARGV[1]) osize = 0 # size accumulator ocount = 0 # obj counter } # Now read workfile back, skipping lines that are not files $2 == "OBJ" { osize += $3 ; ocount++ } END { print ocount " OBJs, total size " osize " bytes" system("del "ARGV[1]) } mawk-1.3.4-20200120/msdos/examples/shell.awk0000644000175100001440000000055705415353354016655 0ustar tomusers# Ben Myers <0003571400@mcimail.com> # Test pipes under DOS. comment/uncomment print statements below BEGIN { # redirection done by shelled command system("dir *.* /b >pippo.") lcount = 0 } { # print # Below is redirection done by mawk # print >"pippo2." print $0 | "sort" lcount++ } END { print "mawk NR line count=" NR " our line count=" lcount " lines in pippo"} mawk-1.3.4-20200120/msdos/examples/winexe.awk0000644000175100001440000000707105415353355017044 0ustar tomusers# Ben Myers <0003571400@mcimail.com> # Sum up segment sizes of all Windows EXEs in current directory # requires DOS 5.0 and Borland TDUMP # run with # awk -fwinexe.awk work1 # where work1 is a work file # You must have at least one filename as an arg, else awk will want to read # from con:, hence the requirement for work1 BEGIN { # redirection done by shelled command system("del workfile.$%$") # Will probably cause a File Not Found message # Generate a list of EXEs system("dir *.exe /b > workfile.$%$") while (getline < "workfile.$%$" > 0) { # TDUMP keeps on piping to the workfile system("tdump " $1 ">> " ARGV[1]) } module_name = "" # initialize # Now read workfile back, processing lines that: # 1. contain EXE file name # 2. contain segment type # Print EXE name and stats for each segment type processed # When there is a new EXE name, print summary for EXE just processed j = 1 while (getline < ARGV[1] > 0) { # module name if($1 == "Display" && $2 == "of" && $3 == "File") { # Print program summary for all but last program if(module_name != "") { Print_Summary() } otcount = 0 # text segment counter odcount = 0 # data segment counter otsize = 0 # text size accumulator odsize = 0 # data size accumulator module_name = $4 } # File Size if($1 == "DOS" && $2 == "File" && $3 == "Size") { # 6+ digit file size with leading left paren DOS_Size = substr($5,2,7) # file size < 6 digits if(DOS_Size == 0 || DOS_Size == "") { DOS_Size = $6 } } # CODE segment if($1 == "Segment" && $2 == "Type:" && $3 =="CODE") { decval = hexdec(substr($7,1,4)) otsize += decval # printf ("%12s CODE %4s %7u\n", module_name, $7, decval) otcount++ } # DATA segment if($1 == "Segment" && $2 == "Type:" && $3 =="DATA") { decval = hexdec(substr($7,1,4)) odsize += decval # printf ("%12s DATA %4s %7u\n", module_name, $7, decval) odcount++ } } # while } # end of BEGIN section # no main loop at all! END { # print record for last program Print_Summary() # delete work files system("del "ARGV[1]) system("del workfile.$%$") } # end of END section # No scanf in awk, so convert hex string x to decimal the hard way function hexdec (x) { result = 0 for (i=1; i<=length(x); i++) { thechar = substr(x,i,1) # digits 0-9 and lower case hex produced by TDUMP # use brute force if (thechar == "0") {result = result*16} if (thechar == "1") {result = result*16 + 1} if (thechar == "2") {result = result*16 + 2} if (thechar == "3") {result = result*16 + 3} if (thechar == "4") {result = result*16 + 4} if (thechar == "5") {result = result*16 + 5} if (thechar == "6") {result = result*16 + 6} if (thechar == "7") {result = result*16 + 7} if (thechar == "8") {result = result*16 + 8} if (thechar == "9") {result = result*16 + 9} if (thechar == "a") {result = result*16 + 10} if (thechar == "b") {result = result*16 + 11} if (thechar == "c") {result = result*16 + 12} if (thechar == "d") {result = result*16 + 13} if (thechar == "e") {result = result*16 + 14} if (thechar == "f") {result = result*16 + 15} if (thechar == "A") {result = result*16 + 10} if (thechar == "B") {result = result*16 + 11} if (thechar == "C") {result = result*16 + 12} if (thechar == "D") {result = result*16 + 13} if (thechar == "E") {result = result*16 + 14} if (thechar == "F") {result = result*16 + 15} } # for (i=1;i # Sum up number, line count, and sizes of SOURCE files in current directory # run with # bmawk -fsrcsize.awk workfile # or similar command syntax with your awk program # where workfile is a work file BEGIN { # redirection done by shelled command system("dir *.* >workfile") ssize = 0 # size accumulator slines = 0 # line counter scount = 0 # obj counter exit } END { # Now read workfile back in while (getline < "workfile" > 0) { if ($2 == "C" || $2 == "H" || $2 == "CPP" || $2 == "HPP") { filename = sprintf("%s.%s", $1, $2) ssize += $3 while (getline < filename > 0) {slines++} scount++ } } print scount " files, " slines " lines, total size " ssize " bytes" system("del workfile") } mawk-1.3.4-20200120/msdos/examples/srcstat.awk0000644000175100001440000000132305415353354017221 0ustar tomusers# Ben Myers <0003571400@mcimail.com> # Sum up number, line count, and sizes of SOURCE files in current directory # run with # bmawk -fsrcsize.awk workfile # or similar command syntax with your awk program # where workfile is a work file BEGIN { # redirection done by shelled command # system("dir *.* >workfile") system("dir *.* >" ARGV[1]) ssize = 0 # size accumulator slines = 0 # line counter scount = 0 # obj counter } # Now read workfile back in $2 == "C" || $2 == "H" || $2 == "CPP" || $2 == "HPP" { filename = sprintf("%s.%s", $1, $2) ssize += $3 while (getline < filename > 0) {slines++} scount++ } END { print scount " files, " slines " lines, total size " ssize " bytes" system("del " ARGV[1]) } mawk-1.3.4-20200120/msdos/examples/add_cr.awk0000644000175100001440000000312505415353353016753 0ustar tomusers # add_cr.awk # converts from Unix (LF only) text files to # DOS (CRLF) text files # # works on both unix and dos # if used on unix change COPY and DEL in BEGIN section # # mawk -f add_cr.awk [files] # with no files reads stdin writes stdout # otherwise the original is overwritten # # If a file of the form `@file', then arguments are read from # `file', one per line # # To add cr's to the whole distribution # # mawk -f doslist.awk packing.lis | mawk "{print $2}" > list # mawk -f add_cr.awk @list # # read arguments for @file into ARGV[] function reset_argv(T, i, j, flag, file) #all args local { for( i = 1 ; i < ARGC ; i++ ) { T[i] = ARGV[i] if ( T[i] ~ /^@/ ) flag = 1 } if ( ! flag ) return # need to read from a @file into ARGV j = 1 for( i = 1 ; i < ARGC ; i++ ) { if ( T[i] !~ /^@/ ) ARGV[j++] = T[i] else { T[i] = substr(T[i],2) # read arguments from T[i] while ( (getline file < T[i]) > 0 ) ARGV[j++] = file } } ARGC = j } BEGIN { COPY = "copy" # unix: "cp" DEL = "del" # unix: "rm" tmpfile = ENVIRON["MAWKTMPDIR"] "MAWK.TMP" reset_argv() } FILENAME == "-" { # just write to stdout printf "%s\r\n" , $0 next } FILENAME != filename { if ( filename ) { close(tmpfile) syscmd = sprintf( "%s %s %s", COPY, tmpfile, filename ) system(syscmd) } filename = FILENAME } { printf "%s\r\n" , $0 > tmpfile } END { if ( filename ) { close(tmpfile) syscmd = sprintf( "%s %s %s", COPY, tmpfile, filename ) system(syscmd) system(DEL " " tmpfile) } } mawk-1.3.4-20200120/msdos/examples/texttest.awk0000644000175100001440000000045305415353355017426 0ustar tomusers# Ben Myers <0003571400@mcimail.com> /^#include/ { # got #include, see if it has at least one quote. We don't want #include <> z = gsub(/"/, "", $2) while ((z > 0) && (getline x <$2 > 0)) # while (getline x <$2 > 0) print x next } { print } mawk-1.3.4-20200120/msdos/examples/winobj.awk0000644000175100001440000000532105415353355017031 0ustar tomusers# Ben Myers <0003571400@mcimail.com> # Sum up sizes of Windows OBJ files in current directory # requires DOS 5.0 and Borland TDUMP # A clumsy script to count Windows OBJs and sum up the CODE sizes # run with # awk -fwinobj.awk work1 # where work1 is a work file # You must have at least one filename as an arg, else awk will want to read # from con:, hence the requirement for work1 BEGIN { # redirection done by shelled command ocount = 0 # obj module counter otsize = 0 # text size accumulator odsize = 0 # data size accumulator system("del workfile.$%$") # Will probably cause a File Not Found message # Generate a list of OBJs system("dir *.obj /b >" ARGV[1]) while (getline < ARGV[1] > 0) { # TDUMP selects only the SEGDEFs to speed things up a lot # and keeps on piping to the workfile system("tdump " $1 " -oiSEGDEF >>workfile.$%$") ocount++ } # Now read workfile back, processing lines that are module ids and SEGDEF info # Print one line for each SEGDEF processed j = 1 while (getline < "workfile.$%$" > 0) { # module name if($1 == "Display" && $2 == "of" && $3 == "File") { module_name = $4 } # SEGDEF CODE if($2 == "SEGDEF" && $9 =="'CODE'") { decval = hexdec($11) otsize += decval printf ("%12s CODE %4s %7i\n", module_name, $11, decval) j++ } # SEGDEF DATA if($2 == "SEGDEF" && $9 =="'DATA'") { decval = hexdec($11) odsize += decval printf ("%12s DATA %4s %7i\n", module_name, $11, decval) j++ } } # while } # end of BEGIN section # no main loop at all! END { # print summary and delete work files printf ("%i OBJ files\n", ocount) printf ("Total CODE size %04x %7li bytes\n", otsize, otsize) printf ("Total DATA size %04x %7li bytes\n", odsize, odsize) system("del "ARGV[1]) system("del workfile.$%$") } # end of END section # No scanf in awk, so convert hex string x to decimal the hard way function hexdec (x) { result = 0 for (i=1; i<=length(x); i++) { thechar = substr(x,i,1) # digits 0-9 and lower case hex produced by TDUMP # use brute force if (thechar == "0") {result = result*16} if (thechar == "1") {result = result*16 + 1} if (thechar == "2") {result = result*16 + 2} if (thechar == "3") {result = result*16 + 3} if (thechar == "4") {result = result*16 + 4} if (thechar == "5") {result = result*16 + 5} if (thechar == "6") {result = result*16 + 6} if (thechar == "7") {result = result*16 + 7} if (thechar == "8") {result = result*16 + 8} if (thechar == "9") {result = result*16 + 9} if (thechar == "a") {result = result*16 + 10} if (thechar == "b") {result = result*16 + 11} if (thechar == "c") {result = result*16 + 12} if (thechar == "d") {result = result*16 + 13} if (thechar == "e") {result = result*16 + 14} if (thechar == "f") {result = result*16 + 15} } # for (i=1;i /* isatty() */ #endif /* CONFIG_H */ mawk-1.3.4-20200120/msdos/vs2008.mak0000644000175100001440000001246012405413413014642 0ustar tomusers# $MawkId: vs2008.mak,v 1.1 2014/09/14 22:30:35 tom Exp $ # Microsoft C makefile for mawk using Visual Studio 2008 and nmake. # ############################################################################### # copyright 2014 Thomas E. Dickey # # This is a source file for mawk, an implementation of # the AWK programming language. # # Mawk is distributed without warranty under the terms of # the GNU General Public License, version 2, 1991. ############################################################################### !include #======================================================================== CFLAGS = -I. -D_POSIX_ -DWINVER=0x501 -DLOCAL_REGEXP $(cflags) .c.obj: $(CC) $(CFLAGS) -c $< OBJ1 = parse.obj array.obj bi_funct.obj bi_vars.obj cast.obj code.obj \ da.obj error.obj execute.obj fcall.obj OBJ2 = field.obj files.obj fin.obj hash.obj jmp.obj init.obj \ kw.obj main.obj matherr.obj OBJ3 = memory.obj print.obj re_cmpl.obj scan.obj scancode.obj split.obj \ zmalloc.obj version.obj regexp.obj dosexec.obj MAWK_OBJ = $(OBJ1) $(OBJ2) $(OBJ3) mawk.exe : $(MAWK_OBJ) $(link) $(LDFLAGS) $(MAWK_OBJ) $(LIBS) -out:mawk.exe -map:mawk.map $(MAWK_OBJ) : config.h config.h : msdos/vs2008.h copy msdos\vs2008.h config.h dosexec.c : msdos/dosexec.c copy msdos\dosexec.c dosexec.c mawk_test : mawk.exe # test that we have a sane mawk @echo you may have to run the test manually cd test && mawktest.bat fpe_test : mawk.exe # test FPEs are handled OK @echo testing floating point exception handling @echo you may have to run the test manually cd test && fpe_test.bat check : mawk_test fpe_test ################################################### # FIXME # parse.c is provided # so you don't need to make it. # # But if you do: here's how: # To make it with byacc # YACC=byacc # parse.c : parse.y # $(YACC) -d parse.y # rename y_tab.h parse.h # rename y_tab.c parse.c ######################################## scancode.c : makescan.c scan.h $(CC) $(CFLAGS) makescan.c $(link) $(LDFLAGS) makescan.obj $(LIBS) -out:makescan.exe -map:makescan.map makescan.exe > scancode.c del makescan.exe clean : -del *.bak -del *.exe -del *.ilk -del *.map -del *.pdb -del *.obj distclean : clean -del dosexec.c -del scancode.c -del config.h # dependencies of .objs on .h array.o : symtype.h split.h sizes.h mawk.h config.h types.h nstd.h bi_vars.h zmalloc.h memory.h field.h bi_vars.o : symtype.h sizes.h mawk.h config.h types.h init.h nstd.h bi_vars.h zmalloc.h memory.h field.h cast.o : scancode.h parse.h symtype.h sizes.h mawk.h config.h types.h nstd.h repl.h zmalloc.h scan.h memory.h field.h code.o : scancode.h parse.h symtype.h sizes.h mawk.h config.h types.h init.h nstd.h repl.h jmp.h zmalloc.h scan.h code.h memory.h field.h da.o : symtype.h sizes.h mawk.h config.h types.h nstd.h repl.h zmalloc.h code.h bi_funct.h memory.h field.h execute.o : symtype.h sizes.h mawk.h config.h fin.h types.h regexp.h nstd.h repl.h bi_vars.h zmalloc.h code.h bi_funct.h files.h memory.h field.h fcall.o : symtype.h sizes.h mawk.h config.h types.h nstd.h zmalloc.h code.h memory.h field.o : scancode.h parse.h symtype.h split.h sizes.h mawk.h config.h types.h init.h regexp.h nstd.h repl.h bi_vars.h zmalloc.h scan.h memory.h field.h files.o : symtype.h sizes.h mawk.h config.h fin.h types.h init.h nstd.h zmalloc.h files.h memory.h fin.o : scancode.h parse.h symtype.h sizes.h mawk.h config.h types.h fin.h nstd.h bi_vars.h zmalloc.h scan.h memory.h field.h hash.o : symtype.h sizes.h mawk.h config.h types.h nstd.h bi_vars.h zmalloc.h memory.h jmp.o : symtype.h sizes.h mawk.h config.h types.h init.h nstd.h jmp.h zmalloc.h code.h memory.h kw.o : symtype.h parse.h sizes.h mawk.h config.h types.h init.h nstd.h main.o : symtype.h sizes.h mawk.h config.h types.h init.h nstd.h bi_vars.h zmalloc.h code.h files.h memory.h makescan.o : scancode.h nstd.h matherr.o : symtype.h sizes.h mawk.h config.h types.h init.h nstd.h memory.o : sizes.h mawk.h config.h types.h nstd.h zmalloc.h memory.h parse.o : symtype.h sizes.h mawk.h config.h types.h nstd.h bi_vars.h jmp.h zmalloc.h code.h bi_funct.h files.h memory.h field.h print.o : scancode.h symtype.h parse.h sizes.h mawk.h config.h types.h init.h nstd.h bi_vars.h zmalloc.h scan.h bi_funct.h files.h memory.h field.h re_cmpl.o : scancode.h parse.h symtype.h sizes.h mawk.h config.h types.h regexp.h nstd.h repl.h zmalloc.h scan.h memory.h regexp_system.o : regexp.h nstd.h rexp.o : sizes.h config.h types.h regexp.h rexp.h nstd.h rexp0.o : sizes.h config.h types.h rexp.h nstd.h rexp1.o : sizes.h config.h types.h rexp.h nstd.h rexp2.o : sizes.h config.h types.h rexp.h nstd.h rexp3.o : sizes.h config.h types.h rexp.h nstd.h rexp4.o : sizes.h mawk.h config.h types.h rexp.h nstd.h field.h rexpdb.o : sizes.h config.h types.h rexp.h nstd.h scan.o : scancode.h symtype.h parse.h sizes.h mawk.h config.h types.h fin.h init.h nstd.h repl.h zmalloc.h scan.h code.h files.h memory.h field.h scancode.o : scancode.h split.o : scancode.h parse.h symtype.h split.h sizes.h mawk.h config.h types.h regexp.h nstd.h repl.h bi_vars.h zmalloc.h scan.h bi_funct.h memory.h field.h version.o : symtype.h sizes.h mawk.h config.h types.h init.h nstd.h patchlev.h zmalloc.o : sizes.h mawk.h config.h types.h nstd.h zmalloc.h mawk-1.3.4-20200120/msdos/dosexec.c0000644000175100001440000000726012405413335015011 0ustar tomusers/******************************************** dosexec.c copyright 2009,2010,2014, Thomas E. Dickey copyright 1991-1994,1995, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: dosexec.c,v 1.5 2014/09/14 22:29:49 tom Exp $ * * @Log: dosexec.c,v @ * Revision 1.3 1995/08/20 16:37:22 mike * exit(1) -> exit(2) * * Revision 1.2 1994/10/08 18:50:03 mike * remove SM_DOS * * Revision 1.1.1.1 1993/07/03 18:58:47 mike * move source to cvs * * Revision 1.4 1992/12/05 22:29:43 mike * dos patch 112d: * don't use string_buff * check COMSPEC * * Revision 1.3 1992/07/10 16:21:57 brennan * store exit code of input pipes * * Revision 1.2 1991/11/16 10:27:18 brennan * BINMODE * * Revision 1.1 91/10/29 09:45:56 brennan * Initial revision */ /* system() and pipes() for MSDOS and Win32 console */ #include "mawk.h" #if defined(MSDOS) || defined(_WINNT) #include "memory.h" #include "files.h" #include "fin.h" #undef _POSIX_ #include #ifndef P_WAIT #define P_WAIT _P_WAIT /* works with VS2008 */ #endif static char *my_shell; /* e.g. "c:\\sys\\command.com" */ static char *command_opt; /* " /c" */ static void get_shell(void) { char *s, *p; int len; if ((s = getenv("MAWKSHELL")) != 0) { /* break into shell part and option part */ p = s; while (*p != ' ' && *p != '\t') p++; len = p - s; my_shell = (char *) zmalloc(len + 1); memcpy(my_shell, s, len); my_shell[len] = 0; command_opt = p; } else if ((s = getenv("COMSPEC")) != 0) { my_shell = s; command_opt = " /c"; /* leading space needed because of bug in command.com */ } else { errmsg(0, "cannot exec(), must set MAWKSHELL or COMSPEC in environment"); exit(2); } } int DOSexec(char *command) { char xbuff[256]; if (!my_shell) get_shell(); sprintf(xbuff, "%s %s", command_opt, command); fflush(stderr); fflush(stdout); return spawnl(P_WAIT, my_shell, my_shell, xbuff, (char *) 0); } static int next_tmp; /* index for naming temp files */ static char *tmpdir; /* directory to hold temp files */ static unsigned mawkid; /* unique to this mawk process */ /* compute the unique temp file name associated with id */ char * tmp_file_name(int id, char *buffer) { if (mawkid == 0) { /* first time */ union { void *ptr; unsigned w[2]; } xptr; memset(&xptr, 0, sizeof(xptr)); xptr.ptr = (void *) &mawkid; mawkid = xptr.w[1]; tmpdir = getenv("MAWKTMPDIR"); if (!tmpdir || strlen(tmpdir) > 80) tmpdir = ""; } (void) sprintf(buffer, "%sMAWK%04X.%03X", tmpdir, mawkid, id); return buffer; } /* open a pipe, returning a temp file identifier by reference */ PTR get_pipe(char *command, int type, int *tmp_idp) { PTR retval; char xbuff[256]; char *tmpname; *tmp_idp = next_tmp; tmpname = tmp_file_name(next_tmp, xbuff + 163); if (type == PIPE_OUT) { retval = (PTR) fopen(tmpname, (binmode() & 2) ? "wb" : "w"); } else { sprintf(xbuff, "%s > %s", command, tmpname); tmp_idp[1] = DOSexec(xbuff); retval = (PTR) FINopen(tmpname, 0); } next_tmp++; return retval; } /* closing a fake pipes involves running the out pipe command */ int close_fake_outpipe(char *command, int tid) /* identifies the temp file */ { char xbuff[256]; char *tmpname = tmp_file_name(tid, xbuff + 163); int retval; sprintf(xbuff, "%s < %s", command, tmpname); retval = DOSexec(xbuff); (void) unlink(tmpname); return retval; } #endif /* MSDOS */ mawk-1.3.4-20200120/mawk.h0000644000175100001440000001457713611333033013203 0ustar tomusers/******************************************** mawk.h copyright 2008-2019,2020 Thomas E. Dickey copyright 1991-1995,1996 Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: mawk.h,v 1.55 2020/01/20 14:15:55 tom Exp $ */ /* mawk.h */ #ifndef MAWK_H #define MAWK_H #include "nstd.h" #include #include #ifdef HAVE_UNISTD_H #include #endif #include #include "types.h" #ifndef GCC_NORETURN #define GCC_NORETURN /* nothing */ #endif #ifndef GCC_PRINTFLIKE #define GCC_PRINTFLIKE(fmt,var) /* nothing */ #endif #ifndef GCC_UNUSED #define GCC_UNUSED /* nothing */ #endif #if defined(__GNUC__) && defined(_FORTIFY_SOURCE) #define IGNORE_RC(func) ignore_unused = (int) func extern int ignore_unused; #else #define IGNORE_RC(func) (void) func #endif /* gcc workarounds */ #ifdef DEBUG #define YYDEBUG 1 extern int yydebug; /* print parse if on */ extern int dump_RE; #endif #if defined(MSDOS) || defined(__MINGW32__) || defined(_WINNT) #define USE_BINMODE 1 #else #define USE_BINMODE 0 #endif extern short posix_space_flag, interactive_flag; /*---------------- * GLOBAL VARIABLES *----------------*/ /* a well known string */ extern STRING null_str; /* a useful scratch area */ extern char string_buff[SPRINTF_LIMIT]; /* help with casts */ extern const int mpow2[]; /* these are used by the parser, scanner and error messages from the compile */ extern char *pfile_name; /* program input file */ extern int current_token; extern unsigned token_lineno; /* lineno of current token */ extern unsigned compile_error_count; extern int NR_flag; extern int paren_cnt; extern int brace_cnt; extern int print_flag, getline_flag; extern short mawk_state; #define EXECUTION 1 /* other state is 0 compiling */ #ifdef LOCALE extern char decimal_dot; #endif extern const char *progname; /* for error messages */ extern unsigned rt_nr, rt_fnr; /* ditto */ /* macro to test the type of two adjacent cells */ #define TEST2(cp) (mpow2[(cp)->type]+mpow2[((cp)+1)->type]) /* macro to get at the string part of a CELL */ #define string(cp) ((STRING *)(cp)->ptr) #ifdef DEBUG #define cell_destroy(cp) DB_cell_destroy(cp) #else /* Note: type is only C_STRING to C_MBSTRN */ #define cell_destroy(cp) \ do { \ if ( (cp)->type >= C_STRING && \ (cp)->type <= C_MBSTRN ) { \ free_STRING(string(cp)); \ } \ } while (0) #endif /* prototypes */ extern void cast1_to_s(CELL *); extern void cast1_to_d(CELL *); extern void cast2_to_s(CELL *); extern void cast2_to_d(CELL *); extern void cast_to_RE(CELL *); extern void cast_for_split(CELL *); extern void check_strnum(CELL *); extern void cast_to_REPL(CELL *); extern Int d_to_I(double); extern UInt d_to_U(double d); #define d_to_i(d) ((int)d_to_I(d)) extern int test(CELL *); /* test for null non-null */ extern CELL *cellcpy(CELL *, CELL *); extern CELL *repl_cpy(CELL *, CELL *); extern void DB_cell_destroy(CELL *); extern void overflow(const char *, unsigned); extern void rt_overflow(const char *, unsigned); extern void rt_error(const char *,...) GCC_NORETURN GCC_PRINTFLIKE(1,2); extern void mawk_exit(int) GCC_NORETURN; extern void da(INST *, FILE *); extern INST *da_this(INST *, INST *, FILE *); extern char *rm_escape(char *, size_t *); extern char *re_pos_match(char *, size_t, PTR, size_t *, int); extern int binmode(void); #ifndef REXP_H extern char *str_str(char *, size_t, const char *, size_t); #endif extern void parse(void); extern void scan_cleanup(void); #ifndef YYBYACC extern int yylex(void); #endif extern void yyerror(const char *); extern void bozo(const char *) GCC_NORETURN; extern void errmsg(int, const char *,...) GCC_PRINTFLIKE(2,3); extern void compile_error(const char *,...) GCC_PRINTFLIKE(1,2); extern void execute(INST *, CELL *, CELL *); extern const char *find_kw_str(int); extern void da_string(FILE *fp, const char *, size_t); #ifdef HAVE_STRTOD_OVF_BUG extern double strtod_with_ovf_bug(const char *, char **); #define strtod strtod_with_ovf_bug #endif #if OPT_TRACE > 0 extern void Trace(const char *,...) GCC_PRINTFLIKE(1,2); extern void TraceVA(const char *, va_list); #define TRACE(params) Trace params #if OPT_TRACE > 1 #define TRACE2(params) Trace params #endif #endif #ifndef TRACE #define TRACE(params) /* nothing */ #endif #ifndef TRACE2 #define TRACE2(params) /* nothing */ #endif #if OPT_TRACE > 0 extern void TraceCell(CELL *); extern void TraceString(STRING *); extern void TraceString2(const char *, size_t); #define TRACE_CELL(cp) TraceCell(cp) #define TRACE_STRING(cp) TraceString(cp) #define TRACE_STRING2(str,len) TraceString2(str,len) #else #define TRACE_CELL(cp) /* nothing */ #define TRACE_STRING(cp) /* nothing */ #define TRACE_STRING2(str,len) /* nothing */ #endif #if OPT_TRACE > 0 extern void TraceFunc(const char *, CELL *); #define TRACE_FUNC(name,cp) TraceFunc(name,cp) #else #define TRACE_FUNC(name,cp) /* nothing */ #endif #if OPT_TRACE > 0 extern void TraceInst(INST *, INST *); #define TRACE_INST(cp,base) TraceInst(cp,base) #else #define TRACE_INST(cp,base) /* nothing */ #endif #if OPT_TRACE > 0 extern const char *da_type_name(CELL *); extern const char *da_op_name(INST *); #endif #ifdef NO_LEAKS extern void free_cell_data(CELL *); extern void free_codes(const char *, INST *, size_t); extern void no_leaks_cell(CELL *); extern void no_leaks_cell_ptr(CELL *); extern void no_leaks_re_ptr(PTR); extern void array_leaks(void); extern void bi_vars_leaks(void); extern void cell_leaks(void); extern void code_leaks(void); extern void field_leaks(void); extern void files_leaks(void); extern void fin_leaks(void); extern void hash_leaks(void); extern void re_leaks(void); extern void rexp_leaks(void); extern void scan_leaks(void); extern void trace_leaks(void); extern void zmalloc_leaks(void); #else #define free_codes(tag, base, size) zfree(base, size) #define no_leaks_cell(ptr) /* nothing */ #define no_leaks_cell_ptr(ptr) /* nothing */ #define no_leaks_re_ptr(ptr) /* nothing */ #endif /* * Sometimes split_buff[] pointers are moved rather than copied. * Optimize-out the assignment to clear the pointer in the array. */ #ifdef NO_LEAKS #define USED_SPLIT_BUFF(n) split_buff[n] = 0 #else #define USED_SPLIT_BUFF(n) /* nothing */ #endif #endif /* MAWK_H */ mawk-1.3.4-20200120/fin.h0000644000175100001440000000307012404713526013012 0ustar tomusers/******************************************** fin.h copyright 2009-2010,2014 Thomas E. Dickey copyright 1991-1992,1993, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: fin.h,v 1.13 2014/09/13 01:01:10 tom Exp $ * @Log: fin.h,v @ * Revision 1.1.1.1 1993/07/03 18:58:13 mike * move source to cvs * * Revision 5.2 1992/01/06 08:16:24 brennan * setmode() proto for MSDOS * * Revision 5.1 91/12/05 07:59:20 brennan * 1.1 pre-release * */ /* fin.h */ #ifndef FIN_H #define FIN_H #include /* structure to control input files */ typedef struct { int fd; /* file-descriptor */ FILE *fp; /* NULL unless interactive */ char *buff; /* base of data read from file */ char *buffp; /* current position to read-next */ char *limit; /* points past the data in *buff */ unsigned nbuffs; /* sizeof *buff in BUFFSZs */ int flags; } FIN; #define MAIN_FLAG 1 /* part of main input stream if on */ #define EOF_FLAG 2 #define START_FLAG 4 /* used when RS == "" */ #define FIN_FLAG 8 /* set if fin->buff is no longer beginning */ FIN *FINdopen(int, int); FIN *FINopen(char *, int); void FINclose(FIN *); void FINsemi_close(FIN *); char *FINgets(FIN *, size_t *); size_t fillbuff(int, char *, size_t); extern FIN *main_fin; /* for the main input stream */ void open_main(void); #endif /* FIN_H */ mawk-1.3.4-20200120/README0000644000175100001440000000650213423732371012751 0ustar tomusers-- $MawkId: README,v 1.6 2019/01/29 02:05:45 tom Exp $ -- vile:txtmode fc=78 mawk -- an implementation of new/posix awk version 1.3.4 Generic installation instructions are in file INSTALL. This file gives more specific information. Send bug reports, comments, questions, etc. to Thomas E. Dickey https://invisible-island.net/mawk/ ftp://ftp.invisible-island.net/mawk/ ------------------------------------------------------------------------------- Portability: ----------- This program builds/runs on several POSIX-style platforms. It has been recently tested for these: AIX (5.1 and 5.3, using cc and gcc) Cygwin (1.5.21 on Windows/XP) FreeBSD (6.0) HPUX (10.20, 11.00, 11.11 and 11.23, using cc and gcc) IRIX64 (using cc and gcc) Linux (several flavors, using gcc and icc) MinGW/MSYS (on Windows/XP) OpenBSD (4.1) Solaris (2.6 to 10, using cc and gcc) Tru64 (4.0D and 5.1, using cc and gcc) Options: ------- The configure script has these application-specific options: --disable-echo display "compiling" commands Show "compiling foo.c" rather than the full compiler and options. Those are clutter useful only to a developer. Developers focus on compiler warnings anyway. --enable-warnings test: turn on gcc compiler warnings This turns on the usual gcc compiler warnings needed to do useful development. If you happen to be using the Intel compiler icc, it does the right thing for that. --with-builtin-regex use mawk's own regular-expressions engine Normally mawk's configure script uses the built-in regular expressions. The choice of default is based on where the greatest lossage occurs. More scripts use gawk's null-character extension than use POSIX brace expressions. If your needs are different, build mawk using an external library. Limitations: ----------- mawk 1.3.3 was developed to correspond with a POSIX draft. POSIX continued, and incorporated some of mawk's extensions as features. The 1.3.4 release fills in the major areas in which POSIX grew past the mawk 1.3.3 implementation. mawk's built-in regular expression engine does not yet support brace expressions, e.g., /a{,4}/ Use an external regular expression library if you require brace expressions. Aside from that, mawk's built-in regular expressions provide POSIX functionality. Using an external regular expression library means that mawk cannot match expressions containing the null character. That is a nonstandard feature provided by gawk. Using mawk's built-in regular expressions, there is some support for this feature. Aside from supporting nulls, using an external regular expression library is usually advantageous. The Cygwin math library has some problems (which are also visible in the gawk port). For instance, its log() function returns Inf (infinity) for log(-8) rather than NaN (not a number) as all of the Unix and similar platforms would do. The MSYS package for regular expressions is unusable as an external library for mawk because it generates a runtime error when asked to compile a newline, e.g., "\n". mawk does this during initialization. The MinGW/MSYS port does not currently support pipes. There is source-code from the obsolete MS-DOS port which can be reused for this purpose; however that is not the focus of the 1.3.4 release. mawk-1.3.4-20200120/parse.h0000644000175100001440000000362412773320635013361 0ustar tomusers#define UNEXPECTED 257 #define BAD_DECIMAL 258 #define NL 259 #define SEMI_COLON 260 #define LBRACE 261 #define RBRACE 262 #define LBOX 263 #define RBOX 264 #define COMMA 265 #define IO_OUT 266 #define ASSIGN 267 #define ADD_ASG 268 #define SUB_ASG 269 #define MUL_ASG 270 #define DIV_ASG 271 #define MOD_ASG 272 #define POW_ASG 273 #define QMARK 274 #define COLON 275 #define OR 276 #define AND 277 #define IN 278 #define MATCH 279 #define EQ 280 #define NEQ 281 #define LT 282 #define LTE 283 #define GT 284 #define GTE 285 #define CAT 286 #define GETLINE 287 #define PLUS 288 #define MINUS 289 #define MUL 290 #define DIV 291 #define MOD 292 #define NOT 293 #define UMINUS 294 #define IO_IN 295 #define PIPE 296 #define POW 297 #define INC_or_DEC 298 #define DOLLAR 299 #define FIELD 300 #define LPAREN 301 #define RPAREN 302 #define DOUBLE 303 #define STRING_ 304 #define RE 305 #define ID 306 #define D_ID 307 #define FUNCT_ID 308 #define BUILTIN 309 #define LENGTH 310 #define PRINT 311 #define PRINTF 312 #define SPLIT 313 #define MATCH_FUNC 314 #define SUB 315 #define GSUB 316 #define DO 317 #define WHILE 318 #define FOR 319 #define BREAK 320 #define CONTINUE 321 #define IF 322 #define ELSE 323 #define DELETE 324 #define BEGIN 325 #define END 326 #define EXIT 327 #define NEXT 328 #define NEXTFILE 329 #define RETURN 330 #define FUNCTION 331 #ifdef YYSTYPE #undef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #endif #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 typedef union{ CELL *cp ; SYMTAB *stp ; int start ; /* code starting address as offset from code_base */ PF_CP fp ; /* ptr to a (print/printf) or (sub/gsub) function */ const BI_REC *bip ; /* ptr to info about a builtin */ FBLOCK *fbp ; /* ptr to a function block */ ARG2_REC *arg2p ; CA_REC *ca_p ; int ival ; PTR ptr ; } YYSTYPE; #endif /* !YYSTYPE_IS_DECLARED */ extern YYSTYPE yylval; mawk-1.3.4-20200120/repl.h0000644000175100001440000000251212405400260013165 0ustar tomusers/******************************************** repl.h copyright 2009-2010,2014, Thomas E. Dickey copyright 1991,1993, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: repl.h,v 1.8 2014/09/14 20:55:12 tom Exp $ * @Log: repl.h,v @ * Revision 1.1.1.1 1993/07/03 18:58:19 mike * move source to cvs * * Revision 5.1 1991/12/05 07:59:32 brennan * 1.1 pre-release * */ /* repl.h */ #ifndef REPL_H #define REPL_H #include "types.h" typedef struct re_data { int anchored; /* use to limit recursion in gsub */ int is_empty; /* check if pattern is empty */ PTR compiled; } RE_DATA; /* * re_compile returns a RE_DATA*, but mawk handles it as a PTR thereafter. */ #define isAnchored(ptr) (((RE_DATA *)(ptr))->anchored) #define isEmpty_RE(ptr) (((RE_DATA *)(ptr))->is_empty) #define cast_to_re(ptr) (((RE_DATA *)(ptr))->compiled) #define refRE_DATA(re) ((PTR) &(re)) PTR re_compile(STRING *); char *re_uncompile(PTR); CELL *repl_compile(STRING *); char *repl_uncompile(CELL *); void re_destroy(PTR); void repl_destroy(CELL *); CELL *replv_cpy(CELL *, CELL *); CELL *replv_to_repl(CELL *, STRING *); #endif mawk-1.3.4-20200120/nstd.h0000644000175100001440000000314213171255223013203 0ustar tomusers/******************************************** nstd.h copyright 2009-2012,2017 Thomas E. Dickey copyright 1995, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* Never Standard.h This has all the prototypes that are supposed to be in a standard place but never are, and when they are the standard place isn't standard */ /* * $MawkId: nstd.h,v 1.11 2017/10/17 01:19:15 tom Exp $ * @Log: nstd.h,v @ * Revision 1.6 1995/06/18 19:42:22 mike * Remove some redundant declarations and add some prototypes * * Revision 1.5 1995/04/20 20:26:56 mike * beta improvements from Carl Mascott * * Revision 1.4 1994/12/11 22:08:24 mike * add STDC_MATHERR * * Revision 1.3 1993/07/15 23:56:09 mike * general cleanup * * Revision 1.2 1993/07/07 00:07:43 mike * more work on 1.2 * * Revision 1.1 1993/07/04 12:38:06 mike * Initial revision * */ #ifndef NSTD_H #define NSTD_H 1 #include /* types */ typedef void *PTR; #ifdef SIZE_T_STDDEF_H #include #else #ifdef SIZE_T_TYPES_H #include #else typedef unsigned size_t; #endif #endif #include #include #include #include /* if have to diddle with errno to get errors from the math library */ #ifndef STDC_MATHERR #if (defined(FPE_TRAPS_ON) && !defined(HAVE_MATHERR)) #define STDC_MATHERR 1 #else #define STDC_MATHERR 0 #endif #endif #endif /* NSTD_H */ mawk-1.3.4-20200120/fpe_check.c0000644000175100001440000001223112257146613014142 0ustar tomusers/******************************************** fpe_check.c copyright 2008-2010,2013 Thomas E. Dickey copyright 1996, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* This code attempts to figure out what the default floating point exception handling does. */ /* * $MawkId: fpe_check.c,v 1.16 2013/12/27 00:44:59 tom Exp $ * @Log: fpe_check.c,v @ * Revision 1.7 1996/08/30 00:07:14 mike * Modifications to the test and implementation of the bug fix for * solaris overflow in strtod. * * Revision 1.6 1996/08/25 19:25:46 mike * Added test for solaris strtod overflow bug. * * Revision 1.5 1996/08/11 22:10:39 mike * Some systems blow the !(d==d) test for a NAN. Added a work around. * * Revision 1.4 1995/01/09 01:22:28 mike * check sig handler ret type to make fpe_check.c more robust * * Revision 1.3 1994/12/18 20:54:00 mike * check NetBSD mathlib defines * * Revision 1.2 1994/12/14 14:37:26 mike * add messages to user * */ #include #include #include #include #include #include #ifdef HAVE_SIGINFO_H #include #endif #ifdef HAVE_SIGACTION_SA_SIGACTION #define FPE_ARGS int sig, siginfo_t *sip, void *data #define FPE_DECL int why = sip->si_code #else #define FPE_ARGS int sig, int why #define FPE_DECL /* nothing */ #endif static void message(const char *s) { printf("\t%s\n", s); } jmp_buf jbuff; int may_be_safe_to_look_at_why = 0; int why_v; int checking_for_strtod_ovf_bug = 0; static void catch_FPEs(void); static int is_nan(double); static void check_strtod_ovf(void); static double div_by(double x, double y) { return x / y; } static double overflow(double x) { double y; do { y = x; x *= x; } while (y != x); return x; } static void check_fpe_traps(void) { int traps = 0; if (setjmp(jbuff) == 0) { div_by(44.0, 0.0); message("division by zero does not generate an exception"); } else { traps = 1; message("division by zero generates an exception"); catch_FPEs(); /* set again if sysV */ } if (setjmp(jbuff) == 0) { overflow(1000.0); message("overflow does not generate an exception"); } else { traps |= 2; message("overflow generates an exception"); catch_FPEs(); } if (traps == 0) { double maybe_nan; maybe_nan = sqrt(-8.0); if (is_nan(maybe_nan)) { message("math library supports ieee754"); } else { traps |= 4; message("math library does not support ieee754"); } } exit(traps); } static int is_nan(double d) { int result; char command[128]; #ifdef HAVE_ISNAN result = isnan(d); #else if (!(d == d)) { result = 1; } else { /* on some systems with an ieee754 bug, we need to make another check */ sprintf(command, "echo '%f' | egrep '[nN][aA][nN]|\\?' >/dev/null", d); result = system(command) == 0; } #endif return result; } /* Only get here if we think we have Berkeley type signals so we can look at a second argument to fpe_catch() to get the reason for an exception */ static void get_fpe_codes(void) { int divz = 0; int ovf = 0; may_be_safe_to_look_at_why = 1; if (setjmp(jbuff) == 0) div_by(1000.0, 0.0); else { divz = why_v; catch_FPEs(); } if (setjmp(jbuff) == 0) overflow(1000.0); else { ovf = why_v; catch_FPEs(); } /* make some guesses if sane values */ if (divz > 0 && ovf > 0 && divz != ovf) { printf("X FPE_ZERODIVIDE %d\n", divz); printf("X FPE_OVERFLOW %d\n", ovf); exit(0); } else exit(1); } int main(int argc, char *argv[]) { #ifdef HAVE_MATH__LIB_VERSION _LIB_VERSION = _IEEE_; #endif catch_FPEs(); switch (argc) { case 1: check_fpe_traps(); break; case 2: get_fpe_codes(); break; default: check_strtod_ovf(); break; } /* not reached */ return 0; } static RETSIGTYPE fpe_catch(FPE_ARGS) { FPE_DECL; if (checking_for_strtod_ovf_bug) exit(1); if (may_be_safe_to_look_at_why) why_v = why; longjmp(jbuff, 1); } static void catch_FPEs(void) { #if defined(HAVE_SIGACTION_SA_SIGACTION) { struct sigaction x; memset(&x, 0, sizeof(x)); x.sa_sigaction = fpe_catch; x.sa_flags = SA_SIGINFO; sigaction(SIGFPE, &x, (struct sigaction *) 0); } #else signal(SIGFPE, fpe_catch); #endif } char longstr[] = "1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890\ 1234567890"; #ifdef USE_IEEEFP_H #include #endif static void check_strtod_ovf(void) { #ifdef USE_IEEEFP_H fpsetmask(fpgetmask() | FP_X_OFL | FP_X_DZ); #endif checking_for_strtod_ovf_bug = 1; strtod(longstr, (char **) 0); exit(0); } mawk-1.3.4-20200120/trace.c0000644000175100001440000001155613425175071013340 0ustar tomusers/******************************************** trace.c copyright 2012-2016,2019 Thomas E. Dickey This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: trace.c,v 1.16 2019/02/02 02:02:33 tom Exp $ */ #include #include #include static FILE *trace_fp; void Trace(const char *format, ...) { va_list args; if (trace_fp == 0) trace_fp = fopen("Trace.out", "w"); if (trace_fp == 0) rt_error("cannot open Trace.out"); va_start(args, format); vfprintf(trace_fp, format, args); va_end(args); fflush(trace_fp); } void TraceVA(const char *format, va_list args) { vfprintf(trace_fp, format, args); } void TraceCell(CELL *cp) { TRACE(("cell %p ", (void *) cp)); if (cp != 0) { switch ((MAWK_CELL_TYPES) cp->type) { case C_NOINIT: TRACE(("is empty\n")); break; case C_DOUBLE: TRACE(("double %g\n", cp->dval)); break; case C_MBSTRN: case C_STRNUM: case C_STRING: TRACE(("string ")); TraceString(string(cp)); TRACE((" (%d)\n", string(cp)->ref_cnt)); break; case C_SPACE: TRACE(("split on space\n")); break; case C_SNULL: TRACE(("split on the empty string\n")); break; case C_RE: TRACE(("a regular expression at %p: %s\n", cp->ptr, re_uncompile(cp->ptr))); break; case C_REPL: TRACE(("a replacement string at %p: ", cp->ptr)); TraceString(string(cp)); TRACE(("\n")); break; case C_REPLV: TRACE(("a vector replacement, count %d at %p\n", cp->vcnt, cp->ptr)); break; case NUM_CELL_TYPES: /* FALLTHRU */ default: TRACE(("unknown type %d\n", cp->type)); break; } } else { TRACE(("no cell\n")); } } void TraceFunc(const char *name, CELL *sp) { int nargs = sp->type; int n; TRACE(("** %s <-%p\n", name, (void *) sp)); for (n = 0; n < nargs; ++n) { TRACE(("...arg%d: ", n)); TraceCell(sp + n - nargs); } } void TraceInst(INST * p, INST * base) { INST *q = da_this(p, base, trace_fp); TRACE((" ...%ld\n", (long) (q - p))); if (p++ != q) { switch ((MAWK_OPCODES) (base->op)) { case AE_PUSHA: case AE_PUSHI: case A_PUSHA: TRACE(("\tST_ARRAY *%p\n", p->ptr)); break; case F_PUSHA: TRACE(("\tST_FIELD *%p\n", p->ptr)); break; case _BUILTIN: case _PRINT: TRACE(("\tPF_CP *%p\n", p->ptr)); break; case _CALL: TRACE(("\tFBLOCK *%p\n", p->ptr)); break; case _MATCH0: case _MATCH1: TRACE(("\tregex *%p\n", p->ptr)); break; case _PUSHA: TRACE(("\tST_VAR *%p\n", p->ptr)); break; case _PUSHC: case _PUSHI: TRACE(("\tCELL *%p\n", p->ptr)); break; case _PUSHD: TRACE(("\tdouble *%p\n", p->ptr)); break; case _PUSHS: TRACE(("\tSTRING *%p\n", p->ptr)); break; case ALOOP: case A_CAT: case A_DEL: case A_LENGTH: case A_TEST: case DEL_A: case FE_PUSHA: case FE_PUSHI: case F_ADD_ASG: case F_ASSIGN: case F_DIV_ASG: case F_MOD_ASG: case F_MUL_ASG: case F_POST_DEC: case F_POST_INC: case F_POW_ASG: case F_PRE_DEC: case F_PRE_INC: case F_PUSHI: case F_SUB_ASG: case LAE_PUSHA: case LAE_PUSHI: case LA_PUSHA: case L_PUSHA: case L_PUSHI: case NF_PUSHI: case OL_GL: case OL_GL_NR: case POP_AL: case SET_ALOOP: case _ADD: case _ADD_ASG: case _ASSIGN: case _CAT: case _DIV: case _DIV_ASG: case _EQ: case _EXIT0: case _EXIT: case _GT: case _GTE: case _HALT: case _JMAIN: case _JMP: case _JNZ: case _JZ: case _LJNZ: case _LJZ: case _LT: case _LTE: case _MATCH2: case _MOD: case _MOD_ASG: case _MUL: case _MUL_ASG: case _NEQ: case _NEXT: case _NEXTFILE: case _NOT: case _OMAIN: case _POP: case _POST_DEC: case _POST_INC: case _POW: case _POW_ASG: case _PRE_DEC: case _PRE_INC: case _PUSHINT: case _RANGE: case _RET0: case _RET: case _STOP: case _SUB: case _SUB_ASG: case _TEST: case _UMINUS: case _UPLUS: break; } } } void TraceString2(const char *str, size_t len) { size_t limit = len; size_t n; TRACE(("\"")); if (limit) { for (n = 0; n < limit; ++n) { UChar ch = (UChar) str[n]; switch (ch) { case '\"': TRACE(("\\\"")); break; case '\\': TRACE(("\\\\")); break; case '\b': TRACE(("\\b")); break; case '\f': TRACE(("\\f")); break; case '\n': TRACE(("\\n")); break; case '\r': TRACE(("\\r")); break; case '\t': TRACE(("\\t")); break; default: if (ch < 32 || ch > 126) TRACE(("\\%03o", ch)); else TRACE(("%c", ch)); break; } } } TRACE(("\"")); } void TraceString(STRING * sp) { TraceString2(sp ? sp->str : "", sp ? sp->len : 0); } #ifdef NO_LEAKS void trace_leaks(void) { if (trace_fp != 0) { fclose(trace_fp); trace_fp = 0; } } #endif mawk-1.3.4-20200120/rexpdb.c0000644000175100001440000000433412773554253013532 0ustar tomusers/******************************************** rexpdb.c copyright 2008-2014,2016, Thomas E. Dickey copyright 1991,1993, Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: rexpdb.c,v 1.16 2016/09/30 21:27:07 tom Exp $ */ #include "rexp.h" #include /* print a machine for debugging */ static const char *xlat[] = { "M_STR", "M_CLASS", "M_ANY", "M_START", "M_END", "M_U", "M_1J", "M_2JA", "M_2JB", "M_SAVE_POS", "M_2JC", "M_ACCEPT" }; const char * REs_type(PTR p) { return (xlat[((UChar) (((STATE *) p)->s_type)) % U_ON]); } void REmprint(PTR m, FILE *f) { STATE *p = (STATE *) m; const char *end_on_string; while (1) { fprintf(f, "%03d ", (int) (p - (STATE *) m)); fprintf(f, ".\t"); if (p->s_type >= END_ON) { p->s_type = (SType) (p->s_type - END_ON); end_on_string = "$"; } else end_on_string = ""; if (p->s_type < 0 || p->s_type >= END_ON) { fprintf(f, "unknown STATE type %d\n", (int) (p->s_type)); return; } fprintf(f, "%s", xlat[((UChar) (p->s_type)) % U_ON]); switch (p->s_type) { case M_STR: fprintf(f, "\t"); da_string(f, p->s_data.str, (size_t) p->s_len); break; case M_1J: case M_2JA: case M_2JB: case M_2JC: fprintf(f, "\t%d", p->s_data.jump); break; case M_CLASS: { UChar *q = (UChar *) p->s_data.bvp; UChar *r = q + sizeof(BV); unsigned bitnum = 0; fprintf(f, "\t["); while (q < r) { unsigned bits = *q++; if (bits != 0) { unsigned b; for (b = 0; b < 8; ++b) { if (bits & (unsigned) (1 << b)) { int ch = (int) (bitnum + b); if (ch < 32 || ch >= 128) { fprintf(f, "\\%03o", ch); } else { if (strchr("\\[]", ch)) fprintf(f, "\\"); fprintf(f, "%c", ch); } } } } bitnum += 8; } fprintf(f, "]"); } break; } fprintf(f, "\t%s\n", end_on_string); if (end_on_string[0]) p->s_type = (SType) (p->s_type + END_ON); if (p->s_type == M_ACCEPT) return; p++; } } mawk-1.3.4-20200120/print.c0000644000175100001440000003501413611332151013360 0ustar tomusers/******************************************** print.c copyright 2008-2016,2020. Thomas E. Dickey copyright 1991-1996,2014. Michael D. Brennan This is a source file for mawk, an implementation of the AWK programming language. Mawk is distributed without warranty under the terms of the GNU General Public License, version 2, 1991. ********************************************/ /* * $MawkId: print.c,v 1.28 2020/01/20 14:08:41 tom Exp $ */ #include "mawk.h" #include "bi_vars.h" #include "bi_funct.h" #include "memory.h" #include "field.h" #include "scan.h" #include "files.h" #include "init.h" static void write_error(void); /* this can be moved and enlarged by -W sprintf=num */ char *sprintf_buff = string_buff; char *sprintf_limit = string_buff + sizeof(string_buff); /* Once execute() starts the sprintf code is (belatedly) the only code allowed to use string_buff */ static void print_cell(CELL *p, FILE *fp) { size_t len; switch (p->type) { case C_NOINIT: break; case C_MBSTRN: case C_STRING: case C_STRNUM: switch (len = string(p)->len) { case 0: break; case 1: putc(string(p)->str[0], fp); break; default: fwrite(string(p)->str, (size_t) 1, len, fp); } break; case C_DOUBLE: { Int ival = d_to_I(p->dval); /* integers print as "%[l]d" */ if ((double) ival == p->dval) fprintf(fp, INT_FMT, ival); else fprintf(fp, string(OFMT)->str, p->dval); } break; default: bozo("bad cell passed to print_cell"); } } /* on entry to bi_print or bi_printf the stack is: sp[0] = an integer k if ( k < 0 ) output is to a file with name in sp[-1] { so open file and sp -= 2 } sp[0] = k >= 0 is the number of print args sp[-k] holds the first argument */ CELL * bi_print( CELL *sp) /* stack ptr passed in */ { register CELL *p; register int k; FILE *fp; k = sp->type; if (k < 0) { /* k holds redirection */ if ((--sp)->type < C_STRING) cast1_to_s(sp); fp = (FILE *) file_find(string(sp), k); free_STRING(string(sp)); k = (--sp)->type; /* k now has number of arguments */ } else fp = stdout; if (k) { p = sp - k; /* clear k variables off the stack */ sp = p - 1; k--; while (k > 0) { print_cell(p, fp); print_cell(OFS, fp); cell_destroy(p); p++; k--; } print_cell(p, fp); cell_destroy(p); } else { /* print $0 */ sp--; print_cell(&field[0], fp); } print_cell(ORS, fp); if (ferror(fp)) write_error(); return sp; } /*---------- types and defs for doing printf and sprintf----*/ typedef enum { PF_C = 0, /* %c */ PF_S, /* %s */ PF_D, /* int conversion */ PF_F, /* float conversion */ PF_U, /* unsigned conversion */ PF_last } PF_enum; /* for switch on number of '*' and type */ #define AST(num,type) ((PF_last)*(num)+(type)) /* some picky ANSI compilers go berserk without this */ typedef int (*PRINTER) (PTR, const char *,...); /*-------------------------------------------------------*/ static void bad_conversion(int cnt, const char *who, const char *format) { rt_error("improper conversion(number %d) in %s(\"%s\")", cnt, who, format); } typedef enum { sfmtSPACE = 1, sfmtMINUS = 2, sfmtZEROS = 4, sfmtWIDTH = 8, sfmtPREC = 16 } enumSFMT; /* * nawk pads leading 0's if it sees a format such as "%06s". * C's printf/sprintf do not do that. * So we decode the format and interpret it according to nawk. */ static int make_sfmt(const char *format, int *fill_in, int *width, int *prec, int *flags) { int ch; int parts = 0; int digits = 0; int value = 0; int used = 0; int success = 1; int ok_flag = 1; *width = 0; *prec = 0; *flags = 0; ++format; while (*format != '\0' && ok_flag) { switch (*format++) { case ' ': *flags |= sfmtSPACE; break; case '-': *flags |= sfmtMINUS; break; case '0': *flags |= sfmtZEROS; break; case '+': /* FALLTHRU */ case '#': /* ignore for %s */ break; default: ok_flag = 0; --format; break; } } while (*format != '\0' && success) { switch (ch = *format++) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digits < 0) { success = 0; } else if (digits++ == 0) { value = (ch - '0'); } else { value = (10 * value) + (ch - '0'); } break; case '.': if (parts) { success = 0; } else { if (digits) { *width = value; *flags |= sfmtWIDTH; digits = 0; value = 0; } parts = 1; } break; case '*': if (digits == 0) { value = fill_in[used++]; digits = -1; } else { success = 0; } break; case 'c': /* FALLTHRU */ case 's': if (digits) { if (parts) { *prec = value; *flags |= sfmtPREC; } else { *width = value; *flags |= sfmtWIDTH; } } if (*format != '\0') success = 0; break; default: success = 0; break; } } return success; } #define SprintfOverflow(bfr, need) \ if (bfr + need + 1 >= sprintf_limit) { \ rt_overflow("sprintf buffer", \ (unsigned) (sprintf_limit - sprintf_buff)); \ } static char * SprintfChar(char *buffer, int ch) { SprintfOverflow(buffer, 1); *buffer++ = (char) ch; return buffer; } static char * SprintfFill(char *buffer, int ch, int fill) { SprintfOverflow(buffer, fill); memset(buffer, ch, (size_t) fill); return buffer + fill; } static char * SprintfBlock(char *buffer, char *source, int length) { SprintfOverflow(buffer, length); memcpy(buffer, source, (size_t) length); return buffer + length; } /* * Write the s-format text. */ static PTR puts_sfmt(PTR target, FILE *fp, CELL *source, STRING * onechr, int width, int prec, int flags) { char *src_str = onechr ? onechr->str : string(source)->str; int src_len = onechr ? 1 : (int) string(source)->len; if (width < 0) { width = -width; flags |= sfmtMINUS; } if (fp != 0) { if (flags & sfmtSPACE) { if (src_len == 0) fputc(' ', fp); } if (flags & sfmtPREC) { if (src_len > prec) src_len = prec; } if (!(flags & sfmtWIDTH)) { width = src_len; } if (!(flags & sfmtMINUS)) { while (src_len < width) { fputc(' ', fp); --width; } } fwrite(src_str, sizeof(char), (size_t) src_len, fp); while (src_len < width) { fputc(' ', fp); --width; } } else { char *buffer = (char *) target; /* points into sprintf_buff */ if (flags & sfmtSPACE) { if (src_len == 0) { buffer = SprintfChar(buffer, ' '); } } if (flags & sfmtPREC) { if (src_len > prec) src_len = prec; } if (!(flags & sfmtWIDTH)) { width = src_len; } if (!(flags & sfmtMINUS)) { if (src_len < width) { buffer = SprintfFill(buffer, ' ', width - src_len); width = src_len; } } buffer = SprintfBlock(buffer, src_str, src_len); if (src_len < width) { buffer = SprintfFill(buffer, ' ', width - src_len); } target = buffer; } return target; } /* * Note: caller must do CELL cleanup. * The format parameter is modified, but restored. * * This routine does both printf and sprintf (if fp==0) */ static STRING * do_printf( FILE *fp, char *format, unsigned argcnt, /* number of args on eval stack */ CELL *cp) /* ptr to an array of arguments (on the eval stack) */ { char save; char *p; register char *q = format; register char *target; int l_flag, h_flag; /* seen %ld or %hd */ int ast_cnt; int ast[2]; UInt Uval = 0; Int Ival = 0; int sfmt_width, sfmt_prec, sfmt_flags, s_format; int num_conversion = 0; /* for error messages */ const char *who; /*ditto */ int pf_type = 0; /* conversion type */ PRINTER printer; /* pts at fprintf() or sprintf() */ STRING onechr; #ifdef SHORT_INTS char xbuff[256]; /* splice in l qualifier here */ #endif if (fp == (FILE *) 0) { /* doing sprintf */ target = sprintf_buff; printer = (PRINTER) sprintf; who = "sprintf"; } else { /* doing printf */ target = (char *) fp; /* will never change */ printer = (PRINTER) fprintf; who = "printf"; } while (1) { if (fp) { /* printf */ while (*q != '%') { if (*q == 0) { if (ferror(fp)) write_error(); /* return is ignored */ return (STRING *) 0; } else { putc(*q, fp); q++; } } } else { /* sprintf */ while (*q != '%') { if (*q == 0) { if (target > sprintf_limit) /* damaged */ { /* hope this works */ rt_overflow("sprintf buffer", (unsigned) (sprintf_limit - sprintf_buff)); } else { /* really done */ return new_STRING1(sprintf_buff, (size_t) (target - sprintf_buff)); } } else { *target++ = *q++; } } } /* *q == '%' */ num_conversion++; if (*++q == '%') { /* %% */ if (fp) putc(*q, fp); else *target++ = *q; q++; continue; } /* mark the '%' with p */ p = q - 1; /* eat the flags */ while (*q == '-' || *q == '+' || *q == ' ' || *q == '#' || *q == '0' || *q == '\'') q++; ast_cnt = 0; ast[0] = 0; if (*q == '*') { if (cp->type != C_DOUBLE) cast1_to_d(cp); ast[ast_cnt++] = d_to_i(cp++->dval); argcnt--; q++; } else while (scan_code[*(unsigned char *) q] == SC_DIGIT) q++; /* width is done */ if (*q == '.') { /* have precision */ q++; if (*q == '*') { if (cp->type != C_DOUBLE) cast1_to_d(cp); ast[ast_cnt++] = d_to_i(cp++->dval); argcnt--; q++; } else { while (scan_code[*(unsigned char *) q] == SC_DIGIT) q++; } } if ((int) argcnt <= 0) rt_error("not enough arguments passed to %s(\"%s\")", who, format); l_flag = h_flag = 0; if (*q == 'l') { q++; l_flag = 1; } else if (*q == 'h') { q++; h_flag = 1; } switch (*q++) { case 's': if (l_flag + h_flag) bad_conversion(num_conversion, who, format); if (cp->type < C_STRING) cast1_to_s(cp); pf_type = PF_S; break; case 'c': if (l_flag + h_flag) bad_conversion(num_conversion, who, format); switch (cp->type) { case C_NOINIT: Ival = 0; break; case C_STRNUM: case C_DOUBLE: Ival = d_to_I(cp->dval); break; case C_STRING: Ival = string(cp)->str[0]; break; case C_MBSTRN: check_strnum(cp); Ival = ((cp->type == C_STRING) ? string(cp)->str[0] : d_to_I(cp->dval)); break; default: bozo("printf %c"); } onechr.len = 1; onechr.str[0] = (char) Ival; pf_type = PF_C; break; case 'd': case 'i': if (cp->type != C_DOUBLE) cast1_to_d(cp); Ival = d_to_I(cp->dval); pf_type = PF_D; break; case 'o': case 'x': case 'X': case 'u': if (cp->type != C_DOUBLE) cast1_to_d(cp); Uval = d_to_U(cp->dval); pf_type = PF_U; break; case 'e': case 'g': case 'f': case 'E': case 'G': if (h_flag + l_flag) bad_conversion(num_conversion, who, format); if (cp->type != C_DOUBLE) cast1_to_d(cp); pf_type = PF_F; break; default: bad_conversion(num_conversion, who, format); } save = *q; *q = 0; #ifdef SHORT_INTS if (pf_type == PF_D) { /* need to splice in long modifier */ strcpy(xbuff, p); if (l_flag) /* do nothing */ ; else { int k = q - p; if (h_flag) { Ival = (short) Ival; /* replace the 'h' with 'l' (really!) */ xbuff[k - 2] = 'l'; if (xbuff[k - 1] != 'd' && xbuff[k - 1] != 'i') Ival &= 0xffff; } else { /* the usual case */ xbuff[k] = xbuff[k - 1]; xbuff[k - 1] = 'l'; xbuff[k + 1] = 0; } } } #endif #define PUTS_C_ARGS target, fp, 0, &onechr, sfmt_width, sfmt_prec, sfmt_flags #define PUTS_S_ARGS target, fp, cp, 0, sfmt_width, sfmt_prec, sfmt_flags /* ready to call printf() */ s_format = 0; switch (AST(ast_cnt, pf_type)) { case AST(0, PF_C): /* FALLTHRU */ case AST(1, PF_C): /* FALLTHRU */ case AST(2, PF_C): s_format = 1; make_sfmt(p, ast, &sfmt_width, &sfmt_prec, &sfmt_flags); target = puts_sfmt(PUTS_C_ARGS); break; case AST(0, PF_S): /* FALLTHRU */ case AST(1, PF_S): /* FALLTHRU */ case AST(2, PF_S): s_format = 1; make_sfmt(p, ast, &sfmt_width, &sfmt_prec, &sfmt_flags); target = puts_sfmt(PUTS_S_ARGS); break; #ifdef SHORT_INTS #define FMT xbuff /* format in xbuff */ #else #define FMT p /* p -> format */ #endif case AST(0, PF_D): (*printer) ((PTR) target, FMT, Ival); break; case AST(1, PF_D): (*printer) ((PTR) target, FMT, ast[0], Ival); break; case AST(2, PF_D): (*printer) ((PTR) target, FMT, ast[0], ast[1], Ival); break; case AST(0, PF_U): (*printer) ((PTR) target, FMT, Uval); break; case AST(1, PF_U): (*printer) ((PTR) target, FMT, ast[0], Uval); break; case AST(2, PF_U): (*printer) ((PTR) target, FMT, ast[0], ast[1], Uval); break; #undef FMT case AST(0, PF_F): (*printer) ((PTR) target, p, cp->dval); break; case AST(1, PF_F): (*printer) ((PTR) target, p, ast[0], cp->dval); break; case AST(2, PF_F): (*printer) ((PTR) target, p, ast[0], ast[1], cp->dval); break; } if (fp == (FILE *) 0 && !s_format) { while (*target) target++; } *q = save; argcnt--; cp++; } } CELL * bi_printf(CELL *sp) { register int k; register CELL *p; FILE *fp; TRACE_FUNC("bi_printf", sp); k = sp->type; if (k < 0) { /* k has redirection */ if ((--sp)->type < C_STRING) cast1_to_s(sp); fp = (FILE *) file_find(string(sp), k); free_STRING(string(sp)); k = (--sp)->type; /* k is now number of args including format */ } else fp = stdout; sp -= k; /* sp points at the format string */ k--; if (sp->type < C_STRING) cast1_to_s(sp); do_printf(fp, string(sp)->str, (unsigned) k, sp + 1); free_STRING(string(sp)); /* cleanup arguments on eval stack */ for (p = sp + 1; k; k--, p++) cell_destroy(p); return --sp; } CELL * bi_sprintf(CELL *sp) { CELL *p; int argcnt = sp->type; STRING *sval; TRACE_FUNC("bi_sprintf", sp); sp -= argcnt; /* sp points at the format string */ argcnt--; if (sp->type != C_STRING) cast1_to_s(sp); sval = do_printf((FILE *) 0, string(sp)->str, (unsigned) argcnt, sp + 1); free_STRING(string(sp)); sp->ptr = (PTR) sval; /* cleanup */ for (p = sp + 1; argcnt; argcnt--, p++) cell_destroy(p); return sp; } static void write_error(void) { errmsg(errno, "write failure"); mawk_exit(2); }