diff --git a/include/gargoyle/twine.h b/include/gargoyle/twine.h index c4fe5a6..14d9de6 100644 --- a/include/gargoyle/twine.h +++ b/include/gargoyle/twine.h @@ -4,8 +4,8 @@ #include #include -uint8_t is_sep(char tok); -uint8_t is_eql(char lhs, char rhs); +uint8_t gargoyle_is_sep(char tok); +uint8_t gargoyle_is_eql(char lhs, char rhs); uint8_t gargoyle_cmp(const char *s1, const char *s2, uint16_t len, gargoyle_flag_type flags); char *gargoyle_cpy(char *dst, const char *src, uint16_t len, gargoyle_flag_type flags); diff --git a/src/sleuth.c b/src/sleuth.c index 7c73598..a677139 100644 --- a/src/sleuth.c +++ b/src/sleuth.c @@ -27,7 +27,7 @@ struct gargoyle_opt *gargoyle_find_emblem(uint16_t optc, struct gargoyle_opt *op for(; optc; optc -= 1, optv += 1) { if(emblem == optv->emblem) { return optv; - } else if(flags & GARGOYLE_FLG_ECASE && is_eql(emblem, optv->emblem)) { + } else if(flags & GARGOYLE_FLG_ECASE && gargoyle_is_eql(emblem, optv->emblem)) { return optv; } } diff --git a/src/twine.c b/src/twine.c index 834284a..dfb3d82 100644 --- a/src/twine.c +++ b/src/twine.c @@ -2,19 +2,19 @@ #include #include -uint8_t is_sep(char tok) { +uint8_t gargoyle_is_sep(char tok) { return (tok == '_' || tok == '-'); } -uint8_t is_eql(char lhs, char rhs) { +uint8_t gargoyle_is_eql(char lhs, char rhs) { return tolower(lhs) == tolower(rhs); } uint8_t gargoyle_cmp(const char *s1, const char *s2, uint16_t len, gargoyle_flag_type flags) { while(*s1 && *s2 && len) { - if(flags & GARGOYLE_FLG_ICASE && isalpha(*s1) && is_eql(*s1, *s2)) { + if(flags & GARGOYLE_FLG_ICASE && isalpha(*s1) && gargoyle_is_eql(*s1, *s2)) { s1 += 1, s2 += 1; - } else if(flags & GARGOYLE_FLG_SYMBL && is_sep(*s1) && is_sep(*s2)) { + } else if(flags & GARGOYLE_FLG_SYMBL && gargoyle_is_sep(*s1) && gargoyle_is_sep(*s2)) { s1 += 1, s2 += 1; } else if(*s1 == *s2) { s1 += 1, s2 += 1;