71 return 1; |
71 return 1; |
72 } |
72 } |
73 |
73 |
74 /* Plaintext Highlighter */ |
74 /* Plaintext Highlighter */ |
75 |
75 |
76 void c2html_plain_highlighter(char *src, UcxBuffer *dest, c2html_highlighter_data *hd) { |
76 void c2html_plain_highlighter(char *src, UcxBuffer *dest, |
|
77 c2html_highlighter_data *hd) { |
77 while (*src && *src != '\n') { |
78 while (*src && *src != '\n') { |
78 put_htmlescaped(dest, *src); |
79 if (*src != '\r') { |
|
80 put_htmlescaped(dest, *src); |
|
81 } |
79 src++; |
82 src++; |
80 } |
83 } |
81 ucx_buffer_putc(dest, '\n'); |
84 ucx_buffer_putc(dest, '\n'); |
82 } |
85 } |
83 |
86 |
89 "long", "register", "return", "short", "signed", "sizeof", "static", |
92 "long", "register", "return", "short", "signed", "sizeof", "static", |
90 "struct", "switch", "typedef", "union", "unsigned", "void", "volatile", |
93 "struct", "switch", "typedef", "union", "unsigned", "void", "volatile", |
91 "while", NULL |
94 "while", NULL |
92 }; |
95 }; |
93 |
96 |
94 void c2html_c_highlighter(char *src, UcxBuffer *dest, c2html_highlighter_data *hd) { |
97 void c2html_c_highlighter(char *src, UcxBuffer *dest, |
|
98 c2html_highlighter_data *hd) { |
95 /* reset buffers without clearing them */ |
99 /* reset buffers without clearing them */ |
96 hd->primary_buffer->size = hd->primary_buffer->pos = 0; |
100 hd->primary_buffer->size = hd->primary_buffer->pos = 0; |
97 hd->secondary_buffer->size = hd->secondary_buffer->pos = 0; |
101 hd->secondary_buffer->size = hd->secondary_buffer->pos = 0; |
98 |
102 |
99 /* alias the buffers for better handling */ |
103 /* alias the buffers for better handling */ |
232 "transient", "catch", "extends", "int", "short", "try", "char", "final", |
237 "transient", "catch", "extends", "int", "short", "try", "char", "final", |
233 "interface", "static", "void", "class", "finally", "long", "strictfp", |
238 "interface", "static", "void", "class", "finally", "long", "strictfp", |
234 "volatile", "const", "float", "native", "super", "while", NULL |
239 "volatile", "const", "float", "native", "super", "while", NULL |
235 }; |
240 }; |
236 |
241 |
237 void c2html_java_highlighter(char *src, UcxBuffer *dest, c2html_highlighter_data *hd) { |
242 void c2html_java_highlighter(char *src, UcxBuffer *dest, |
|
243 c2html_highlighter_data *hd) { |
238 /* reset buffers without clearing them */ |
244 /* reset buffers without clearing them */ |
239 hd->primary_buffer->size = hd->primary_buffer->pos = 0; |
245 hd->primary_buffer->size = hd->primary_buffer->pos = 0; |
240 hd->secondary_buffer->size = hd->secondary_buffer->pos = 0; |
246 hd->secondary_buffer->size = hd->secondary_buffer->pos = 0; |
241 |
247 |
242 /* alias the buffers for better handling */ |
248 /* alias the buffers for better handling */ |