diff options
Diffstat (limited to 'ext.c')
-rw-r--r-- | ext.c | 38 |
1 files changed, 19 insertions, 19 deletions
@@ -77,25 +77,6 @@ load_ext(const char *lib_name) lib_name, INIT_FUNC); } -/* is_valid_identifier --- return true if name is a valid simple identifier */ - -bool -is_valid_identifier(const char *name) -{ - const char *sp = name; - int c; - - if (! is_letter(*sp)) - return false; - - for (sp++; (c = *sp++) != '\0';) { - if (! is_identchar(c)) - return false; - } - - return true; -} - /* make_builtin --- register name to be called as func with a builtin body */ awk_bool_t @@ -266,3 +247,22 @@ close_extensions() if (s->stype == SRC_EXTLIB && s->fini_func) (*s->fini_func)(); } + +/* is_valid_identifier --- return true if name is a valid simple identifier */ + +bool +is_valid_identifier(const char *name) +{ + const char *sp = name; + int c; + + if (! is_letter(*sp)) + return false; + + for (sp++; (c = *sp++) != '\0';) { + if (! is_identchar(c)) + return false; + } + + return true; +} |