1 | 1 | simandl | <?php |
2 | | | /************************************************************************************* |
3 | | | * klonec.php |
4 | | | * -------- |
5 | | | * Author: AUGER Mickael |
6 | | | * Copyright: Synchronic |
7 | | | * Release Version: 1.0.8.1 |
8 | | | * Date Started: 2008/04/16 |
9 | | | * |
10 | | | * KLone with C language file for GeSHi. |
11 | | | * |
12 | | | * CHANGES |
13 | | | * ------- |
14 | | | * 2008/04/16 (1.0.8) |
15 | | | * - First Release |
16 | | | * |
17 | | | * TODO (updated 2008/04/16) |
18 | | | * ------------------------- |
19 | | | * A tester et a completer si besoin |
20 | | | ************************************************************************************* |
21 | | | * |
22 | | | * This file is part of GeSHi. |
23 | | | * |
24 | | | * GeSHi is free software; you can redistribute it and/or modify |
25 | | | * it under the terms of the GNU General Public License as published by |
26 | | | * the Free Software Foundation; either version 2 of the License, or |
27 | | | * (at your option) any later version. |
28 | | | * |
29 | | | * GeSHi is distributed in the hope that it will be useful, |
30 | | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
31 | | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
32 | | | * GNU General Public License for more details. |
33 | | | * |
34 | | | * You should have received a copy of the GNU General Public License |
35 | | | * along with GeSHi; if not, write to the Free Software |
36 | | | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
37 | | | * |
38 | | | ************************************************************************************/ |
39 | | | |
40 | | | $language_data = array ( |
41 | | | 'LANG_NAME' => 'KLone C', |
42 | | | 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),//#pour precede les include de C |
43 | | | 'COMMENT_MULTI' => array('/*' => '*/', '<!--' => '-->' ),//comentaires C et KLone suivi de ceux pour HTML |
44 | | | 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, |
45 | | | 'QUOTEMARKS' => array("'", '"'), |
46 | | | 'ESCAPE_CHAR' => '\\', |
47 | | | 'KEYWORDS' => array( |
48 | | | 1 => array(//mots-cles C |
49 | | | 'if', 'return', 'while', 'case', 'continue', 'default', |
50 | | | 'do', 'else', 'for', 'switch', 'goto', |
51 | | | 'null', 'break', 'true', 'enum', 'extern', 'inline', 'false' |
52 | | | ), |
53 | | | 2 => array(//mots-cles KLone |
54 | | | '<%=', '<%!', '<%', '%>', 'out', 'request', 'response', |
55 | | | ), |
56 | | | 3 => array(//fonctions C usuelles |
57 | | | 'printf', 'malloc', 'fopen', 'fclose', 'free', 'fputs', 'fgets', 'feof', 'fwrite', |
58 | | | 'perror', 'ferror', 'qsort', 'stats', 'sscanf', 'scanf', |
59 | | | 'strdup', 'strcpy', 'strcmp', 'strncpy', 'strcasecmp', 'cat', 'strcat', 'strstr', |
60 | | | 'strlen', 'strtof', 'strtod', 'strtok', 'towlower', 'towupper', |
61 | | | 'cd', 'system', 'exit', 'exec', 'fork', 'vfork', 'kill', 'signal', 'syslog', |
62 | | | 'usleep', 'utime', 'wait', 'waitpid', 'waitid', |
63 | | | 'ceil', 'eval', 'round', 'floor', |
64 | | | 'atoi', 'atol', 'abs', 'cos', 'sin', 'tan', 'acos', 'asin', 'atan', 'exp', |
65 | | | 'time', 'ctime', 'localtime', 'asctime', 'gmtime', 'difftime', 'date' |
66 | | | ), |
67 | | | 4 => array(//fonctions KLone usuelles |
68 | | | 'request_get_cookies', 'request_get_cookie', 'request_get_args', 'request_get_arg', |
69 | | | 'request_io', 'request_get_uri', 'request_get_filename', 'request_get_query_string', 'request_get_path_info', |
70 | | | 'request_get_if_modified_since', 'request_get_http', 'request_get_client_request', |
71 | | | 'request_get_content_length', 'request_get_uploads', 'request_get_uploaded_file', |
72 | | | 'request_get_method', 'request_get_protocol', 'request_get_resolved_filename', |
73 | | | 'request_get_resolved_path_info', 'request_get_addr', 'request_get_peer_addr', |
74 | | | 'request_get_header', 'request_get_field', 'request_get_field_value', |
75 | | | 'response_set_content_encoding', 'response_disable_caching', 'response_enable_caching', |
76 | | | 'response_set_cookie', 'response_set_method', 'response_get_method', |
77 | | | 'response_print_header', 'response_set_field', 'response_del_field', |
78 | | | 'response_set_content_type', 'response_set_date', 'response_set_last_modified', |
79 | | | 'response_set_content_length', 'response_get_status', 'response_get_header', |
80 | | | 'response_io', 'response_redirect', 'response_set_status', |
81 | | | 'session_get_vars', 'session_get', 'session_set', 'session_age', 'session_clean', 'session_del', |
82 | | | 'io_type', 'io_pipe', 'io_dup', 'io_copy', 'io_seek', 'io_tell', 'io_close', |
83 | | | 'io_free', 'io_read', 'io_printf', 'io_flush', 'io_write', 'io_putc', 'io_getc', |
84 | | | 'io_get_until', 'io_gets', 'io_codec_add_head', 'io_codec_add_tail', |
85 | | | 'io_codecs_remove', 'io_name_set', 'io_name_get' |
86 | | | ), |
87 | | | 5 => array(//types C |
88 | | | 'auto', 'char', 'const', 'double', 'float', 'int', 'long', |
89 | | | 'register', 'short', 'signed', 'sizeof', 'static', 'string', 'struct', |
90 | | | 'typedef', 'union', 'unsigned', 'void', 'volatile', |
91 | | | 'wchar_t', 'time_t', 'FILE' |
92 | | | ), |
93 | | | 6 => array(//mots-cles HTML |
94 | | | 'a', 'abbr', 'acronym', 'address', 'applet', |
95 | | | |
96 | | | 'base', 'basefont', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'b', |
97 | | | |
98 | | | 'caption', 'center', 'cite', 'code', 'colgroup', 'col', |
99 | | | |
100 | | | 'dd', 'del', 'dfn', 'dir', 'div', 'dl', 'dt', |
101 | | | |
102 | | | 'em', |
103 | | | |
104 | | | 'fieldset', 'font', 'form', 'frame', 'frameset', |
105 | | | |
106 | | | 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'hr', 'html', |
107 | | | |
108 | | | 'iframe', 'ilayer', 'img', 'input', 'ins', 'isindex', 'i', |
109 | | | |
110 | | | 'kbd', |
111 | | | |
112 | | | 'label', 'legend', 'link', 'li', |
113 | | | |
114 | | | 'map', 'meta', |
115 | | | |
116 | | | 'noframes', 'noscript', |
117 | | | |
118 | | | 'object', 'ol', 'optgroup', 'option', |
119 | | | |
120 | | | 'param', 'pre', 'p', |
121 | | | |
122 | | | 'q', |
123 | | | |
124 | | | 'samp', 'script', 'select', 'small', 'span', 'strike', 'strong', 'style', 'sub', 'sup', 's', |
125 | | | |
126 | | | 'table', 'tbody', 'td', 'textarea', 'text', 'tfoot', 'thead', 'th', 'title', 'tr', 'tt', |
127 | | | |
128 | | | 'ul', 'u', |
129 | | | |
130 | | | 'var', |
131 | | | ), |
132 | | | 7 => array(//autres mots-cles HTML |
133 | | | 'abbr', 'accept-charset', 'accept', 'accesskey', 'action', 'align', 'alink', 'alt', 'archive', 'axis', |
134 | | | 'background', 'bgcolor', 'border', |
135 | | | 'cellpadding', 'cellspacing', 'char', 'charoff', 'charset', 'checked', 'cite', 'class', 'classid', 'clear', 'code', 'codebase', 'codetype', 'color', 'cols', 'colspan', 'compact', 'content', 'coords', |
136 | | | 'data', 'datetime', 'declare', 'defer', 'dir', 'disabled', |
137 | | | 'enctype', |
138 | | | 'face', 'for', 'frame', 'frameborder', |
139 | | | 'headers', 'height', 'href', 'hreflang', 'hspace', 'http-equiv', |
140 | | | 'id', 'ismap', |
141 | | | 'label', 'lang', 'language', 'link', 'longdesc', |
142 | | | 'marginheight', 'marginwidth', 'maxlength', 'media', 'method', 'multiple', |
143 | | | 'name', 'nohref', 'noresize', 'noshade', 'nowrap', |
144 | | | 'object', 'onblur', 'onchange', 'onclick', 'ondblclick', 'onfocus', 'onkeydown', 'onkeypress', 'onkeyup', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onreset', 'onselect', 'onsubmit', 'onunload', |
145 | | | 'profile', 'prompt', |
146 | | | 'readonly', 'rel', 'rev', 'rowspan', 'rows', 'rules', |
147 | | | 'scheme', 'scope', 'scrolling', 'selected', 'shape', 'size', 'span', 'src', 'standby', 'start', 'style', 'summary', |
148 | | | 'tabindex', 'target', 'text', 'title', 'type', |
149 | | | 'usemap', |
150 | | | 'valign', 'value', 'valuetype', 'version', 'vlink', 'vspace', |
151 | | | 'width' |
152 | | | ) |
153 | | | ), |
154 | | | 'SYMBOLS' => array( |
155 | | | '(', ')', '[', ']', '{', '}', |
156 | | | '!', '%', '&', '|', '/', |
157 | | | '<', '>', |
158 | | | '=', '-', '+', '*', |
159 | | | '.', ':', ',', ';', '^' |
160 | | | ), |
161 | | | 'CASE_SENSITIVE' => array( |
162 | | | GESHI_COMMENTS => false, |
163 | | | 1 => false, |
164 | | | 2 => false, |
165 | | | 3 => false, |
166 | | | 4 => false, |
167 | | | 5 => false, |
168 | | | 6 => false, |
169 | | | 7 => false |
170 | | | ), |
171 | | | 'STYLES' => array( |
172 | | | 'KEYWORDS' => array( |
173 | | | 1 => 'color: #b1b100; font-weight: bold;',//pour les mots-cles C |
174 | | | 2 => 'color: #000000; font-weight: bold;',//pour les mots-cles KLone |
175 | | | 3 => 'color: #6600FF;',//pour les fonctions C |
176 | | | 4 => 'color: #6600FF;',//pour les fonctions Klone |
177 | | | 5 => 'color: #0099FF; font-weight: bold;',//pour les types C |
178 | | | 6 => 'color: #990099; font-weight: bold;',//pour les mots-cles HTML |
179 | | | 7 => 'color: #000066;'//pour les autres mots-cles HTML |
180 | | | ), |
181 | | | 'COMMENTS' => array( |
182 | | | 1 => 'color: #808080; font-style: italic;',//commentaire sur une ligne C et KLone |
183 | | | 2 => 'color: #339933;',//pour les #... en C |
184 | | | 'MULTI' => 'color: #808080; font-style: italic;'//commentaire sur plusieurs lignes C et KLone |
185 | | | ), |
186 | | | 'ESCAPE_CHAR' => array( |
187 | | | |
188 | | | ), |
189 | | | 'BRACKETS' => array( |
190 | | | |
191 | | | ), |
192 | | | 'STRINGS' => array( |
193 | | | |
194 | | | ), |
195 | | | 'NUMBERS' => array( |
196 | | | |
197 | | | ), |
198 | | | 'METHODS' => array( |
199 | | | 1 => 'color: #006600;', |
200 | | | 2 => 'color: #006600;' |
201 | | | ), |
202 | | | 'SYMBOLS' => array( |
203 | | | |
204 | | | ), |
205 | | | 'REGEXPS' => array(), |
206 | | | 'SCRIPT' => array( |
207 | | | |
208 | | | 1 => '', |
209 | | | 2 => '', |
210 | | | 3 => 'color: #00bbdd; font-weight: bold;', |
211 | | | 4 => 'color: #ddbb00;', |
212 | | | 5 => 'color: #009900;' |
213 | | | ) |
214 | | | ), |
215 | | | 'URLS' => array( |
216 | | | 1 => '', |
217 | | | 2 => '', |
218 | | | 3 => 'http://www.opengroup.org/onlinepubs/009695399/functions/{FNAMEL}.html', |
219 | | | 4 => 'http://www.koanlogic.com/klone/api/html/globals.html', |
220 | | | 5 => '', |
221 | | | 6 => 'http://december.com/html/4/element/{FNAMEL}.html', |
222 | | | 7 => '' |
223 | | | ), |
224 | | | 'OOLANG' => true, |
225 | | | 'OBJECT_SPLITTERS' => array( |
226 | | | 1 => '.', |
227 | | | 2 => '::' |
228 | | | ), |
229 | | | 'REGEXPS' => array( |
230 | | | ), |
231 | | | 'STRICT_MODE_APPLIES' => GESHI_ALWAYS, |
232 | | | 'SCRIPT_DELIMITERS' => array( |
233 | | | //delimiteurs pour KLone |
234 | | | |
235 | | | '<%=' => '%>' |
236 | | | ), |
237 | | | 1 => array( |
238 | | | '<%!' => '%>' |
239 | | | ), |
240 | | | 2 => array( |
241 | | | '<%' => '%>' |
242 | | | ), |
243 | | | //delimiteur pour HTML |
244 | | | 3 => array( |
245 | | | '<!DOCTYPE' => '>' |
246 | | | ), |
247 | | | 4 => array( |
248 | | | '&' => ';' |
249 | | | ), |
250 | | | 5 => array( |
251 | | | '<' => '>' |
252 | | | ) |
253 | | | ), |
254 | | | 'HIGHLIGHT_STRICT_BLOCK' => array( |
255 | | | |
256 | | | 1 => true, |
257 | | | 2 => true, |
258 | | | 3 => false, |
259 | | | 4 => false, |
260 | | | 5 => true |
261 | | | ), |
262 | | | 'TAB_WIDTH' => 4, |
263 | | | 'PARSER_CONTROL' => array( |
264 | | | 'KEYWORDS' => array( |
265 | | | 6 => array( |
266 | | | 'DISALLOWED_BEFORE' => '(?<=<|<\/)', |
267 | | | 'DISALLOWED_AFTER' => '(?=\s|\/|>)', |
268 | | | ) |
269 | | | ) |
270 | | | ) |
271 | | | ); |
272 | | | |
273 | | | ?> |