28 */ |
28 */ |
29 |
29 |
30 #ifndef CODEGENS_H |
30 #ifndef CODEGENS_H |
31 #define CODEGENS_H |
31 #define CODEGENS_H |
32 |
32 |
33 #include <stdlib.h> |
|
34 #include <stdio.h> |
|
35 #include <string.h> |
|
36 #include <ctype.h> |
|
37 #include "ucx/string.h" |
|
38 #include "ucx/buffer.h" |
33 #include "ucx/buffer.h" |
39 #include "ucx/utils.h" |
|
40 |
34 |
41 #ifdef __cplusplus |
35 #ifdef __cplusplus |
42 extern "C" { |
36 extern "C" { |
43 #endif |
37 #endif |
44 |
38 |
45 typedef struct { |
39 typedef struct { |
46 int multiline_comment; |
40 int multiline_comment; |
47 UcxBuffer* primary_buffer; |
41 UcxBuffer* primary_buffer; |
48 UcxBuffer* secondary_buffer; |
42 UcxBuffer* secondary_buffer; |
49 } HighlighterData; |
43 } c2html_highlighter_data; |
50 |
44 |
51 HighlighterData* new_highlighter_data(); |
45 #define C2HTML_HIGHLIGHTER_SIGNATURE \ |
52 void free_highlighter_data(HighlighterData*); |
46 char*,UcxBuffer*, c2html_highlighter_data* |
53 |
47 |
54 typedef void(*highlighter_func)(char*,UcxBuffer*,HighlighterData*); |
48 typedef void(*c2html_highlighter_func)(C2HTML_HIGHLIGHTER_SIGNATURE); |
55 |
49 |
56 void plain_highlighter(char *src, UcxBuffer *dest, HighlighterData *hd); |
50 void c2html_plain_highlighter(C2HTML_HIGHLIGHTER_SIGNATURE); |
57 void c_highlighter(char *src, UcxBuffer *dest, HighlighterData *hd); |
51 void c2html_c_highlighter(C2HTML_HIGHLIGHTER_SIGNATURE); |
58 void java_highlighter(char *src, UcxBuffer *dest, HighlighterData *hd); |
52 void c2html_java_highlighter(C2HTML_HIGHLIGHTER_SIGNATURE); |
59 |
53 |
60 #ifdef __cplusplus |
54 #ifdef __cplusplus |
61 } |
55 } |
62 #endif |
56 #endif |
63 |
57 |