Mon, 24 Apr 2023 20:54:38 +0200
upgrade to ucx 3.0
21 | 1 | /* |
2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. | |
3 | * | |
35 | 4 | * Copyright 2016 Mike Becker. All rights reserved. |
21 | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions are met: | |
8 | * | |
9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | |
11 | * | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | |
15 | * | |
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | |
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
26 | * POSSIBILITY OF SUCH DAMAGE. | |
27 | * | |
28 | */ | |
29 | ||
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
30 | #include "highlighter.h" |
21 | 31 | |
55
bf54085ce341
adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
54
diff
changeset
|
32 | #include <stdlib.h> |
bf54085ce341
adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
54
diff
changeset
|
33 | #include <stdio.h> |
bf54085ce341
adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
54
diff
changeset
|
34 | #include <string.h> |
bf54085ce341
adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
54
diff
changeset
|
35 | #include <ctype.h> |
51
f25ba6fd7a08
replaces stack buffers with UCX buffers
Mike Becker <universe@uap-core.de>
parents:
49
diff
changeset
|
36 | |
66 | 37 | #include <cx/string.h> |
38 | ||
39 | static void put_htmlescaped(CxBuffer *dest, char c) { | |
21 | 40 | if (c == '>') { |
66 | 41 | cxBufferPutString(dest, ">"); |
21 | 42 | } else if (c == '<') { |
66 | 43 | cxBufferPutString(dest, "<"); |
54
b3f24e23bc25
highlighter can now handle files which do not end with a blank line
Mike Becker <universe@uap-core.de>
parents:
53
diff
changeset
|
44 | } else if (c) { |
66 | 45 | cxBufferPut(dest, c); |
21 | 46 | } |
48
b2724c711203
highlighter now use the UcxBuffer API for writing to the destination buffer
Mike Becker <universe@uap-core.de>
parents:
47
diff
changeset
|
47 | } |
21 | 48 | |
66 | 49 | static void put_htmlescapedstr(CxBuffer *dest, cxstring s) { |
48
b2724c711203
highlighter now use the UcxBuffer API for writing to the destination buffer
Mike Becker <universe@uap-core.de>
parents:
47
diff
changeset
|
50 | for (int i = 0 ; i < s.length ; i++) { |
b2724c711203
highlighter now use the UcxBuffer API for writing to the destination buffer
Mike Becker <universe@uap-core.de>
parents:
47
diff
changeset
|
51 | put_htmlescaped(dest, s.ptr[i]); |
b2724c711203
highlighter now use the UcxBuffer API for writing to the destination buffer
Mike Becker <universe@uap-core.de>
parents:
47
diff
changeset
|
52 | } |
21 | 53 | } |
54 | ||
66 | 55 | static int check_keyword(cxstring word, const char** keywords) { |
21 | 56 | for (int i = 0 ; keywords[i] ; i++) { |
66 | 57 | if (cx_strcmp(word, cx_str(keywords[i])) == 0) { |
21 | 58 | return 1; |
59 | } | |
60 | } | |
61 | return 0; | |
62 | } | |
63 | ||
66 | 64 | static int check_capsonly(cxstring word) { |
47
c39ecbbca7c0
words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents:
36
diff
changeset
|
65 | for (size_t i = 0 ; i < word.length ; i++) { |
c39ecbbca7c0
words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents:
36
diff
changeset
|
66 | if (!isupper(word.ptr[i]) && !isdigit(word.ptr[i]) |
c39ecbbca7c0
words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents:
36
diff
changeset
|
67 | && word.ptr[i] != '_') { |
21 | 68 | return 0; |
69 | } | |
70 | } | |
71 | return 1; | |
72 | } | |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
73 | |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
74 | /* Plaintext Highlighter */ |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
75 | |
66 | 76 | void c2html_plain_highlighter(char const *src, CxBuffer *dest, |
57
eba880c1705c
improves API and adds functions for strings
Mike Becker <universe@uap-core.de>
parents:
55
diff
changeset
|
77 | c2html_highlighter_data *hd) { |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
78 | while (*src && *src != '\n') { |
57
eba880c1705c
improves API and adds functions for strings
Mike Becker <universe@uap-core.de>
parents:
55
diff
changeset
|
79 | if (*src != '\r') { |
eba880c1705c
improves API and adds functions for strings
Mike Becker <universe@uap-core.de>
parents:
55
diff
changeset
|
80 | put_htmlescaped(dest, *src); |
eba880c1705c
improves API and adds functions for strings
Mike Becker <universe@uap-core.de>
parents:
55
diff
changeset
|
81 | } |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
82 | src++; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
83 | } |
66 | 84 | cxBufferPut(dest, '\n'); |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
85 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
86 | |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
87 | /* C Highlighter */ |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
88 | |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
89 | static const char* ckeywords[] = { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
90 | "auto", "break", "case", "char", "const", "continue", "default", "do", |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
91 | "double", "else", "enum", "extern", "float", "for", "goto", "if", "int", |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
92 | "long", "register", "return", "short", "signed", "sizeof", "static", |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
93 | "struct", "switch", "typedef", "union", "unsigned", "void", "volatile", |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
94 | "while", NULL |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
95 | }; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
96 | |
66 | 97 | void c2html_c_highlighter(char const *src, CxBuffer *dest, |
57
eba880c1705c
improves API and adds functions for strings
Mike Becker <universe@uap-core.de>
parents:
55
diff
changeset
|
98 | c2html_highlighter_data *hd) { |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
99 | /* reset buffers without clearing them */ |
66 | 100 | hd->primary_buffer.size = hd->primary_buffer.pos = 0; |
101 | hd->secondary_buffer.size = hd->secondary_buffer.pos = 0; | |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
102 | |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
103 | /* alias the buffers for better handling */ |
66 | 104 | CxBuffer *wbuf = &hd->primary_buffer; |
105 | CxBuffer *ifilebuf = &hd->secondary_buffer; | |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
106 | |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
107 | /* local information */ |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
108 | size_t sp = (size_t)-1; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
109 | int isstring = 0, iscomment = 0, isinclude = 0, parseinclude = 0; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
110 | char quote = '\0'; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
111 | int isescaping = 0; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
112 | |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
113 | /* continue a multi line comment highlighting */ |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
114 | if (hd->multiline_comment) { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
115 | iscomment = 1; |
66 | 116 | cxBufferPutString(dest, "<span class=\"c2html-comment\">"); |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
117 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
118 | |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
119 | char c; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
120 | do { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
121 | c = src[++sp]; |
57
eba880c1705c
improves API and adds functions for strings
Mike Becker <universe@uap-core.de>
parents:
55
diff
changeset
|
122 | if (c == '\r') continue; |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
123 | |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
124 | /* comments */ |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
125 | if (!isstring && c == '/') { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
126 | if (hd->multiline_comment && sp > 0 && src[sp-1] == '*') { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
127 | iscomment = 0; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
128 | hd->multiline_comment = 0; |
66 | 129 | cxBufferPutString(dest, "/</span>"); |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
130 | continue; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
131 | } else if (!iscomment && (src[sp+1] == '/' || src[sp+1] == '*')) { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
132 | iscomment = 1; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
133 | hd->multiline_comment = (src[sp+1] == '*'); |
66 | 134 | cxBufferPutString(dest, "<span class=\"c2html-comment\">"); |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
135 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
136 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
137 | |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
138 | if (iscomment) { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
139 | if (c == '\n') { |
66 | 140 | cxBufferPutString(dest, "</span>\n"); |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
141 | } else { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
142 | put_htmlescaped(dest, c); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
143 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
144 | } else if (isinclude) { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
145 | if (c == '<') { |
66 | 146 | cxBufferPutString(dest, |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
147 | "<span class=\"c2html-stdinclude\"><"); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
148 | } else if (c == '\"') { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
149 | if (parseinclude) { |
66 | 150 | cxBufferPutString(dest, "\">"); |
151 | cxBufferWrite(ifilebuf->space, 1, ifilebuf->size, dest); | |
152 | cxBufferPutString(dest, "\"</a>"); | |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
153 | parseinclude = 0; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
154 | } else { |
66 | 155 | cxBufferPutString(dest, |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
156 | "<a class=\"c2html-userinclude\" href=\""); |
66 | 157 | cxBufferPut(ifilebuf, '\"'); |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
158 | parseinclude = 1; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
159 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
160 | } else if (c == '>') { |
66 | 161 | cxBufferPutString(dest, "></span>"); |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
162 | } else { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
163 | if (parseinclude) { |
66 | 164 | cxBufferPut(ifilebuf, c); |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
165 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
166 | put_htmlescaped(dest, c); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
167 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
168 | } else { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
169 | /* strings */ |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
170 | if (!isescaping && (c == '\'' || c == '\"')) { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
171 | if (isstring) { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
172 | put_htmlescaped(dest, c); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
173 | if (c == quote) { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
174 | isstring = 0; |
66 | 175 | cxBufferPutString(dest, "</span>"); |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
176 | } else { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
177 | put_htmlescaped(dest, c); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
178 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
179 | } else { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
180 | isstring = 1; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
181 | quote = c; |
66 | 182 | cxBufferPutString(dest, "<span class=\"c2html-string\">"); |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
183 | put_htmlescaped(dest, c); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
184 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
185 | } else { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
186 | if (isstring) { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
187 | put_htmlescaped(dest, c); |
54
b3f24e23bc25
highlighter can now handle files which do not end with a blank line
Mike Becker <universe@uap-core.de>
parents:
53
diff
changeset
|
188 | } else if (isalnum(c) || c == '_' || c == '#') { |
b3f24e23bc25
highlighter can now handle files which do not end with a blank line
Mike Becker <universe@uap-core.de>
parents:
53
diff
changeset
|
189 | /* buffer the current word */ |
66 | 190 | cxBufferPut(wbuf, c); |
54
b3f24e23bc25
highlighter can now handle files which do not end with a blank line
Mike Becker <universe@uap-core.de>
parents:
53
diff
changeset
|
191 | } else { |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
192 | /* write buffered word, if any */ |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
193 | if (wbuf->size > 0) { |
66 | 194 | cxstring word = cx_strn(wbuf->space, wbuf->size); |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
195 | int closespan = 1; |
66 | 196 | cxstring typesuffix = CX_STR("_t"); |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
197 | if (check_keyword(word, ckeywords)) { |
66 | 198 | cxBufferPutString(dest, |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
199 | "<span class=\"c2html-keyword\">"); |
66 | 200 | } else if (cx_strsuffix(word, typesuffix)) { |
201 | cxBufferPutString(dest, | |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
202 | "<span class=\"c2html-type\">"); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
203 | } else if (word.ptr[0] == '#') { |
66 | 204 | isinclude = !cx_strcmp(word, CX_STR("#include")); |
205 | cxBufferPutString(dest, | |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
206 | "<span class=\"c2html-directive\">"); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
207 | } else if (check_capsonly(word)) { |
66 | 208 | cxBufferPutString(dest, |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
209 | "<span class=\"c2html-macroconst\">"); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
210 | } else { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
211 | closespan = 0; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
212 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
213 | put_htmlescapedstr(dest, word); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
214 | if (closespan) { |
66 | 215 | cxBufferPutString(dest, "</span>"); |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
216 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
217 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
218 | wbuf->pos = wbuf->size = 0; /* reset word buffer */ |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
219 | |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
220 | /* write current character */ |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
221 | put_htmlescaped(dest, c); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
222 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
223 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
224 | |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
225 | isescaping = !isescaping & (c == '\\'); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
226 | } |
54
b3f24e23bc25
highlighter can now handle files which do not end with a blank line
Mike Becker <universe@uap-core.de>
parents:
53
diff
changeset
|
227 | } while (c && c != '\n'); |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
228 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
229 | |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
230 | /* Java Highlighter */ |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
231 | |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
232 | static const char* jkeywords[] = { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
233 | "abstract", "continue", "for", "new", "switch", "assert", "default", "goto", |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
234 | "package", "synchronized", "boolean", "do", "if", "private", "this", |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
235 | "break", "double", "implements", "protected", "throw", "byte", "else", |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
236 | "import", "public", "throws", "case", "enum", "instanceof", "return", |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
237 | "transient", "catch", "extends", "int", "short", "try", "char", "final", |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
238 | "interface", "static", "void", "class", "finally", "long", "strictfp", |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
239 | "volatile", "const", "float", "native", "super", "while", NULL |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
240 | }; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
241 | |
66 | 242 | void c2html_java_highlighter(char const *src, CxBuffer *dest, |
57
eba880c1705c
improves API and adds functions for strings
Mike Becker <universe@uap-core.de>
parents:
55
diff
changeset
|
243 | c2html_highlighter_data *hd) { |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
244 | /* reset buffers without clearing them */ |
66 | 245 | hd->primary_buffer.size = hd->primary_buffer.pos = 0; |
246 | hd->secondary_buffer.size = hd->secondary_buffer.pos = 0; | |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
247 | |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
248 | /* alias the buffers for better handling */ |
66 | 249 | CxBuffer *wbuf = &hd->primary_buffer; |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
250 | |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
251 | /* local information */ |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
252 | size_t sp = (size_t)-1; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
253 | int isstring = 0, iscomment = 0, isimport = 0; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
254 | char quote = '\0'; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
255 | int isescaping = 0; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
256 | |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
257 | if (hd->multiline_comment) { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
258 | iscomment = 1; |
66 | 259 | cxBufferPutString(dest, "<span class=\"c2html-comment\">"); |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
260 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
261 | |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
262 | char c; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
263 | do { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
264 | c = src[++sp]; |
57
eba880c1705c
improves API and adds functions for strings
Mike Becker <universe@uap-core.de>
parents:
55
diff
changeset
|
265 | if (c == '\r') continue; |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
266 | |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
267 | /* comments */ |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
268 | if (!isstring && c == '/') { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
269 | if (hd->multiline_comment && sp > 0 && src[sp-1] == '*') { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
270 | iscomment = 0; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
271 | hd->multiline_comment = 0; |
66 | 272 | cxBufferPutString(dest, "/</span>"); |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
273 | continue; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
274 | } else if (!iscomment && (src[sp+1] == '/' || src[sp+1] == '*')) { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
275 | iscomment = 1; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
276 | hd->multiline_comment = (src[sp+1] == '*'); |
66 | 277 | cxBufferPutString(dest, "<span class=\"c2html-comment\">"); |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
278 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
279 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
280 | |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
281 | if (iscomment) { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
282 | if (c == '\n') { |
66 | 283 | cxBufferPutString(dest, "</span>\n"); |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
284 | } else { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
285 | put_htmlescaped(dest, c); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
286 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
287 | } else if (isimport) { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
288 | /* TODO: local imports */ |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
289 | } else { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
290 | /* strings */ |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
291 | if (!isescaping && (c == '\'' || c == '\"')) { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
292 | if (isstring) { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
293 | put_htmlescaped(dest, c); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
294 | if (c == quote) { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
295 | isstring = 0; |
66 | 296 | cxBufferPutString(dest, "</span>"); |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
297 | } else { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
298 | put_htmlescaped(dest, c); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
299 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
300 | } else { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
301 | isstring = 1; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
302 | quote = c; |
66 | 303 | cxBufferPutString(dest, |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
304 | "<span class=\"c2html-string\">"); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
305 | put_htmlescaped(dest, c); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
306 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
307 | } else { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
308 | if (isstring) { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
309 | put_htmlescaped(dest, c); |
54
b3f24e23bc25
highlighter can now handle files which do not end with a blank line
Mike Becker <universe@uap-core.de>
parents:
53
diff
changeset
|
310 | } else if (isalnum(c) || c == '_' || c == '@') { |
b3f24e23bc25
highlighter can now handle files which do not end with a blank line
Mike Becker <universe@uap-core.de>
parents:
53
diff
changeset
|
311 | /* buffer the current word */ |
66 | 312 | cxBufferPut(wbuf, c); |
54
b3f24e23bc25
highlighter can now handle files which do not end with a blank line
Mike Becker <universe@uap-core.de>
parents:
53
diff
changeset
|
313 | } else { |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
314 | /* write buffered word, if any */ |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
315 | if (wbuf->size > 0) { |
66 | 316 | cxstring word = cx_strn(wbuf->space, wbuf->size); |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
317 | int closespan = 1; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
318 | if (check_keyword(word, jkeywords)) { |
66 | 319 | cxBufferPutString(dest, |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
320 | "<span class=\"c2html-keyword\">"); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
321 | } else if (isupper(word.ptr[0])) { |
66 | 322 | cxBufferPutString(dest, |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
323 | "<span class=\"c2html-type\">"); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
324 | } else if (word.ptr[0] == '@') { |
66 | 325 | cxBufferPutString(dest, |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
326 | "<span class=\"c2html-directive\">"); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
327 | } else if (check_capsonly(word)) { |
66 | 328 | cxBufferPutString(dest, |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
329 | "<span class=\"c2html-macroconst\">"); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
330 | } else { |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
331 | closespan = 0; |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
332 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
333 | put_htmlescapedstr(dest, word); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
334 | |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
335 | if (closespan) { |
66 | 336 | cxBufferPutString(dest, "</span>"); |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
337 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
338 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
339 | wbuf->pos = wbuf->size = 0; /* reset buffer */ |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
340 | |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
341 | /* write current character */ |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
342 | put_htmlescaped(dest, c); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
343 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
344 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
345 | |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
346 | isescaping = !isescaping & (c == '\\'); |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
347 | } |
54
b3f24e23bc25
highlighter can now handle files which do not end with a blank line
Mike Becker <universe@uap-core.de>
parents:
53
diff
changeset
|
348 | } while (c && c != '\n'); |
52
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
349 | } |
33ded421c512
merges all highlighter functions into one highlighter module
Mike Becker <universe@uap-core.de>
parents:
51
diff
changeset
|
350 |