1 | 1 | simandl | <?php |
2 | | | /************************************************************************************* |
3 | | | * c_mac.php |
4 | | | * --------- |
5 | | | * Author: M. Uli Kusterer (witness.of.teachtext@gmx.net) |
6 | | | * Copyright: (c) 2004 M. Uli Kusterer, Nigel McNie (http://qbnz.com/highlighter/) |
7 | 3 | simandl | * Release Version: 1.0.8.3 |
8 | 1 | simandl | * Date Started: 2004/06/04 |
9 | | | * |
10 | | | * C for Macs language file for GeSHi. |
11 | | | * |
12 | | | * CHANGES |
13 | | | * ------- |
14 | | | * 2008/05/23 (1.0.7.22) |
15 | | | * - Added description of extra language features (SF#1970248) |
16 | | | * 2004/11/27 |
17 | | | * - First Release |
18 | | | * |
19 | | | * TODO (updated 2004/11/27) |
20 | | | * ------------------------- |
21 | | | * |
22 | | | ************************************************************************************* |
23 | | | * |
24 | | | * This file is part of GeSHi. |
25 | | | * |
26 | | | * GeSHi is free software; you can redistribute it and/or modify |
27 | | | * it under the terms of the GNU General Public License as published by |
28 | | | * the Free Software Foundation; either version 2 of the License, or |
29 | | | * (at your option) any later version. |
30 | | | * |
31 | | | * GeSHi is distributed in the hope that it will be useful, |
32 | | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
33 | | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
34 | | | * GNU General Public License for more details. |
35 | | | * |
36 | | | * You should have received a copy of the GNU General Public License |
37 | | | * along with GeSHi; if not, write to the Free Software |
38 | | | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
39 | | | * |
40 | | | ************************************************************************************/ |
41 | | | |
42 | | | $language_data = array ( |
43 | | | 'LANG_NAME' => 'C (Mac)', |
44 | | | 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'), |
45 | | | 'COMMENT_MULTI' => array('/*' => '*/'), |
46 | 3 | simandl | 'COMMENT_REGEXP' => array( |
47 | | | //Multiline-continued single-line comments |
48 | | | 1 => '/\/\/(?:\\\\\\\\|\\\\\\n|.)*$/m', |
49 | | | //Multiline-continued preprocessor define |
50 | | | 2 => '/#(?:\\\\\\\\|\\\\\\n|.)*$/m' |
51 | | | ), |
52 | 1 | simandl | 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, |
53 | | | 'QUOTEMARKS' => array("'", '"'), |
54 | 3 | simandl | 'ESCAPE_CHAR' => '', |
55 | | | 'ESCAPE_REGEXP' => array( |
56 | | | //Simple Single Char Escapes |
57 | | | 1 => "#\\\\[abfnrtv\\'\"?\n]#i", |
58 | | | //Hexadecimal Char Specs |
59 | | | 2 => "#\\\\x[\da-fA-F]{2}#", |
60 | | | //Hexadecimal Char Specs |
61 | | | 3 => "#\\\\u[\da-fA-F]{4}#", |
62 | | | //Hexadecimal Char Specs |
63 | | | 4 => "#\\\\U[\da-fA-F]{8}#", |
64 | | | //Octal Char Specs |
65 | | | 5 => "#\\\\[0-7]{1,3}#" |
66 | | | ), |
67 | 1 | simandl | 'NUMBERS' => |
68 | | | GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_INT_CSTYLE | GESHI_NUMBER_BIN_PREFIX_0B | |
69 | | | GESHI_NUMBER_OCT_PREFIX | GESHI_NUMBER_HEX_PREFIX | GESHI_NUMBER_FLT_NONSCI | |
70 | | | GESHI_NUMBER_FLT_NONSCI_F | GESHI_NUMBER_FLT_SCI_SHORT | GESHI_NUMBER_FLT_SCI_ZERO, |
71 | | | 'KEYWORDS' => array( |
72 | | | 1 => array( |
73 | | | 'if', 'return', 'while', 'case', 'continue', 'default', |
74 | | | 'do', 'else', 'for', 'switch', 'goto' |
75 | | | ), |
76 | | | 2 => array( |
77 | | | 'NULL', 'false', 'break', 'true', 'enum', 'errno', 'EDOM', |
78 | | | 'ERANGE', 'FLT_RADIX', 'FLT_ROUNDS', 'FLT_DIG', 'DBL_DIG', 'LDBL_DIG', |
79 | | | 'FLT_EPSILON', 'DBL_EPSILON', 'LDBL_EPSILON', 'FLT_MANT_DIG', 'DBL_MANT_DIG', |
80 | | | 'LDBL_MANT_DIG', 'FLT_MAX', 'DBL_MAX', 'LDBL_MAX', 'FLT_MAX_EXP', 'DBL_MAX_EXP', |
81 | | | 'LDBL_MAX_EXP', 'FLT_MIN', 'DBL_MIN', 'LDBL_MIN', 'FLT_MIN_EXP', 'DBL_MIN_EXP', |
82 | | | 'LDBL_MIN_EXP', 'CHAR_BIT', 'CHAR_MAX', 'CHAR_MIN', 'SCHAR_MAX', 'SCHAR_MIN', |
83 | | | 'UCHAR_MAX', 'SHRT_MAX', 'SHRT_MIN', 'USHRT_MAX', 'INT_MAX', 'INT_MIN', |
84 | | | 'UINT_MAX', 'LONG_MAX', 'LONG_MIN', 'ULONG_MAX', 'HUGE_VAL', 'SIGABRT', |
85 | | | 'SIGFPE', 'SIGILL', 'SIGINT', 'SIGSEGV', 'SIGTERM', 'SIG_DFL', 'SIG_ERR', |
86 | | | 'SIG_IGN', 'BUFSIZ', 'EOF', 'FILENAME_MAX', 'FOPEN_MAX', 'L_tmpnam', |
87 | | | 'SEEK_CUR', 'SEEK_END', 'SEEK_SET', 'TMP_MAX', 'stdin', 'stdout', 'stderr', |
88 | | | 'EXIT_FAILURE', 'EXIT_SUCCESS', 'RAND_MAX', 'CLOCKS_PER_SEC', |
89 | | | // Mac-specific constants: |
90 | | | 'kCFAllocatorDefault' |
91 | | | ), |
92 | | | 3 => array( |
93 | | | 'printf', 'fprintf', 'snprintf', 'sprintf', 'assert', |
94 | | | 'isalnum', 'isalpha', 'isdigit', 'iscntrl', 'isgraph', 'islower', 'isprint', |
95 | | | 'ispunct', 'isspace', 'isupper', 'isxdigit', 'tolower', 'toupper', |
96 | | | 'exp', 'log', 'log10', 'pow', 'sqrt', 'ceil', 'floor', 'fabs', 'ldexp', |
97 | | | 'frexp', 'modf', 'fmod', 'sin', 'cos', 'tan', 'asin', 'acos', 'atan', 'atan2', |
98 | | | 'sinh', 'cosh', 'tanh', 'setjmp', 'longjmp', |
99 | | | 'va_start', 'va_arg', 'va_end', 'offsetof', 'sizeof', 'fopen', 'freopen', |
100 | | | 'fflush', 'fclose', 'remove', 'rename', 'tmpfile', 'tmpname', 'setvbuf', |
101 | | | 'setbuf', 'vfprintf', 'vprintf', 'vsprintf', 'fscanf', 'scanf', 'sscanf', |
102 | | | 'fgetc', 'fgets', 'fputc', 'fputs', 'getc', 'getchar', 'gets', 'putc', |
103 | | | 'putchar', 'puts', 'ungetc', 'fread', 'fwrite', 'fseek', 'ftell', 'rewind', |
104 | | | 'fgetpos', 'fsetpos', 'clearerr', 'feof', 'ferror', 'perror', 'abs', 'labs', |
105 | | | 'div', 'ldiv', 'atof', 'atoi', 'atol', 'strtod', 'strtol', 'strtoul', 'calloc', |
106 | | | 'malloc', 'realloc', 'free', 'abort', 'exit', 'atexit', 'system', 'getenv', |
107 | | | 'bsearch', 'qsort', 'rand', 'srand', 'strcpy', 'strncpy', 'strcat', 'strncat', |
108 | | | 'strcmp', 'strncmp', 'strcoll', 'strchr', 'strrchr', 'strspn', 'strcspn', |
109 | | | 'strpbrk', 'strstr', 'strlen', 'strerror', 'strtok', 'strxfrm', 'memcpy', |
110 | | | 'memmove', 'memcmp', 'memchr', 'memset', 'clock', 'time', 'difftime', 'mktime', |
111 | | | 'asctime', 'ctime', 'gmtime', 'localtime', 'strftime' |
112 | | | ), |
113 | | | 4 => array( |
114 | | | 'auto', 'char', 'const', 'double', 'float', 'int', 'long', |
115 | | | 'register', 'short', 'signed', 'static', 'string', 'struct', |
116 | | | 'typedef', 'union', 'unsigned', 'void', 'volatile', 'extern', 'jmp_buf', |
117 | | | 'signal', 'raise', 'va_list', 'ptrdiff_t', 'size_t', 'FILE', 'fpos_t', |
118 | | | 'div_t', 'ldiv_t', 'clock_t', 'time_t', 'tm', |
119 | | | // Mac-specific types: |
120 | | | 'CFArrayRef', 'CFDictionaryRef', 'CFMutableDictionaryRef', 'CFBundleRef', 'CFSetRef', 'CFStringRef', |
121 | | | 'CFURLRef', 'CFLocaleRef', 'CFDateFormatterRef', 'CFNumberFormatterRef', 'CFPropertyListRef', |
122 | | | 'CFTreeRef', 'CFWriteStreamRef', 'CFCharacterSetRef', 'CFMutableStringRef', 'CFNotificationRef', |
123 | | | 'CFReadStreamRef', 'CFNull', 'CFAllocatorRef', 'CFBagRef', 'CFBinaryHeapRef', |
124 | | | 'CFBitVectorRef', 'CFBooleanRef', 'CFDataRef', 'CFDateRef', 'CFMachPortRef', 'CFMessagePortRef', |
125 | | | 'CFMutableArrayRef', 'CFMutableBagRef', 'CFMutableBitVectorRef', 'CFMutableCharacterSetRef', |
126 | | | 'CFMutableDataRef', 'CFMutableSetRef', 'CFNumberRef', 'CFPlugInRef', 'CFPlugInInstanceRef', |
127 | | | 'CFRunLoopRef', 'CFRunLoopObserverRef', 'CFRunLoopSourceRef', 'CFRunLoopTimerRef', 'CFSocketRef', |
128 | | | 'CFTimeZoneRef', 'CFTypeRef', 'CFUserNotificationRef', 'CFUUIDRef', 'CFXMLNodeRef', 'CFXMLParserRef', |
129 | | | 'CFXMLTreeRef' |
130 | | | ), |
131 | | | ), |
132 | | | 'SYMBOLS' => array( |
133 | | | '(', ')', '{', '}', '[', ']', '=', '+', '-', '*', '/', '!', '%', '^', '&', ':' |
134 | | | ), |
135 | | | 'CASE_SENSITIVE' => array( |
136 | | | GESHI_COMMENTS => false, |
137 | 3 | simandl | 1 => true, |
138 | | | 2 => true, |
139 | | | 3 => true, |
140 | | | 4 => true, |
141 | 1 | simandl | ), |
142 | | | 'STYLES' => array( |
143 | | | 'KEYWORDS' => array( |
144 | | | 1 => 'color: #0000ff;', |
145 | | | 2 => 'color: #0000ff;', |
146 | | | 3 => 'color: #0000dd;', |
147 | | | 4 => 'color: #0000ff;' |
148 | | | ), |
149 | | | 'COMMENTS' => array( |
150 | | | 1 => 'color: #ff0000;', |
151 | | | 2 => 'color: #339900;', |
152 | | | 'MULTI' => 'color: #ff0000; font-style: italic;' |
153 | | | ), |
154 | | | 'ESCAPE_CHAR' => array( |
155 | 3 | simandl | |
156 | | | 1 => 'color: #000099; font-weight: bold;', |
157 | | | 2 => 'color: #660099; font-weight: bold;', |
158 | | | 3 => 'color: #660099; font-weight: bold;', |
159 | | | 4 => 'color: #660099; font-weight: bold;', |
160 | | | 5 => 'color: #006699; font-weight: bold;', |
161 | | | 'HARD' => '', |
162 | 1 | simandl | ), |
163 | | | 'BRACKETS' => array( |
164 | | | |
165 | | | ), |
166 | | | 'STRINGS' => array( |
167 | | | |
168 | | | ), |
169 | | | 'NUMBERS' => array( |
170 | | | |
171 | | | GESHI_NUMBER_BIN_PREFIX_0B => 'color: #208080;', |
172 | | | GESHI_NUMBER_OCT_PREFIX => 'color: #208080;', |
173 | | | GESHI_NUMBER_HEX_PREFIX => 'color: #208080;', |
174 | | | GESHI_NUMBER_FLT_SCI_SHORT => 'color:#800080;', |
175 | | | GESHI_NUMBER_FLT_SCI_ZERO => 'color:#800080;', |
176 | | | GESHI_NUMBER_FLT_NONSCI_F => 'color:#800080;', |
177 | | | GESHI_NUMBER_FLT_NONSCI => 'color:#800080;' |
178 | | | ), |
179 | | | 'METHODS' => array( |
180 | | | 1 => 'color: #00eeff;', |
181 | | | 2 => 'color: #00eeff;' |
182 | | | ), |
183 | | | 'SYMBOLS' => array( |
184 | | | |
185 | | | ), |
186 | | | 'REGEXPS' => array( |
187 | | | ), |
188 | | | 'SCRIPT' => array( |
189 | | | ) |
190 | | | ), |
191 | | | 'URLS' => array( |
192 | | | 1 => '', |
193 | | | 2 => '', |
194 | | | 3 => 'http://www.opengroup.org/onlinepubs/009695399/functions/{FNAMEL}.html', |
195 | | | 4 => '' |
196 | | | ), |
197 | | | 'OOLANG' => true, |
198 | | | 'OBJECT_SPLITTERS' => array( |
199 | | | 1 => '.', |
200 | | | 2 => '::' |
201 | | | ), |
202 | | | 'REGEXPS' => array( |
203 | | | ), |
204 | | | 'STRICT_MODE_APPLIES' => GESHI_NEVER, |
205 | | | 'SCRIPT_DELIMITERS' => array( |
206 | | | ), |
207 | | | 'HIGHLIGHT_STRICT_BLOCK' => array( |
208 | | | ), |
209 | | | 'TAB_WIDTH' => 4 |
210 | | | ); |
211 | | | |
212 | 3 | simandl | ?> |