aboutsummaryrefslogtreecommitdiff
path: root/utils.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2020-09-10 03:41:03 -0700
committerBruce Hill <bruce@bruce-hill.com>2020-09-10 03:41:03 -0700
commit4e201e6a70e60d24b22ce62109b5af3d90c0a27e (patch)
tree66fe24760a34e66019b16b59444ddd606d3e009d /utils.h
parentaa0b8fc59168c9b86eeae311702133a0b896d2c8 (diff)
Added dashes to identifiers
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/utils.h b/utils.h
index 8012af1..714f17e 100644
--- a/utils.h
+++ b/utils.h
@@ -31,6 +31,16 @@ static inline const char *after_spaces(const char *str)
return str;
}
+static inline const char *after_name(const char *str)
+{
+ if (!isalpha(*str)) return NULL;
+ for (++str; *str; ++str) {
+ if (!(isalnum(*str) || *str == '-'))
+ break;
+ }
+ return str;
+}
+
static inline int matchchar(const char **str, char c)
{
*str = after_spaces(*str);