Jump to content

User:Quuxplusone/c.php

From Wikipedia, the free encyclopedia
<?php
/***************************************************************
 * c.php
 * -----
 * Author: User:Quuxplusone
 * Copyright: Public domain
 * Date Started: 2007/05/24
 *
 * C language file for GeSHi.
 */

$language_data = array (
	'LANG_NAME' => 'C',
	'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
	'COMMENT_MULTI' => array('/*' => '*/'),
	'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
	'QUOTEMARKS' => array(1 => "'", 2 => '"'),
	'ESCAPE_CHAR' => '\\',
	'KEYWORDS' => array(
		/* From clause 6.4.1#1 of the Standard. */
		1 => array( /* Control structures. */
			'if', 'else', 'while', 'do', 'for', 'continue', 'break',
			'switch', 'case', 'goto', 'return'
			),
		2 => array( /* Types and type modifiers. */
			'void', 'int', 'short', 'long', 'char',
			'float', 'double', 'unsigned', 'signed',
			'auto', 'register', 'static', 'volatile', 'const',
			'extern', 'restrict', 'inline',
			'_Bool', '_Complex', '_Imaginary',
			),
		3 => array( /* "types" actually defined in standard headers */
			'wchar_t', 'size_t', 'ptrdiff_t',
			'bool', 'complex', 'imaginary'
			),
		4 => array( /* Type-constructors, sort of. */
			'struct', 'union', 'enum'
			),
		5 => array( /* Unary operators. */
			'sizeof', '_Pragma'
			),
		6 => array( /* typedef: type modifier, or keyword? You decide! */
			'typedef'
			),
		7 => array( /* Unary "operator" macro defined in <stddef.h> */
			'offsetof'
			),
		8 => array( /* NULL */
			'NULL'
			),
		9 => array( /* Standard library names: <stdio.h> */
			'FILE', 'fpos_t', '_IOFBF', '_IOLBF', '_IONBF',
			'BUFSIZ', 'EOF', 'FOPEN_MAX', 'FILENAME_MAX',
			'L_tmpnam', 'SEEK_CUR', 'SEEK_END', 'SEEK_SET',
			'TMP_MAX', 'stderr', 'stdin', 'stdout',
			'remove', 'rename', 'tmpfile', 'tmpnam',
			'fclose', 'fflush', 'fopen', 'freopen',
			'setbuf', 'setvbuf', 'fprintf', 'fscanf',
			'printf', 'scanf', 'snprintf', 'sprintf',
			'sscanf', 'vfprintf', 'vfscanf', 'vprintf',
			'vscanf', 'vsnprintf', 'vsprintf', 'vsscanf',
			'fgetc', 'fgets', 'fputc', 'getc', 'getchar',
			'gets', 'putc', 'putchar', 'puts', 'ungetc',
			'fread', 'fwrite', 'fgetpos', 'fseek', 'fsetpos',
			'ftell', 'rewind', 'clearerr', 'feof', 'ferror',
			'perror'
			),
		10 => array( /* Standard library names: <stdlib.h> */
			'div_t', 'ldiv_t', 'lldiv_t', 'size_t', 'wchar_t',
			'EXIT_FAILURE', 'EXIT_SUCCESS', 'RAND_MAX',
			'MB_CUR_MAX', 'atof', 'atol', 'atoi', 'atoll',
			'strtod', 'strtof', 'strtold', 'strtol', 'strtoll',
			'strtoul', 'strtoull', 'rand', 'srand', 'calloc',
			'free', 'malloc', 'realloc', 'abort', 'atexit',
			'exit', 'getenv', 'system', 'bsearch', 'qsort',
			'abs', 'labs', 'llabs', 'div', 'ldiv', 'lldiv',
			'mblen', 'mbtowc', 'wctomb', 'mbstowcs', 'wcstombs'
			),
		11 => array( /* Standard library names: <string.h> */
			'memcpy', 'memmove', 'strcpy', 'strncpy', 'strcat',
			'strncat', 'memcmp', 'strcmp', 'strcoll', 'strncmp',
			'strxfrm', 'memchr', 'strchr', 'strcspn', 'strpbrk',
			'strrchr', 'strspn', 'strstr', 'strtok', 'memset',
			'strerror', 'strlen'
			),
		/* Skipped macros in <tgmath.h> */
		12 => array( /* Standard library names: <time.h> */
			'CLOCKS_PER_SEC', 'clock_t', 'time_t', 'tm',
			'clock', 'difftime', 'mktime', 'time', 'asctime',
			'ctime', 'gmtime', 'localtime', 'strftime'
			),
		13 => array( /* Standard library names: <wchar.h> */
			'mbstate_t', 'wint_t', 'WCHAR_MAX', 'WCHAR_MIN',
			'WEOF', 'fwprintf', 'fwscanf', 'swprintf',
			'swscanf', 'vfwprintf', 'vfwscanf', 'vswprintf',
			'vswscanf', 'vwprintf', 'vwscanf', 'wprintf',
			'wscanf', 'fgetwc', 'fgetws', 'fputwc', 'fputws',
			'fwide', 'getwc', 'getwchar', 'putwc', 'putwchar',
			'ungetwc', 'wcstod', 'wcstof', 'wcstold', 'wcstol',
			'wcstoll', 'wcstoul', 'wcstoull', 'wcscpy', 'wcsncpy',
			'wcscat', 'wcsncat', 'wcscmp', 'wcscoll', 'wcsncmp',
			'wcsxfrm', 'wcschr', 'wcscspn', 'wcslen', 'wcspbrk',
			'wcsrchr', 'wcsspn', 'wcsstr', 'wcstok', 'wmemchr',
			'wmemcmp', 'wmemcpy', 'wmemmove', 'wmemset', 'wcsftime',
			'btowc', 'wctob', 'mbsinit', 'mbrlen', 'mbrtowc',
			'wcrtomb', 'mbsrtowcs', 'wcsrtombs'
			),
		14 => array( /* Standard library names: <wctype.h> */
			'wctrans_t', 'wctype_t', 'iswalnum', 'iswalpha',
			'iswcntrl', 'iswdigit', 'iswgraph', 'iswlower',
			'iswprint', 'iswpunct', 'iswspace', 'iswupper',
			'iswxdigit', 'iswctype', 'wctype', 'towlower',
			'towupper', 'towctrans', 'wctrans'
			),
		15 => array( /* Standard library names: <ctype.h> */
			'isalnum', 'isalpha',
			'iscntrl', 'isdigit', 'isgraph', 'islower',
			'isprint', 'ispunct', 'isspace', 'isupper',
			'isxdigit', 'tolower', 'toupper'
			),
		16 => array( /* __LINE__, a decimal constant */
			'__LINE__', '__STDC__', '__STDC_VERSION__'
			'__STDC_ISO_10646__', '__STDC_IEC_559__',
			'__STDC_IEC_559_COMPLEX__'
			),
		17 => array( /* __FILE__, a string constant */
			'__FILE__', '__DATE__', '__TIME__'
			),
		18 => array( /* Standard library names: <assert.h> */
			'NDEBUG', 'assert'
			),
		19 => array( /* <stdbool.h> */
			'true', 'false' /* 'bool' defined above */
			),
		20 => array( /* <complex.h> */
			'I' /* 'complex' and 'imaginary' defined above */
			),
		21 => array( /* Standard library names: <complex.h> */
			'CX_LIMITED_RANGE', 'cacos', 'cacosf', 'cacosl',
			'casin', 'casinf', 'casinl', 'catan', 'catanf', 'catanl',
			'ccos', 'ccosf', 'ccosl', 'csin', 'csinf', 'csinl',
			'ctan', 'ctanf', 'ctanl', 'cacosh', 'cacoshf', 'cacoshl',
			'casinh', 'casinhf', 'casinhl', 'catanh', 'catanhf',
			'catanhl', 'ccosh', 'ccoshf', 'ccoshl', 'csinh',
			'csinhf', 'csinhl', 'ctanh', 'ctanhf', 'ctanhl',
			'cexp', 'cexpf', 'cexpl', 'clog', 'clogf', 'clogl',
			'cabs', 'cabsf', 'cabsl', 'cpow', 'cpowf', 'cpowl',
			'csqrt', 'csqrtf', 'csqrtl', 'carg', 'cargf', 'cargl',
			'cimag', 'cimagf', 'cimagl', 'conj', 'conjf', 'conjl',
			'cproj', 'cprojf', 'cprojl', 'creal', 'crealf', 'creall'
			),
		22 => array( /* Standard library names: <errno.h> */
			'EDOM', 'EILSEQ', 'ERANGE', 'errno'
			),
		23 => array( /* Standard library names: <fenv.h> */
			'fenv_t', 'fexcept_t', 'FE_DIVBYZERO', 'FE_INEXACT',
			'FE_INVALID', 'FE_OVERFLOW', 'FE_UNDERFLOW',
			'FE_ALLEXCEPT', 'FE_DOWNWARD', 'FE_TONEAREST',
			'FE_TOWARDZERO', 'FE_UPWARD', 'FE_DFL_ENV',
			'FENV_ACCESS', 'feclearexcept', 'fegetexceptflag',
			'feraiseexcept', 'fesetexceptflag', 'fetestexcept',
			'fegetround', 'fesetround', 'fegetenv', 'feholdexcept',
			'fesetenv', 'feupdateenv'
			),
		/* Skipped <float.h>, PRI* macros from <inttypes.h> */
		24 => array( /* Standard library names: <inttypes.h> */
			'strtoimax', 'strtoumax', 'wcstoimax', 'wcstoumax',
			'intmax_t', 'uintmax_t', 'intptr_t', 'uintptr_t'
			),
		25 => array( /* Alternative spellings: <iso646.h> */
			'and', 'and_eq', 'bitand', 'bitor', 'compl', 'not',
			'not_eq', 'or', 'or_eq', 'xor', 'xor_eq'
			),
		/* Skipped <limits.h> */
		26 => array( /* Standard library names: <locale.h> */
			'lconv', 'LC_ALL', 'LC_COLLATE', 'LC_CTYPE',
			'LC_MONETARY', 'LC_NUMERIC', 'LC_TIME',
			'setlocale', 'localeconv'
			),
		27 => array( /* Standard library names: <math.h> */
			'float_t', 'double_t', 'HUGE_VAL', 'HUGE_VALF',
			'HUGE_VALL', 'INFINITY', 'NAN', 'FP_INFINITE',
			'FP_NAN', 'FP_NORMAL', 'FP_SUBNORMAL', 'FP_ZERO',
			'FP_FAST_FMA', 'FP_FAST_FMAF', 'FP_FAST_FMAL',
			'FP_ILOGB0', 'FP_ILOGBNAN', 'FP_CONTRACT', 'fpclassify',
			'isfinite', 'isinf', 'isnan', 'isnormal', 'signbit',
			'acos', 'acosf', 'acosl', 'asin', 'asinf', 'asinl',
			'atan', 'atanf', 'atanl', 'atan2', 'atan2f', 'atan2l',
			'cos', 'cosf', 'cosl', 'sin', 'sinf', 'sinl',
			'tan', 'tanf', 'tanl', 'acosh', 'acoshf', 'acoshl',
			'asinh', 'asinhf', 'asinhl', 'atanh', 'atanhf', 'atanhl',
			'cosh', 'coshf', 'coshl', 'sinh', 'sinhf', 'sinhl',
			'tanh', 'tanhf', 'tanhl', 'exp', 'expf', 'expl',
			'exp2', 'exp2f', 'exp2l', 'expm1', 'expm1f', 'expm1l',
			'frexp', 'frexpf', 'frexpl', 'ilogb', 'ilogbf', 'ilogbl',
			'ldexp', 'ldexpf', 'ldexpl', 'log', 'logf', 'logl',
			'log10', 'log10f', 'log10l', 'log1p', 'log1pf', 'log1pl',
			'log2', 'log2f', 'log2l', 'logb', 'logbf', 'logbl',
			'modf', 'modff', 'modfl', 'scalbn', 'scalbnf', 'scalbnl',
			'scalbln', 'scalblnf', 'scalblnl', 'cbrt', 'cbrtf', 'cbrtl',
			'fabs', 'fabsf', 'fabsl', 'hypot', 'hypotf', 'hypotl',
			'pow', 'powf', 'powl', 'sqrt', 'sqrtf', 'sqrtl',
			'erf', 'erff', 'erfl', 'erfc', 'erfcf', 'erfcl',
			'lgamma', 'lgammaf', 'lgammal', 'tgamma', 'tgammaf',
			'tgammal', 'ceil', 'ceilf', 'ceill', 'floor', 'floorf',
			'floorl', 'nearbyint', 'nearbyintf', 'nearbyintl',
			'rint', 'rintf', 'rintl', 'lrint', 'lrintf', 'lrintl', 
			'llrint', 'llrintf', 'llrintl', 'lround', 'lroundf',
			'lroundl', 'llround', 'llroundf', 'llroundl', 'trunc',
			'truncf', 'truncl', 'fmod', 'fmodf', 'fmodl', 'remainder',
			'remainderf', 'remainderl', 'remquo', 'remquof', 'remquol',
			'copysign', 'copysignf', 'copysignl', 'nan', 'nanf', 'nanl',
			'nextafter', 'nextafterf', 'nextafterl', 'nexttoward',
			'nexttowardf', 'nexttowardl', 'fdim', 'fdimf', 'fdiml',
			'fmax', 'fmaxf', 'fmaxl', 'fmin', 'fminf', 'fminl',
			'fma', 'fmaf', 'fmal', 'isgreater', 'isgreaterequal',
			'isless', 'islessequal', 'islessgreater', 'isunordered'
			),
		28 => array( /* Standard library names: <setjmp.h> */
			'jmp_buf', 'setjmp', 'longjmp'
			),
		29 => array( /* Standard library names: <signal.h> */
			'sig_atomic_t', 'SIG_DFL', 'SIG_ERR', 'SIG_IGN',
			'SIGABRT', 'SIGFPE', 'SIGILL', 'SIGINT', 'SIGSEGV',
			'SIGTERM', 'signal', 'raise'
			),
		30 => array( /* Standard library names: <stdarg.h> */
			'va_list', 'va_arg', 'va_copy', 'va_end', 'va_start'
			)
		/* Skipped <stdint.h> */
		),
	'SYMBOLS' => array(
		'(', ')', '{', '}', '[', ']',
		'==', '!=', '<=', '>=',
		'+=', '-=', '*=', '/=', '%=', '&=', '|=', '^=', '<<=', '>>=',
		'+', '-', '*', '/', '%', '&', '|', '^', '<<', '>>',
		'<', '>', '=', '!', '?', ':'
		),
	'CASE_SENSITIVE' => array_fill(0, 31/*==KEYWORDS+1*/, true),
	'STYLES' => array(
		'KEYWORDS' => array_fill(1,30,),
		'COMMENTS' => array(
			1 => 'color: #008000;', /* // comments */
			2 => 'color: #006699;', /* preprocessor directives */
			'MULTI' => 'color: #008000;'),
		'ESCAPE_CHAR' => array(
			0 => 
			),
		'STRINGS' => array(
	 		0 => 'color: #660099;'
			1 => 'color: #AA0000;'
			),
		'NUMBERS' => array(
			0 => 'color: #AA0000;'
			),
		'SYMBOLS' => array(
			0 => 
			)
		),
	'STRICT_MODE_APPLIES' => GESHI_NEVER,
	'SCRIPT_DELIMITERS' => array(
		),
	'HIGHLIGHT_STRICT_BLOCK' => array(
		)
);
?>