diff -urpN gawk-3.1.1.orig/awk.h gawk-3.1.1.pokus/awk.h --- gawk-3.1.1.orig/awk.h Tue Apr 16 13:40:18 2002 +++ gawk-3.1.1.pokus/awk.h Thu Dec 12 08:43:32 2002 @@ -354,7 +354,7 @@ typedef enum nodevals { Node_var_array, /* array is ptr to elements, asize num of eles */ Node_val, /* node is a value - type in flags */ - /* Builtins subnode is explist to work on, proc is func to call */ + /* Builtins subnode is explist to work on, gawk_proc is func to call */ Node_builtin, /* @@ -490,7 +490,7 @@ typedef struct exp_node { #define parmlist sub.nodep.x.param_list #define subnode lnode -#define proc sub.nodep.r.pptr +#define gawk_proc sub.nodep.r.pptr #define callresult sub.nodep.x.extra #define re_reg sub.nodep.r.preg diff -urpN gawk-3.1.1.orig/awkgram.c gawk-3.1.1.pokus/awkgram.c --- gawk-3.1.1.orig/awkgram.c Tue Apr 16 14:02:08 2002 +++ gawk-3.1.1.pokus/awkgram.c Thu Dec 12 08:43:32 2002 @@ -3688,7 +3688,7 @@ node(NODE *left, NODETYPE op, NODE *righ return r; } -/* snode --- allocate a node with defined subnode and proc for builtin +/* snode --- allocate a node with defined subnode and gawk_proc for builtin functions. Checks for arg. count and supplies defaults where possible. */ @@ -3715,14 +3715,14 @@ snode(NODE *subn, NODETYPE op, int idx) fatal(_("%d is invalid as number of arguments for %s"), nexp, tokentab[idx].operator); - r->proc = tokentab[idx].ptr; + r->gawk_proc = tokentab[idx].ptr; /* special case processing for a few builtins */ - if (nexp == 0 && r->proc == do_length) { + if (nexp == 0 && r->gawk_proc == do_length) { subn = node(node(make_number(0.0), Node_field_spec, (NODE *) NULL), Node_expression_list, (NODE *) NULL); - } else if (r->proc == do_match) { + } else if (r->gawk_proc == do_match) { static short warned = FALSE; if (subn->rnode->lnode->type != Node_regex) @@ -3736,7 +3736,7 @@ snode(NODE *subn, NODETYPE op, int idx) if (do_traditional) fatal(_("match: third argument is a gawk extension")); } - } else if (r->proc == do_sub || r->proc == do_gsub) { + } else if (r->gawk_proc == do_sub || r->gawk_proc == do_gsub) { if (subn->lnode->type != Node_regex) subn->lnode = mk_rexp(subn->lnode); if (nexp == 2) @@ -3746,19 +3746,14 @@ snode(NODE *subn, NODETYPE op, int idx) Node_expression_list, (NODE *) NULL)); else if (subn->rnode->rnode->lnode->type == Node_val) { - if (do_lint) { - char *f; - - f = (r->proc == do_sub) ? "sub" : "gsub"; - lintwarn(_("%s: string literal as last arg of substitute has no effect"), f); - } + if (do_lint) + lintwarn(_("%s: string literal as last arg of substitute has no effect"), + (r->gawk_proc == do_sub) ? "sub" : "gsub"); } else if (! isassignable(subn->rnode->rnode->lnode)) { - if (r->proc == do_sub) - yyerror(_("sub third parameter is not a changeable object")); - else - yyerror(_("gsub third parameter is not a changeable object")); + yyerror(_("%s third parameter is not a changeable object"), + (r->gawk_proc == do_sub) ? "sub" : "gsub"); } - } else if (r->proc == do_gensub) { + } else if (r->gawk_proc == do_gensub) { if (subn->lnode->type != Node_regex) subn->lnode = mk_rexp(subn->lnode); if (nexp == 3) @@ -3767,7 +3762,7 @@ snode(NODE *subn, NODETYPE op, int idx) (NODE *) NULL), Node_expression_list, (NODE *) NULL)); - } else if (r->proc == do_split) { + } else if (r->gawk_proc == do_split) { if (nexp == 2) append_right(subn, node(FS_node, Node_expression_list, (NODE *) NULL)); @@ -3776,7 +3771,7 @@ snode(NODE *subn, NODETYPE op, int idx) subn->rnode->rnode->lnode = mk_rexp(n); if (nexp == 2) subn->rnode->rnode->lnode->re_flags |= FS_DFLT; - } else if (r->proc == do_close) { + } else if (r->gawk_proc == do_close) { static short warned = FALSE; if ( nexp == 2) { @@ -3788,7 +3783,7 @@ snode(NODE *subn, NODETYPE op, int idx) fatal(_("close: second argument is a gawk extension")); } } else if (do_intl /* --gen-po */ - && r->proc == do_dcgettext /* dcgettext(...) */ + && r->gawk_proc == do_dcgettext /* dcgettext(...) */ && subn->lnode->type == Node_val /* 1st arg is constant */ && (subn->lnode->flags & STR) != 0) { /* it's a string constant */ /* ala xgettext, dcgettext("some string" ...) dumps the string */ @@ -3800,7 +3795,7 @@ snode(NODE *subn, NODETYPE op, int idx) else dumpintlstr(str->stptr, str->stlen); } else if (do_intl /* --gen-po */ - && r->proc == do_dcngettext /* dcngettext(...) */ + && r->gawk_proc == do_dcngettext /* dcngettext(...) */ && subn->lnode->type == Node_val /* 1st arg is constant */ && (subn->lnode->flags & STR) != 0 /* it's a string constant */ && subn->rnode->lnode->type == Node_val /* 2nd arg is constant too */ @@ -3816,7 +3811,7 @@ snode(NODE *subn, NODETYPE op, int idx) } r->subnode = subn; - if (r->proc == do_sprintf) { + if (r->gawk_proc == do_sprintf) { count_args(r); r->lnode->printf_count = r->printf_count; /* hack */ } @@ -4654,7 +4649,7 @@ count_args(NODE *tree) NODE *save_tree; assert(tree->type == Node_K_printf - || (tree->type == Node_builtin && tree->proc == do_sprintf)); + || (tree->type == Node_builtin && tree->gawk_proc == do_sprintf)); save_tree = tree; tree = tree->lnode; /* printf format string */ diff -urpN gawk-3.1.1.orig/eval.c gawk-3.1.1.pokus/eval.c --- gawk-3.1.1.orig/eval.c Wed Oct 16 10:44:18 2002 +++ gawk-3.1.1.pokus/eval.c Thu Dec 12 08:43:32 2002 @@ -757,7 +757,7 @@ r_tree_eval(register NODE *tree, int isc /* Builtins */ case Node_builtin: - return (*tree->proc)(tree->subnode); + return (*tree->gawk_proc)(tree->subnode); case Node_K_getline: return (do_getline(tree)); @@ -1806,9 +1806,9 @@ r_get_lhs(register NODE *ptr, Func_ptr * * This is how Christos at Deshaw did it. * Does this buy us anything? */ - if (ptr->proc == NULL) + if (ptr->gawk_proc == NULL) fatal(_("assignment is not allowed to result of builtin function")); - ptr->callresult = (*ptr->proc)(ptr->subnode); + ptr->callresult = (*ptr->gawk_proc)(ptr->subnode); aptr = &ptr->callresult; break; #endif diff -urpN gawk-3.1.1.orig/ext.c gawk-3.1.1.pokus/ext.c --- gawk-3.1.1.orig/ext.c Tue Apr 16 13:48:16 2002 +++ gawk-3.1.1.pokus/ext.c Thu Dec 12 08:43:32 2002 @@ -125,7 +125,7 @@ make_builtin(char *name, NODE *(*func) P getnode(b); b->type = Node_builtin; - b->proc = func; + b->gawk_proc = func; b->subnode = p; b->source_line = __LINE__; b->source_file = __FILE__; diff -urpN gawk-3.1.1.orig/profile.c gawk-3.1.1.pokus/profile.c --- gawk-3.1.1.orig/profile.c Tue Apr 16 13:58:49 2002 +++ gawk-3.1.1.pokus/profile.c Thu Dec 12 08:43:32 2002 @@ -1076,7 +1076,7 @@ pp_getline(register NODE *tree) static void pp_builtin(register NODE *tree) { - fprintf(prof_fp, "%s(", getfname(tree->proc)); + fprintf(prof_fp, "%s(", getfname(tree->gawk_proc)); pp_list(tree->subnode); fprintf(prof_fp, ")"); }