summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2012-05-25 15:18:43 +0300
committerArnold D. Robbins <arnold@skeeve.com>2012-05-25 15:18:43 +0300
commiteec7101174a3b2807fb282272f75cc13d4b953c3 (patch)
tree2748f77fb510d32f6090fc3e3e02829682336e15 /main.c
parent577c3fc31a2718461fba2e599d162de96fe838fa (diff)
downloadgawk-eec7101174a3b2807fb282272f75cc13d4b953c3.tar.gz
Additional changes / some cleanups.
Diffstat (limited to 'main.c')
-rw-r--r--main.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/main.c b/main.c
index 844052f1..e8f087c1 100644
--- a/main.c
+++ b/main.c
@@ -950,6 +950,7 @@ struct varinit {
int flags;
#define NO_INSTALL 0x01
#define NON_STANDARD 0x02
+#define NOT_OFF_LIMITS 0x04 /* may be accessed by extension function */
};
static const struct varinit varinit[] = {
@@ -973,7 +974,7 @@ static const struct varinit varinit[] = {
{&OFMT_node, "OFMT", "%.6g", 0, NULL, set_OFMT, true, 0 },
{&OFS_node, "OFS", " ", 0, NULL, set_OFS, true, 0 },
{&ORS_node, "ORS", "\n", 0, NULL, set_ORS, true, 0 },
-{NULL, "PROCINFO", NULL, 0, NULL, NULL, false, NO_INSTALL | NON_STANDARD },
+{NULL, "PROCINFO", NULL, 0, NULL, NULL, false, NO_INSTALL | NON_STANDARD | NOT_OFF_LIMITS },
{&RLENGTH_node, "RLENGTH", NULL, 0, NULL, NULL, false, 0 },
{&ROUNDMODE_node, "ROUNDMODE", DEFAULT_ROUNDMODE, 0, NULL, set_ROUNDMODE, false, NON_STANDARD },
{&RS_node, "RS", "\n", 0, NULL, set_RS, true, 0 },
@@ -1190,6 +1191,24 @@ is_std_var(const char *var)
return false;
}
+/*
+ * is_off_limits_var --- return true if a variable is off limits
+ * to extension functions
+ */
+
+int
+is_off_limits_var(const char *var)
+{
+ const struct varinit *vp;
+
+ for (vp = varinit; vp->name != NULL; vp++) {
+ if ( (vp->flags & NOT_OFF_LIMITS) != 0
+ && strcmp(vp->name, var) == 0)
+ return false;
+ }
+
+ return true;
+}
/* get_spec_varname --- return the name of a special variable
with the given assign or update routine.