source: documentation/trunk/packages/dokuwiki-2011-05-25a/inc/geshi/c.php@ 25027

Last change on this file since 25027 was 25027, checked in by jmt12, 12 years ago

Adding the packages directory, and within it a configured version of dokuwiki all ready to run

File size: 6.8 KB
Line 
1<?php
2/*************************************************************************************
3 * c.php
4 * -----
5 * Author: Nigel McNie ([email protected])
6 * Contributors:
7 * - Jack Lloyd ([email protected])
8 * - Michael Mol ([email protected])
9 * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
10 * Release Version: 1.0.8.8
11 * Date Started: 2004/06/04
12 *
13 * C language file for GeSHi.
14 *
15 * CHANGES
16 * -------
17 * 2009/01/22 (1.0.8.3)
18 * - Made keywords case-sensitive.
19 * 2008/05/23 (1.0.7.22)
20 * - Added description of extra language features (SF#1970248)
21 * 2004/XX/XX (1.0.4)
22 * - Added a couple of new keywords (Jack Lloyd)
23 * 2004/11/27 (1.0.3)
24 * - Added support for multiple object splitters
25 * 2004/10/27 (1.0.2)
26 * - Added support for URLs
27 * 2004/08/05 (1.0.1)
28 * - Added support for symbols
29 * 2004/07/14 (1.0.0)
30 * - First Release
31 *
32 * TODO (updated 2009/02/08)
33 * -------------------------
34 * - Get a list of inbuilt functions to add (and explore C more
35 * to complete this rather bare language file
36 *
37 *************************************************************************************
38 *
39 * This file is part of GeSHi.
40 *
41 * GeSHi is free software; you can redistribute it and/or modify
42 * it under the terms of the GNU General Public License as published by
43 * the Free Software Foundation; either version 2 of the License, or
44 * (at your option) any later version.
45 *
46 * GeSHi is distributed in the hope that it will be useful,
47 * but WITHOUT ANY WARRANTY; without even the implied warranty of
48 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49 * GNU General Public License for more details.
50 *
51 * You should have received a copy of the GNU General Public License
52 * along with GeSHi; if not, write to the Free Software
53 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
54 *
55 ************************************************************************************/
56
57$language_data = array (
58 'LANG_NAME' => 'C',
59 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
60 'COMMENT_MULTI' => array('/*' => '*/'),
61 'COMMENT_REGEXP' => array(
62 //Multiline-continued single-line comments
63 1 => '/\/\/(?:\\\\\\\\|\\\\\\n|.)*$/m',
64 //Multiline-continued preprocessor define
65 2 => '/#(?:\\\\\\\\|\\\\\\n|.)*$/m'
66 ),
67 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
68 'QUOTEMARKS' => array("'", '"'),
69 'ESCAPE_CHAR' => '',
70 'ESCAPE_REGEXP' => array(
71 //Simple Single Char Escapes
72 1 => "#\\\\[\\\\abfnrtv\'\"?\n]#i",
73 //Hexadecimal Char Specs
74 2 => "#\\\\x[\da-fA-F]{2}#",
75 //Hexadecimal Char Specs
76 3 => "#\\\\u[\da-fA-F]{4}#",
77 //Hexadecimal Char Specs
78 4 => "#\\\\U[\da-fA-F]{8}#",
79 //Octal Char Specs
80 5 => "#\\\\[0-7]{1,3}#"
81 ),
82 'NUMBERS' =>
83 GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_INT_CSTYLE | GESHI_NUMBER_BIN_PREFIX_0B |
84 GESHI_NUMBER_OCT_PREFIX | GESHI_NUMBER_HEX_PREFIX | GESHI_NUMBER_FLT_NONSCI |
85 GESHI_NUMBER_FLT_NONSCI_F | GESHI_NUMBER_FLT_SCI_SHORT | GESHI_NUMBER_FLT_SCI_ZERO,
86 'KEYWORDS' => array(
87 1 => array(
88 'if', 'return', 'while', 'case', 'continue', 'default',
89 'do', 'else', 'for', 'switch', 'goto'
90 ),
91 2 => array(
92 'null', 'false', 'break', 'true', 'function', 'enum', 'extern', 'inline'
93 ),
94 3 => array(
95 'printf', 'cout'
96 ),
97 4 => array(
98 'auto', 'char', 'const', 'double', 'float', 'int', 'long',
99 'register', 'short', 'signed', 'sizeof', 'static', 'struct',
100 'typedef', 'union', 'unsigned', 'void', 'volatile', 'wchar_t',
101
102 'int8', 'int16', 'int32', 'int64',
103 'uint8', 'uint16', 'uint32', 'uint64',
104
105 'int_fast8_t', 'int_fast16_t', 'int_fast32_t', 'int_fast64_t',
106 'uint_fast8_t', 'uint_fast16_t', 'uint_fast32_t', 'uint_fast64_t',
107
108 'int_least8_t', 'int_least16_t', 'int_least32_t', 'int_least64_t',
109 'uint_least8_t', 'uint_least16_t', 'uint_least32_t', 'uint_least64_t',
110
111 'int8_t', 'int16_t', 'int32_t', 'int64_t',
112 'uint8_t', 'uint16_t', 'uint32_t', 'uint64_t',
113
114 'intmax_t', 'uintmax_t', 'intptr_t', 'uintptr_t'
115 ),
116 ),
117 'SYMBOLS' => array(
118 '(', ')', '{', '}', '[', ']',
119 '+', '-', '*', '/', '%',
120 '=', '<', '>',
121 '!', '^', '&', '|',
122 '?', ':',
123 ';', ','
124 ),
125 'CASE_SENSITIVE' => array(
126 GESHI_COMMENTS => false,
127 1 => true,
128 2 => true,
129 3 => true,
130 4 => true,
131 ),
132 'STYLES' => array(
133 'KEYWORDS' => array(
134 1 => 'color: #b1b100;',
135 2 => 'color: #000000; font-weight: bold;',
136 3 => 'color: #000066;',
137 4 => 'color: #993333;'
138 ),
139 'COMMENTS' => array(
140 1 => 'color: #666666; font-style: italic;',
141 2 => 'color: #339933;',
142 'MULTI' => 'color: #808080; font-style: italic;'
143 ),
144 'ESCAPE_CHAR' => array(
145 0 => 'color: #000099; font-weight: bold;',
146 1 => 'color: #000099; font-weight: bold;',
147 2 => 'color: #660099; font-weight: bold;',
148 3 => 'color: #660099; font-weight: bold;',
149 4 => 'color: #660099; font-weight: bold;',
150 5 => 'color: #006699; font-weight: bold;',
151 'HARD' => '',
152 ),
153 'BRACKETS' => array(
154 0 => 'color: #009900;'
155 ),
156 'STRINGS' => array(
157 0 => 'color: #ff0000;'
158 ),
159 'NUMBERS' => array(
160 0 => 'color: #0000dd;',
161 GESHI_NUMBER_BIN_PREFIX_0B => 'color: #208080;',
162 GESHI_NUMBER_OCT_PREFIX => 'color: #208080;',
163 GESHI_NUMBER_HEX_PREFIX => 'color: #208080;',
164 GESHI_NUMBER_FLT_SCI_SHORT => 'color:#800080;',
165 GESHI_NUMBER_FLT_SCI_ZERO => 'color:#800080;',
166 GESHI_NUMBER_FLT_NONSCI_F => 'color:#800080;',
167 GESHI_NUMBER_FLT_NONSCI => 'color:#800080;'
168 ),
169 'METHODS' => array(
170 1 => 'color: #202020;',
171 2 => 'color: #202020;'
172 ),
173 'SYMBOLS' => array(
174 0 => 'color: #339933;'
175 ),
176 'REGEXPS' => array(
177 ),
178 'SCRIPT' => array(
179 )
180 ),
181 'URLS' => array(
182 1 => '',
183 2 => '',
184 3 => 'http://www.opengroup.org/onlinepubs/009695399/functions/{FNAMEL}.html',
185 4 => ''
186 ),
187 'OOLANG' => true,
188 'OBJECT_SPLITTERS' => array(
189 1 => '.',
190 2 => '::'
191 ),
192 'REGEXPS' => array(
193 ),
194 'STRICT_MODE_APPLIES' => GESHI_NEVER,
195 'SCRIPT_DELIMITERS' => array(
196 ),
197 'HIGHLIGHT_STRICT_BLOCK' => array(
198 ),
199 'TAB_WIDTH' => 4
200);
201
202?>
Note: See TracBrowser for help on using the repository browser.