diff options
Diffstat (limited to 'extension')
-rw-r--r-- | extension/ChangeLog | 9 | ||||
-rw-r--r-- | extension/filefuncs.3am | 10 | ||||
-rw-r--r-- | extension/filefuncs.c | 4 | ||||
-rw-r--r-- | extension/fnmatch.3am | 10 | ||||
-rw-r--r-- | extension/fnmatch.c | 2 | ||||
-rw-r--r-- | extension/testext.c | 4 |
6 files changed, 29 insertions, 10 deletions
diff --git a/extension/ChangeLog b/extension/ChangeLog index 73b64fb6..58bedfc6 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,12 @@ +2012-12-25 Arnold D. Robbins <arnold@skeeve.com> + + * filefuncs.3am, fnmatch.3am: Predefined variables are no + longer constants. + * filefuncs.c (init_filefuncs): Use sym_update() instead of + sym_constant(). + * fnmatch.c (init_fnmatch): Ditto. + * testext.c (init_testext): Ditto. + 2012-12-23 Arnold D. Robbins <arnold@skeeve.com> * 4.0.2: Release tar ball made. diff --git a/extension/filefuncs.3am b/extension/filefuncs.3am index 23800c47..396502c6 100644 --- a/extension/filefuncs.3am +++ b/extension/filefuncs.3am @@ -1,4 +1,4 @@ -.TH FILEFUNCS 3am "Nov 21 2012" "Free Software Foundation" "GNU Awk Extension Modules" +.TH FILEFUNCS 3am "Dec 25 2012" "Free Software Foundation" "GNU Awk Extension Modules" .SH NAME filefuncs \- provide some file related functionality to gawk .SH SYNOPSIS @@ -185,7 +185,7 @@ An array of filenames. The element values are used; the index values are ignore .TP .B flags This should be the bitwise OR of one or more of the following -predefined constant flag values. At least one of +predefined flag values. At least one of .B FTS_LOGICAL or .B FTS_PHYSICAL @@ -312,6 +312,12 @@ already provides powerful array sorting facilities. While an interface could have been provided, this felt less natural than simply creating a multi-dimensional array to represent the file heirarchy and its information. +.PP +Nothing prevents AWK code from changing the predefined +.BI FTS_ xx +values, but doing so is may cause strange results when +the changed values are passed to +.BR fts() . .SH BUGS There are many more file-related functions for which AWK interfaces would be desirable. diff --git a/extension/filefuncs.c b/extension/filefuncs.c index 85c05b2e..4f7173b4 100644 --- a/extension/filefuncs.c +++ b/extension/filefuncs.c @@ -406,8 +406,8 @@ init_filefuncs(void) for (i = 0; opentab[i].name != NULL; i++) { (void) make_number(opentab[i].value, & value); - if (! sym_constant(opentab[i].name, & value)) { - warning(ext_id, _("fts init: could not create constant %s"), + if (! sym_update(opentab[i].name, & value)) { + warning(ext_id, _("fts init: could not create variable %s"), opentab[i].name); errors++; } diff --git a/extension/fnmatch.3am b/extension/fnmatch.3am index c84e9ae1..61e7f384 100644 --- a/extension/fnmatch.3am +++ b/extension/fnmatch.3am @@ -1,4 +1,4 @@ -.TH FNMATCH 3am "Aug 08 2012" "Free Software Foundation" "GNU Awk Extension Modules" +.TH FNMATCH 3am "Dec 25 2012" "Free Software Foundation" "GNU Awk Extension Modules" .SH NAME fnmatch \- compare a string against a filename wildcard .SH SYNOPSIS @@ -14,7 +14,7 @@ extension provides an AWK interface to the .IR fnmatch (3) routine. It adds a single function named .BR fnmatch() , -one constant +one predefined variable .RB ( FNM_NOMATCH ), and an array of flag values named .BR FNM . @@ -68,7 +68,11 @@ Corresponds to the flag as defined in .IR fnmatch (3). .PP -... .SH NOTES +.SH NOTES +Nothing prevents AWK code from changing the predefined +variabale +.BR FNM_NOMATCH , +but doing so may cause strange results. ... .SH BUGS .SH EXAMPLE .ft CW diff --git a/extension/fnmatch.c b/extension/fnmatch.c index 727c9daf..c63fe136 100644 --- a/extension/fnmatch.c +++ b/extension/fnmatch.c @@ -148,7 +148,7 @@ init_fnmatch(void) awk_array_t new_array; int i; - if (! sym_constant("FNM_NOMATCH", make_number(FNM_NOMATCH, & value))) { + if (! sym_update("FNM_NOMATCH", make_number(FNM_NOMATCH, & value))) { warning(ext_id, _("fnmatch init: could not add FNM_NOMATCH variable")); errors++; } diff --git a/extension/testext.c b/extension/testext.c index 8f6735c1..f7bf08a5 100644 --- a/extension/testext.c +++ b/extension/testext.c @@ -853,8 +853,8 @@ BEGIN { */ /* install some variables */ - if (! sym_constant("answer_num", make_number(42, & value))) - printf("testext: sym_constant(\"answer_num\") failed!\n"); + if (! sym_update("answer_num", make_number(42, & value))) + printf("testext: sym_update(\"answer_num\") failed!\n"); if (! sym_update("message_string", make_const_string(message, strlen(message), & value))) |