Fri, 04 Mar 2016 15:02:22 +0100
fixed possible naming conflicts with is.* functions
src/c2html.c | file | annotate | diff | comparison | revisions | |
src/ccodegen.c | file | annotate | diff | comparison | revisions | |
src/ccodegen.h | file | annotate | diff | comparison | revisions | |
src/codegens.c | file | annotate | diff | comparison | revisions | |
src/codegens.h | file | annotate | diff | comparison | revisions | |
src/javacodegen.c | file | annotate | diff | comparison | revisions | |
src/javacodegen.h | file | annotate | diff | comparison | revisions |
--- a/src/c2html.c Fri Mar 04 14:48:28 2016 +0100 +++ b/src/c2html.c Fri Mar 04 15:02:22 2016 +0100 @@ -196,16 +196,16 @@ void init_c_highlighter(highlighter_t *highlighter) { memset(highlighter, 0, sizeof(highlighter_t)); - highlighter->isdirective = iscdirective; - highlighter->istype = isctype; + highlighter->isdirective = check_cdirective; + highlighter->istype = check_ctype; highlighter->keywords = ckeywords; highlighter->parser = cparseline; } void init_java_highlighter(highlighter_t *highlighter) { memset(highlighter, 0, sizeof(highlighter_t)); - highlighter->isdirective = isjdirective; - highlighter->istype = isjtype; + highlighter->isdirective = check_jdirective; + highlighter->istype = check_jtype; highlighter->keywords = jkeywords; highlighter->parser = jparseline; }
--- a/src/ccodegen.c Fri Mar 04 14:48:28 2016 +0100 +++ b/src/ccodegen.c Fri Mar 04 15:02:22 2016 +0100 @@ -39,11 +39,11 @@ "while", NULL }; -int isctype(char *word, size_t len) { +int check_ctype(char *word, size_t len) { return (word[len-2] == '_' && word[len-1] == 't'); } -int iscdirective(char *word) { +int check_cdirective(char *word) { return (word[0] == '#'); } @@ -140,7 +140,7 @@ /* interpret word int_t */ if (wp > 0 && wp < WORDBUF_SIZE) { int closespan = 1; - if (iskeyword(hltr->word, hltr->keywords)) { + if (check_keyword(hltr->word, hltr->keywords)) { memcpy_const(dest, dp, "<span class=\"c2html-keyword\">"); } else if (hltr->istype(hltr->word, wp)) { @@ -151,7 +151,7 @@ "#include", hltr->word, WORDBUF_SIZE); memcpy_const(dest, dp, "<span class=\"c2html-directive\">"); - } else if (iscapsonly(hltr->word, wp)) { + } else if (check_capsonly(hltr->word, wp)) { memcpy_const(dest, dp, "<span class=\"c2html-macroconst\">"); } else {
--- a/src/ccodegen.h Fri Mar 04 14:48:28 2016 +0100 +++ b/src/ccodegen.h Fri Mar 04 15:02:22 2016 +0100 @@ -39,8 +39,8 @@ extern const char* ckeywords[]; -int isctype(char *word, size_t len); -int iscdirective(char *word); +int check_ctype(char *word, size_t len); +int check_cdirective(char *word); void cparseline(char *src, char *dest, highlighter_t *hltr); #ifdef __cplusplus
--- a/src/codegens.c Fri Mar 04 14:48:28 2016 +0100 +++ b/src/codegens.c Fri Mar 04 15:02:22 2016 +0100 @@ -44,7 +44,7 @@ return dp; } -int iskeyword(char *word, const char** keywords) { +int check_keyword(char *word, const char** keywords) { for (int i = 0 ; keywords[i] ; i++) { if (strncmp(keywords[i], word, WORDBUF_SIZE) == 0) { return 1; @@ -53,7 +53,7 @@ return 0; } -int iscapsonly(char *word, size_t wp) { +int check_capsonly(char *word, size_t wp) { for (size_t i = 0 ; i < wp ; i++) { if (!isupper(word[i]) && !isdigit(word[i]) && word[i] != '_') { return 0;
--- a/src/codegens.h Fri Mar 04 14:48:28 2016 +0100 +++ b/src/codegens.h Fri Mar 04 15:02:22 2016 +0100 @@ -54,8 +54,8 @@ }; size_t writeescapedchar(char *dest, size_t dp, char c); -int iskeyword(char *word, const char** keywords); -int iscapsonly(char *word, size_t wp); +int check_keyword(char *word, const char** keywords); +int check_capsonly(char *word, size_t wp); #ifdef __cplusplus
--- a/src/javacodegen.c Fri Mar 04 14:48:28 2016 +0100 +++ b/src/javacodegen.c Fri Mar 04 15:02:22 2016 +0100 @@ -41,11 +41,11 @@ "volatile", "const", "float", "native", "super", "while", NULL }; -int isjtype(char *word, size_t len) { +int check_jtype(char *word, size_t len) { return isupper(word[0]); } -int isjdirective(char *word) { +int check_jdirective(char *word) { return word[0] == '@'; } @@ -112,7 +112,7 @@ /* interpret word int_t */ if (wp > 0 && wp < WORDBUF_SIZE) { int closespan = 1; - if (iskeyword(hltr->word, hltr->keywords)) { + if (check_keyword(hltr->word, hltr->keywords)) { memcpy_const(dest, dp, "<span class=\"c2html-keyword\">"); } else if (hltr->istype(hltr->word, wp)) { @@ -121,7 +121,7 @@ } else if (hltr->isdirective(hltr->word)) { memcpy_const(dest, dp, "<span class=\"c2html-directive\">"); - } else if (iscapsonly(hltr->word, wp)) { + } else if (check_capsonly(hltr->word, wp)) { memcpy_const(dest, dp, "<span class=\"c2html-macroconst\">"); } else {
--- a/src/javacodegen.h Fri Mar 04 14:48:28 2016 +0100 +++ b/src/javacodegen.h Fri Mar 04 15:02:22 2016 +0100 @@ -39,8 +39,8 @@ extern const char* jkeywords[]; -int isjtype(char *word, size_t len); -int isjdirective(char *word); +int check_jtype(char *word, size_t len); +int check_jdirective(char *word); void jparseline(char *src, char *dest, highlighter_t *hltr);