2 /*************************************************************************************
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.
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' => '\\',
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'
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',
104 'fieldset', 'font', 'form', 'frame', 'frameset',
106 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'hr', 'html',
108 'iframe', 'ilayer', 'img', 'input', 'ins', 'isindex', 'i',
112 'label', 'legend', 'link', 'li',
116 'noframes', 'noscript',
118 'object', 'ol', 'optgroup', 'option',
124 'samp', 'script', 'select', 'small', 'span', 'strike', 'strong', 'style', 'sub', 'sup', 's',
126 'table', 'tbody', 'td', 'textarea', 'text', 'tfoot', 'thead', 'th', 'title', 'tr', 'tt',
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',
138 'face', 'for', 'frame', 'frameborder',
139 'headers', 'height', 'href', 'hreflang', 'hspace', 'http-equiv',
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',
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',
150 'valign', 'value', 'valuetype', 'version', 'vlink', 'vspace',
156 '<%=', '<%!', '<%', '%>'
159 '(', ')', '[', ']', '{', '}',
160 '!', '%', '&', '|', '/',
163 '.', ':', ',', ';', '^'
166 'CASE_SENSITIVE' => array(
167 GESHI_COMMENTS
=> false,
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
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;'
195 0 => 'color: #000000;'
198 0 => 'color: #ff0000;'
201 0 => 'color: #cc66cc;'
204 1 => 'color: #006600;',
205 2 => 'color: #006600;'
208 0 => 'color: #000000;',
209 1 => 'color: #000000; font-weight: bold;'
211 'REGEXPS' => array(),
213 0 => 'background-color:#ffccff; font-weight: bold; color:#000000;',
216 3 => 'color: #00bbdd; font-weight: bold;',
217 4 => 'color: #ddbb00;',
218 5 => 'color: #009900;'
224 3 => 'http://www.opengroup.org/onlinepubs/009695399/functions/{FNAMEL}.html',
225 4 => 'http://www.koanlogic.com/klone/api/html/globals.html',
227 6 => 'http://december.com/html/4/element/{FNAMEL}.html',
231 'OBJECT_SPLITTERS' => array(
237 'STRICT_MODE_APPLIES' => GESHI_ALWAYS
,
238 'SCRIPT_DELIMITERS' => array(
239 //delimiteurs pour KLone
249 //delimiteur pour HTML
260 'HIGHLIGHT_STRICT_BLOCK' => array(
269 'PARSER_CONTROL' => array(
272 'DISALLOWED_BEFORE' => '(?<=<|<\/)',
273 'DISALLOWED_AFTER' => '(?=\s|\/|>)',
276 'DISALLOWED_AFTER' => '(?=\s*=)',