aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/main.c b/main.c
index 120d9ff8..657de326 100644
--- a/main.c
+++ b/main.c
@@ -1127,6 +1127,26 @@ is_std_var(const char *var)
return FALSE;
}
+
+/* get_spec_varname --- return the name of a special variable
+ with the given assign or update routine.
+*/
+
+const char *
+get_spec_varname(Func_ptr fptr)
+{
+ const struct varinit *vp;
+
+ if (! fptr)
+ return NULL;
+ for (vp = varinit; vp->name != NULL; vp++) {
+ if (vp->assign == fptr || vp->update == fptr)
+ return vp->name;
+ }
+ return NULL;
+}
+
+
/* arg_assign --- process a command-line assignment */
int