A tumblelog CMS built on AJAX, PHP and MySQL.

cpp.php 6.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <?php
  2. /*************************************************************************************
  3. * cpp.php
  4. * -------
  5. * Author: Dennis Bayer (Dennis.Bayer@mnifh-giessen.de)
  6. * Contributors:
  7. * - M. Uli Kusterer (witness.of.teachtext@gmx.net)
  8. * - Jack Lloyd (lloyd@randombit.net)
  9. * Copyright: (c) 2004 Dennis Bayer, Nigel McNie (http://qbnz.com/highlighter)
  10. * Release Version: 1.0.7.21
  11. * Date Started: 2004/09/27
  12. *
  13. * C++ language file for GeSHi.
  14. *
  15. * CHANGES
  16. * -------
  17. * 2004/XX/XX (1.0.2)
  18. * - Added several new keywords (Jack Lloyd)
  19. * 2004/11/27 (1.0.1)
  20. * - Added StdCLib function and constant names, changed color scheme to
  21. * a cleaner one. (M. Uli Kusterer)
  22. * - Added support for multiple object splitters
  23. * 2004/10/27 (1.0.0)
  24. * - First Release
  25. *
  26. * TODO (updated 2004/11/27)
  27. * -------------------------
  28. *
  29. *************************************************************************************
  30. *
  31. * This file is part of GeSHi.
  32. *
  33. * GeSHi is free software; you can redistribute it and/or modify
  34. * it under the terms of the GNU General Public License as published by
  35. * the Free Software Foundation; either version 2 of the License, or
  36. * (at your option) any later version.
  37. *
  38. * GeSHi is distributed in the hope that it will be useful,
  39. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  40. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  41. * GNU General Public License for more details.
  42. *
  43. * You should have received a copy of the GNU General Public License
  44. * along with GeSHi; if not, write to the Free Software
  45. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  46. *
  47. ************************************************************************************/
  48. $language_data = array (
  49. 'LANG_NAME' => 'C++',
  50. 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
  51. 'COMMENT_MULTI' => array('/*' => '*/'),
  52. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  53. 'QUOTEMARKS' => array("'", '"'),
  54. 'ESCAPE_CHAR' => '\\',
  55. 'KEYWORDS' => array(
  56. 1 => array(
  57. 'break', 'case', 'continue', 'default', 'do', 'else', 'for', 'goto', 'if', 'return',
  58. 'switch', 'throw', 'while'
  59. ),
  60. 2 => array(
  61. 'NULL', 'false', 'true', 'enum', 'errno', 'EDOM',
  62. 'ERANGE', 'FLT_RADIX', 'FLT_ROUNDS', 'FLT_DIG', 'DBL_DIG', 'LDBL_DIG',
  63. 'FLT_EPSILON', 'DBL_EPSILON', 'LDBL_EPSILON', 'FLT_MANT_DIG', 'DBL_MANT_DIG',
  64. 'LDBL_MANT_DIG', 'FLT_MAX', 'DBL_MAX', 'LDBL_MAX', 'FLT_MAX_EXP', 'DBL_MAX_EXP',
  65. 'LDBL_MAX_EXP', 'FLT_MIN', 'DBL_MIN', 'LDBL_MIN', 'FLT_MIN_EXP', 'DBL_MIN_EXP',
  66. 'LDBL_MIN_EXP', 'CHAR_BIT', 'CHAR_MAX', 'CHAR_MIN', 'SCHAR_MAX', 'SCHAR_MIN',
  67. 'UCHAR_MAX', 'SHRT_MAX', 'SHRT_MIN', 'USHRT_MAX', 'INT_MAX', 'INT_MIN',
  68. 'UINT_MAX', 'LONG_MAX', 'LONG_MIN', 'ULONG_MAX', 'HUGE_VAL', 'SIGABRT',
  69. 'SIGFPE', 'SIGILL', 'SIGINT', 'SIGSEGV', 'SIGTERM', 'SIG_DFL', 'SIG_ERR',
  70. 'SIG_IGN', 'BUFSIZ', 'EOF', 'FILENAME_MAX', 'FOPEN_MAX', 'L_tmpnam', 'NULL',
  71. 'SEEK_CUR', 'SEEK_END', 'SEEK_SET', 'TMP_MAX', 'stdin', 'stdout', 'stderr',
  72. 'EXIT_FAILURE', 'EXIT_SUCCESS', 'RAND_MAX', 'CLOCKS_PER_SEC',
  73. 'virtual', 'public', 'private', 'protected', 'template', 'using', 'namespace',
  74. 'try', 'catch', 'inline', 'dynamic_cast', 'const_cast', 'reinterpret_cast',
  75. 'static_cast', 'explicit', 'friend', 'wchar_t', 'typename', 'typeid', 'class'
  76. ),
  77. 3 => array(
  78. 'cin', 'cerr', 'clog', 'cout', 'delete', 'new', 'this',
  79. 'printf', 'fprintf', 'snprintf', 'sprintf', 'assert',
  80. 'isalnum', 'isalpha', 'isdigit', 'iscntrl', 'isgraph', 'islower', 'isprint',
  81. 'ispunct', 'isspace', 'ispunct', 'isupper', 'isxdigit', 'tolower', 'toupper',
  82. 'exp', 'log', 'log10', 'pow', 'sqrt', 'ceil', 'floor', 'fabs', 'ldexp',
  83. 'frexp', 'modf', 'fmod', 'sin', 'cos', 'tan', 'asin', 'acos', 'atan', 'atan2',
  84. 'sinh', 'cosh', 'tanh', 'setjmp', 'longjmp', 'asin', 'acos', 'atan', 'atan2',
  85. 'va_start', 'va_arg', 'va_end', 'offsetof', 'sizeof', 'fopen', 'freopen',
  86. 'fflush', 'fclose', 'remove', 'rename', 'tmpfile', 'tmpname', 'setvbuf',
  87. 'setbuf', 'vfprintf', 'vprintf', 'vsprintf', 'fscanf', 'scanf', 'sscanf',
  88. 'fgetc', 'fgets', 'fputc', 'fputs', 'getc', 'getchar', 'gets', 'putc',
  89. 'putchar', 'puts', 'ungetc', 'fread', 'fwrite', 'fseek', 'ftell', 'rewind',
  90. 'fgetpos', 'fsetpos', 'clearerr', 'feof', 'ferror', 'perror', 'abs', 'labs',
  91. 'div', 'ldiv', 'atof', 'atoi', 'atol', 'strtod', 'strtol', 'strtoul', 'calloc',
  92. 'malloc', 'realloc', 'free', 'abort', 'exit', 'atexit', 'system', 'getenv',
  93. 'bsearch', 'qsort', 'rand', 'srand', 'strcpy', 'strncpy', 'strcat', 'strncat',
  94. 'strcmp', 'strncmp', 'strcoll', 'strchr', 'strrchr', 'strspn', 'strcspn',
  95. 'strpbrk', 'strstr', 'strlen', 'strerror', 'strtok', 'strxfrm', 'memcpy',
  96. 'memmove', 'memcmp', 'memchr', 'memset', 'clock', 'time', 'difftime', 'mktime',
  97. 'asctime', 'ctime', 'gmtime', 'localtime', 'strftime'
  98. ),
  99. 4 => array(
  100. 'auto', 'bool', 'char', 'const', 'double', 'float', 'int', 'long', 'longint',
  101. 'register', 'short', 'shortint', 'signed', 'static', 'struct',
  102. 'typedef', 'union', 'unsigned', 'void', 'volatile', 'extern', 'jmp_buf',
  103. 'signal', 'raise', 'va_list', 'ptrdiff_t', 'size_t', 'FILE', 'fpos_t',
  104. 'div_t', 'ldiv_t', 'clock_t', 'time_t', 'tm',
  105. ),
  106. ),
  107. 'SYMBOLS' => array(
  108. 0 => array('(', ')', '{', '}', '[', ']'),
  109. 1 => array('<', '>','='),
  110. 2 => array('+', '-', '*', '/', '%'),
  111. 3 => array('!', '^', '&', '|'),
  112. 4 => array(':')
  113. ),
  114. 'CASE_SENSITIVE' => array(
  115. GESHI_COMMENTS => true,
  116. 1 => false,
  117. 2 => false,
  118. 3 => false,
  119. 4 => false,
  120. ),
  121. 'STYLES' => array(
  122. 'KEYWORDS' => array(
  123. 1 => 'color: #0000ff;',
  124. 2 => 'color: #0000ff;',
  125. 3 => 'color: #0000dd;',
  126. 4 => 'color: #0000ff;'
  127. ),
  128. 'COMMENTS' => array(
  129. 1 => 'color: #666666;',
  130. 2 => 'color: #339900;',
  131. 'MULTI' => 'color: #ff0000; font-style: italic;'
  132. ),
  133. 'ESCAPE_CHAR' => array(
  134. 0 => 'color: #666666; font-weight: bold;'
  135. ),
  136. 'BRACKETS' => array(
  137. 0 => 'color: #008000;'
  138. ),
  139. 'STRINGS' => array(
  140. 0 => 'color: #FF0000;'
  141. ),
  142. 'NUMBERS' => array(
  143. 0 => 'color: #0000dd;'
  144. ),
  145. 'METHODS' => array(
  146. 1 => 'color: #00eeff;',
  147. 2 => 'color: #00eeff;'
  148. ),
  149. 'SYMBOLS' => array(
  150. 0 => 'color: #008000;',
  151. 1 => 'color: #000080;',
  152. 2 => 'color: #000040;',
  153. 3 => 'color: #000040;',
  154. 4 => 'color: #008080;'
  155. ),
  156. 'REGEXPS' => array(
  157. ),
  158. 'SCRIPT' => array(
  159. )
  160. ),
  161. 'URLS' => array(
  162. ),
  163. 'OOLANG' => true,
  164. 'OBJECT_SPLITTERS' => array(
  165. 1 => '.',
  166. 2 => '::'
  167. ),
  168. 'REGEXPS' => array(
  169. ),
  170. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  171. 'SCRIPT_DELIMITERS' => array(
  172. ),
  173. 'HIGHLIGHT_STRICT_BLOCK' => array(
  174. ),
  175. 'TAB_WIDTH' => 4,
  176. 'PARSER_CONTROL' => array(
  177. 'KEYWORDS' => array(
  178. 'DISALLOWED_BEFORE' => "a-zA-Z0-9\$_\|\#>|^",
  179. 'DISALLOWED_AFTER' => "a-zA-Z0-9_<\|%\\-"
  180. )
  181. )
  182. );
  183. ?>