src/ccodegen.c

changeset 45
1f3835182aeb
parent 39
ac35daceb24c
child 46
534a4ef4143d
equal deleted inserted replaced
44:2b4ac35d061d 45:1f3835182aeb
48 } 48 }
49 49
50 #define memcpy_const(darr,doff,str) memcpy(&(darr[doff]), str, sizeof(str)-1); \ 50 #define memcpy_const(darr,doff,str) memcpy(&(darr[doff]), str, sizeof(str)-1); \
51 dp += sizeof(str)-1 51 dp += sizeof(str)-1
52 52
53 void cparseline(char *src, char *dest, highlighter_t *hltr) { 53 void cparseline(char *src, UcxBuffer *destbuf, highlighter_t *hltr) {
54 /* TODO: workaround for using old code with UcxBuffer */
55 char *dest = destbuf->space + destbuf->pos;
54 56
55 memset(hltr->word, 0, WORDBUF_SIZE); 57 memset(hltr->word, 0, WORDBUF_SIZE);
56 size_t wp = 0, ifp = 0, sp = (size_t)-1, dp = 0; 58 size_t wp = 0, ifp = 0, sp = (size_t)-1, dp = 0;
57 int isstring = 0, iscomment = 0, isinclude = 0, parseinclude = 0; 59 int isstring = 0, iscomment = 0, isinclude = 0, parseinclude = 0;
58 char quote = '\0'; 60 char quote = '\0';
189 191
190 isescaping = !isescaping & (c == '\\'); 192 isescaping = !isescaping & (c == '\\');
191 } 193 }
192 } while (c != '\n'); 194 } while (c != '\n');
193 dest[dp] = 0; 195 dest[dp] = 0;
196
197 /* TODO: workaround */
198 destbuf->pos += dp;
199 destbuf->size += dp;
194 } 200 }

mercurial