first commit. dokuwiki.
[h2N7SspZmY.git] / inc / geshi / klonec.php
blob03d64a166f0e9336bebc8b03a3bc19c452bf70a1
1 <?php
2 /*************************************************************************************
3 * klonec.php
4 * --------
5 * Author: AUGER Mickael
6 * Copyright: Synchronic
7 * Release Version: 1.0.8.4
8 * Date Started: 2008/04/16
10 * KLone with C language file for GeSHi.
12 * CHANGES
13 * -------
14 * 2008/04/16 (1.0.8)
15 * - First Release
17 * TODO (updated 2008/04/16)
18 * -------------------------
19 * A tester et a completer si besoin
20 *************************************************************************************
22 * This file is part of GeSHi.
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.
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.
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
38 ************************************************************************************/
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', 'class', 'continue', 'default',
50 'do', 'else', 'for', 'switch', 'goto',
51 'null', 'break', 'true', 'enum', 'extern', 'inline', 'false'
53 2 => array(//mots-cles KLone
54 'out', 'request', 'response',
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'
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'
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'
93 6 => array(//mots-cles HTML
94 'a', 'abbr', 'acronym', 'address', 'applet',
96 'base', 'basefont', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'b',
98 'caption', 'center', 'cite', 'code', 'colgroup', 'col',
100 'dd', 'del', 'dfn', 'dir', 'div', 'dl', 'dt',
102 'em',
104 'fieldset', 'font', 'form', 'frame', 'frameset',
106 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'hr', 'html',
108 'iframe', 'ilayer', 'img', 'input', 'ins', 'isindex', 'i',
110 'kbd',
112 'label', 'legend', 'link', 'li',
114 'map', 'meta',
116 'noframes', 'noscript',
118 'object', 'ol', 'optgroup', 'option',
120 'param', 'pre', 'p',
122 'q',
124 'samp', 'script', 'select', 'small', 'span', 'strike', 'strong', 'style', 'sub', 'sup', 's',
126 'table', 'tbody', 'td', 'textarea', 'text', 'tfoot', 'thead', 'th', 'title', 'tr', 'tt',
128 'ul', 'u',
130 'var',
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'
154 'SYMBOLS' => array(
155 1 => array(
156 '<%=', '<%!', '<%', '%>'
158 0 => array(
159 '(', ')', '[', ']', '{', '}',
160 '!', '%', '&', '|', '/',
161 '<', '>',
162 '=', '-', '+', '*',
163 '.', ':', ',', ';', '^'
166 'CASE_SENSITIVE' => array(
167 GESHI_COMMENTS => false,
168 1 => false,
169 2 => false,
170 3 => false,
171 4 => false,
172 5 => false,
173 6 => false,
174 7 => false
176 'STYLES' => array(
177 'KEYWORDS' => array(
178 1 => 'color: #b1b100; font-weight: bold;',//pour les mots-cles C
179 2 => 'color: #000000; font-weight: bold;',//pour les mots-cles KLone
180 3 => 'color: #6600FF;',//pour les fonctions C
181 4 => 'color: #6600FF;',//pour les fonctions Klone
182 5 => 'color: #0099FF; font-weight: bold;',//pour les types C
183 6 => 'color: #990099; font-weight: bold;',//pour les mots-cles HTML
184 7 => 'color: #000066;'//pour les autres mots-cles HTML
186 'COMMENTS' => array(
187 1 => 'color: #808080; font-style: italic;',//commentaire sur une ligne C et KLone
188 2 => 'color: #339933;',//pour les #... en C
189 'MULTI' => 'color: #808080; font-style: italic;'//commentaire sur plusieurs lignes C et KLone
191 'ESCAPE_CHAR' => array(
192 0 => 'color: #000099; font-weight: bold;'
194 'BRACKETS' => array(
195 0 => 'color: #000000;'
197 'STRINGS' => array(
198 0 => 'color: #ff0000;'
200 'NUMBERS' => array(
201 0 => 'color: #cc66cc;'
203 'METHODS' => array(
204 1 => 'color: #006600;',
205 2 => 'color: #006600;'
207 'SYMBOLS' => array(
208 0 => 'color: #000000;',
209 1 => 'color: #000000; font-weight: bold;'
211 'REGEXPS' => array(),
212 'SCRIPT' => array(
213 0 => 'background-color:#ffccff; font-weight: bold; color:#000000;',
214 1 => '',
215 2 => '',
216 3 => 'color: #00bbdd; font-weight: bold;',
217 4 => 'color: #ddbb00;',
218 5 => 'color: #009900;'
221 'URLS' => array(
222 1 => '',
223 2 => '',
224 3 => 'http://www.opengroup.org/onlinepubs/009695399/functions/{FNAMEL}.html',
225 4 => 'http://www.koanlogic.com/klone/api/html/globals.html',
226 5 => '',
227 6 => 'http://december.com/html/4/element/{FNAMEL}.html',
228 7 => ''
230 'OOLANG' => true,
231 'OBJECT_SPLITTERS' => array(
232 1 => '.',
233 2 => '::'
235 'REGEXPS' => array(
237 'STRICT_MODE_APPLIES' => GESHI_ALWAYS,
238 'SCRIPT_DELIMITERS' => array(
239 //delimiteurs pour KLone
240 0 => array(
241 '<%=' => '%>'
243 1 => array(
244 '<%!' => '%>'
246 2 => array(
247 '<%' => '%>'
249 //delimiteur pour HTML
250 3 => array(
251 '<!DOCTYPE' => '>'
253 4 => array(
254 '&' => ';'
256 5 => array(
257 '<' => '>'
260 'HIGHLIGHT_STRICT_BLOCK' => array(
261 0 => false,
262 1 => true,
263 2 => true,
264 3 => false,
265 4 => false,
266 5 => true
268 'TAB_WIDTH' => 4,
269 'PARSER_CONTROL' => array(
270 'KEYWORDS' => array(
271 6 => array(
272 'DISALLOWED_BEFORE' => '(?<=&lt;|&lt;\/)',
273 'DISALLOWED_AFTER' => '(?=\s|\/|&gt;)',
275 7 => array(
276 'DISALLOWED_AFTER' => '(?=\s*=)',