diff -r 1f3835182aeb -r 534a4ef4143d src/ccodegen.c --- a/src/ccodegen.c Tue Aug 23 15:28:56 2016 +0200 +++ b/src/ccodegen.c Tue Aug 23 15:55:02 2016 +0200 @@ -39,18 +39,10 @@ "while", NULL }; -int check_ctype(char *word, size_t len) { - return (word[len-2] == '_' && word[len-1] == 't'); -} - -int check_cdirective(char *word) { - return (word[0] == '#'); -} - #define memcpy_const(darr,doff,str) memcpy(&(darr[doff]), str, sizeof(str)-1); \ dp += sizeof(str)-1 -void cparseline(char *src, UcxBuffer *destbuf, highlighter_t *hltr) { +void cparseline(char *src, UcxBuffer *destbuf, HighlighterData *hltr) { /* TODO: workaround for using old code with UcxBuffer */ char *dest = destbuf->space + destbuf->pos; @@ -146,13 +138,14 @@ /* interpret word int_t */ if (wp > 0 && wp < WORDBUF_SIZE) { int closespan = 1; - if (check_keyword(hltr->word, hltr->keywords)) { + if (check_keyword(hltr->word, ckeywords)) { memcpy_const(dest, dp, ""); - } else if (hltr->istype(hltr->word, wp)) { + } else if (hltr->word[wp-2] == '_' + && hltr->word[wp-1] == 't') { memcpy_const(dest, dp, ""); - } else if (hltr->isdirective(hltr->word)) { + } else if (hltr->word[0] == '#') { isinclude = !strncmp( "#include", hltr->word, WORDBUF_SIZE); memcpy_const(dest, dp,