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 |
1.1 --- a/src/c2html.c Fri Mar 04 14:48:28 2016 +0100 1.2 +++ b/src/c2html.c Fri Mar 04 15:02:22 2016 +0100 1.3 @@ -196,16 +196,16 @@ 1.4 1.5 void init_c_highlighter(highlighter_t *highlighter) { 1.6 memset(highlighter, 0, sizeof(highlighter_t)); 1.7 - highlighter->isdirective = iscdirective; 1.8 - highlighter->istype = isctype; 1.9 + highlighter->isdirective = check_cdirective; 1.10 + highlighter->istype = check_ctype; 1.11 highlighter->keywords = ckeywords; 1.12 highlighter->parser = cparseline; 1.13 } 1.14 1.15 void init_java_highlighter(highlighter_t *highlighter) { 1.16 memset(highlighter, 0, sizeof(highlighter_t)); 1.17 - highlighter->isdirective = isjdirective; 1.18 - highlighter->istype = isjtype; 1.19 + highlighter->isdirective = check_jdirective; 1.20 + highlighter->istype = check_jtype; 1.21 highlighter->keywords = jkeywords; 1.22 highlighter->parser = jparseline; 1.23 }
2.1 --- a/src/ccodegen.c Fri Mar 04 14:48:28 2016 +0100 2.2 +++ b/src/ccodegen.c Fri Mar 04 15:02:22 2016 +0100 2.3 @@ -39,11 +39,11 @@ 2.4 "while", NULL 2.5 }; 2.6 2.7 -int isctype(char *word, size_t len) { 2.8 +int check_ctype(char *word, size_t len) { 2.9 return (word[len-2] == '_' && word[len-1] == 't'); 2.10 } 2.11 2.12 -int iscdirective(char *word) { 2.13 +int check_cdirective(char *word) { 2.14 return (word[0] == '#'); 2.15 } 2.16 2.17 @@ -140,7 +140,7 @@ 2.18 /* interpret word int_t */ 2.19 if (wp > 0 && wp < WORDBUF_SIZE) { 2.20 int closespan = 1; 2.21 - if (iskeyword(hltr->word, hltr->keywords)) { 2.22 + if (check_keyword(hltr->word, hltr->keywords)) { 2.23 memcpy_const(dest, dp, 2.24 "<span class=\"c2html-keyword\">"); 2.25 } else if (hltr->istype(hltr->word, wp)) { 2.26 @@ -151,7 +151,7 @@ 2.27 "#include", hltr->word, WORDBUF_SIZE); 2.28 memcpy_const(dest, dp, 2.29 "<span class=\"c2html-directive\">"); 2.30 - } else if (iscapsonly(hltr->word, wp)) { 2.31 + } else if (check_capsonly(hltr->word, wp)) { 2.32 memcpy_const(dest, dp, 2.33 "<span class=\"c2html-macroconst\">"); 2.34 } else {
3.1 --- a/src/ccodegen.h Fri Mar 04 14:48:28 2016 +0100 3.2 +++ b/src/ccodegen.h Fri Mar 04 15:02:22 2016 +0100 3.3 @@ -39,8 +39,8 @@ 3.4 3.5 extern const char* ckeywords[]; 3.6 3.7 -int isctype(char *word, size_t len); 3.8 -int iscdirective(char *word); 3.9 +int check_ctype(char *word, size_t len); 3.10 +int check_cdirective(char *word); 3.11 void cparseline(char *src, char *dest, highlighter_t *hltr); 3.12 3.13 #ifdef __cplusplus
4.1 --- a/src/codegens.c Fri Mar 04 14:48:28 2016 +0100 4.2 +++ b/src/codegens.c Fri Mar 04 15:02:22 2016 +0100 4.3 @@ -44,7 +44,7 @@ 4.4 return dp; 4.5 } 4.6 4.7 -int iskeyword(char *word, const char** keywords) { 4.8 +int check_keyword(char *word, const char** keywords) { 4.9 for (int i = 0 ; keywords[i] ; i++) { 4.10 if (strncmp(keywords[i], word, WORDBUF_SIZE) == 0) { 4.11 return 1; 4.12 @@ -53,7 +53,7 @@ 4.13 return 0; 4.14 } 4.15 4.16 -int iscapsonly(char *word, size_t wp) { 4.17 +int check_capsonly(char *word, size_t wp) { 4.18 for (size_t i = 0 ; i < wp ; i++) { 4.19 if (!isupper(word[i]) && !isdigit(word[i]) && word[i] != '_') { 4.20 return 0;
5.1 --- a/src/codegens.h Fri Mar 04 14:48:28 2016 +0100 5.2 +++ b/src/codegens.h Fri Mar 04 15:02:22 2016 +0100 5.3 @@ -54,8 +54,8 @@ 5.4 }; 5.5 5.6 size_t writeescapedchar(char *dest, size_t dp, char c); 5.7 -int iskeyword(char *word, const char** keywords); 5.8 -int iscapsonly(char *word, size_t wp); 5.9 +int check_keyword(char *word, const char** keywords); 5.10 +int check_capsonly(char *word, size_t wp); 5.11 5.12 5.13 #ifdef __cplusplus
6.1 --- a/src/javacodegen.c Fri Mar 04 14:48:28 2016 +0100 6.2 +++ b/src/javacodegen.c Fri Mar 04 15:02:22 2016 +0100 6.3 @@ -41,11 +41,11 @@ 6.4 "volatile", "const", "float", "native", "super", "while", NULL 6.5 }; 6.6 6.7 -int isjtype(char *word, size_t len) { 6.8 +int check_jtype(char *word, size_t len) { 6.9 return isupper(word[0]); 6.10 } 6.11 6.12 -int isjdirective(char *word) { 6.13 +int check_jdirective(char *word) { 6.14 return word[0] == '@'; 6.15 } 6.16 6.17 @@ -112,7 +112,7 @@ 6.18 /* interpret word int_t */ 6.19 if (wp > 0 && wp < WORDBUF_SIZE) { 6.20 int closespan = 1; 6.21 - if (iskeyword(hltr->word, hltr->keywords)) { 6.22 + if (check_keyword(hltr->word, hltr->keywords)) { 6.23 memcpy_const(dest, dp, 6.24 "<span class=\"c2html-keyword\">"); 6.25 } else if (hltr->istype(hltr->word, wp)) { 6.26 @@ -121,7 +121,7 @@ 6.27 } else if (hltr->isdirective(hltr->word)) { 6.28 memcpy_const(dest, dp, 6.29 "<span class=\"c2html-directive\">"); 6.30 - } else if (iscapsonly(hltr->word, wp)) { 6.31 + } else if (check_capsonly(hltr->word, wp)) { 6.32 memcpy_const(dest, dp, 6.33 "<span class=\"c2html-macroconst\">"); 6.34 } else {
7.1 --- a/src/javacodegen.h Fri Mar 04 14:48:28 2016 +0100 7.2 +++ b/src/javacodegen.h Fri Mar 04 15:02:22 2016 +0100 7.3 @@ -39,8 +39,8 @@ 7.4 7.5 extern const char* jkeywords[]; 7.6 7.7 -int isjtype(char *word, size_t len); 7.8 -int isjdirective(char *word); 7.9 +int check_jtype(char *word, size_t len); 7.10 +int check_jdirective(char *word); 7.11 void jparseline(char *src, char *dest, highlighter_t *hltr); 7.12 7.13