diff options
Diffstat (limited to 'paste/include')
89 files changed, 14171 insertions, 1134 deletions
diff --git a/paste/include/class.geshi.php b/paste/include/class.geshi.php new file mode 100644 index 0000000..ee6436e --- /dev/null +++ b/paste/include/class.geshi.php @@ -0,0 +1,739 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package core + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2004, 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** + * MAJOR TODOs: + * + * @todo [blocking 1.1.1] (bug 5) Support balanced context endings + * @todo [blocking 1.1.1] (bug 14) OCCs should be able to modify their parent context + * @todo [blocking 1.1.1] (bug 16, 17) Better Delphi and Codeworker support + */ + +/** GeSHi Version */ +define('GESHI_VERSION', '1.1.0'); + +/** Set the correct directory separator */ +define('GESHI_DIR_SEPARATOR', ('WIN' != substr(PHP_OS, 0, 3)) ? '/' : '\\'); + +// Define the root directory for the GeSHi code tree +if (!defined('GESHI_ROOT')) { + /** The root directory for GeSHi (where class.geshi.php is located) */ + define('GESHI_ROOT', dirname(__FILE__) . GESHI_DIR_SEPARATOR); +} + +/**#@+ + * @access private + */ +/** The data directory for GeSHi */ +define('GESHI_DATA_ROOT', GESHI_ROOT . 'geshi' . GESHI_DIR_SEPARATOR); +/** The classes directory for GeSHi */ +define('GESHI_CLASSES_ROOT', GESHI_DATA_ROOT . 'classes' . GESHI_DIR_SEPARATOR); +/** The languages directory for GeSHi */ +define('GESHI_LANGUAGES_ROOT', GESHI_DATA_ROOT . 'languages' . GESHI_DIR_SEPARATOR); +/** The context files directory for GeSHi */ +define('GESHI_CONTEXTS_ROOT', GESHI_DATA_ROOT . 'contexts' . GESHI_DIR_SEPARATOR); +/** The theme files directory for GeSHi */ +define('GESHI_THEMES_ROOT', GESHI_DATA_ROOT . 'themes' . GESHI_DIR_SEPARATOR); +/**#@-*/ + +/** Get required functions */ +require GESHI_DATA_ROOT . 'functions.geshi.php'; + +/** Get styler class */ +require GESHI_CLASSES_ROOT . 'class.geshistyler.php'; + +/** Get context class */ +require GESHI_CLASSES_ROOT . 'class.geshicontext.php'; + + +// +// Constants +// + +// Debugging constants. These will disappear in stable builds. Specify +// as a bitfield, e.g. GESHI_DBG_API | GESHI_DBG_PARSE, by defining the +// GESHI_DBG context before including this file +/** No debugging */ +define('GESHI_DBG_NONE', 0); +/** Debug the API */ +define('GESHI_DBG_API', 1); +/** Debug actual parsing */ +define('GESHI_DBG_PARSE', 2); +/** Debug error handling */ +define('GESHI_DBG_ERR', 4); +/** Maximum debug level */ +define('GESHI_DBG_ALL', GESHI_DBG_API | GESHI_DBG_PARSE | GESHI_DBG_ERR); + +// Set efault debug level +if (!defined('GESHI_DBG')) { + /** Default debug level */ + define('GESHI_DBG', GESHI_DBG_NONE); +} + +// These provide BACKWARD COMPATIBILITY ONLY +// Use New Method setStyles(mixed identifiers, string styles); +// e.g. setStyles('html/tag', 'styles'); +// setStyles(array('html/tag', 'html/css-delimiters'), 'style'); +/** Used to mark a context as having no equivalence in 1.0.X */ +define('GESHI_STYLE_NONE', 0); +/** Used to mark a context as being like a number in 1.0.X */ +define('GESHI_STYLE_NUMBERS', 1); +/** Used to mark a context as being like a comment in 1.0.X */ +define('GESHI_STYLE_COMMENTS', 2); +/** Used to mark a context as being like a string in 1.0.X */ +define('GESHI_STYLE_STRINGS', 3); +/** Used to mark a context as being like a symbol in 1.0.X */ +define('GESHI_STYLE_SYMBOLS', 4); +/** Used to mark a context as being like a method in 1.0.X */ +define('GESHI_STYLE_METHODS', 5); + +/**#@+ + * @access private + */ + +// Error related constants, not needed by users of GeSHi +/** No error has occured */ +define('GESHI_ERROR_NONE', 0); +/** There is no source code to highlight */ +define('GESHI_ERROR_NO_INPUT', 1); +/** You don't have a language file for the specified language */ +define('GESHI_ERROR_NO_SUCH_LANG', 2); +/** The language name contained illegal characters */ +define('GESHI_ERROR_LANG_NAME_ILLEGAL_CHARS', 4); +/** The path specified is not readable */ +//define('GESHI_ERROR_ILLEGAL_PATH', 5); +/** The theme specified does not exist */ +//define('GESHI_ERROR_NO_SUCH_THEME', 6); +/** Parsing is in strict mode, but the root context does not have a specific opener */ +//define('GESHI_ERROR_STRICT_MODE_NO_OPENER', 7); +/** getTime($type) was called with an invalid type */ +define('GESHI_ERROR_INVALID_TIME_TYPE', 8); +/** A file that was requested for loading data is not available */ +define('GESHI_ERROR_FILE_UNAVAILABLE', 9); + +// Constants for specifying who (out of the parent or child) highlights the delimiter +// between the parent and the child. Note that if you view the numbers as two bit binary, +// a 1 indicates where the child parses and a 0 indicates where the parent should parse. +// The default is GESHI_CHILD_PARSE_BOTH +/** The child should parse neither delimiter (parent parses both) */ +define('GESHI_CHILD_PARSE_NONE', 0); +/** The child should parse the right (end) delimiter, the parent should parse the left delimiter */ +define('GESHI_CHILD_PARSE_RIGHT', 1); +/** The child should parse the left (beginning) delimiter, the parent should parse the right delimiter */ +define('GESHI_CHILD_PARSE_LEFT', 2); +/** The child should parse both delimiters (default) */ +define('GESHI_CHILD_PARSE_BOTH', 3); + +// The name of integer/double number contexts +define('GESHI_NUM_INT', 'num/int'); +define('GESHI_NUM_DBL', 'num/dbl'); + +/** Default file extension */ +define('GESHI_DEFAULT_FILE_EXTENSION', '.php'); + +/**#@-*/ + + +/** + * The GeSHi class + * + * @package core + * @author Nigel McNie <nigel@geshi.org> + * @version 1.1.0 + * @since 1.0.0 + */ +class GeSHi +{ + /**#@+ + * @access private + * @var string + */ + + /** + * The source code to parse + */ + var $_source; + + /** + * The name of the language to use when parsing the source + */ + var $language; + + /** + * The humanised version of the language name + */ + var $humanLanguageName; + + /** + * The error code of any error that has occured + */ + var $_error; + + /**#@-*/ + /**#@+ + * @access private + */ + + /** + * The root context to use for parsing the source + * + * @var GeSHiContext + */ + var $_rootContext; + + /** + * Whether this object should be prepared as if it will be used + * many times + * + * @var boolean + */ + var $_cacheRootContext; + + /** + * The cached root context, if caching of context trees is enabled + * + * @var GeSHiContext + */ + var $_cachedRootContext; + + /** + * The GeSHiStyler object used by this class and all contexts for + * assisting parsing. + * + * @var GeSHiStyler + */ + + /**#@-*/ + + /** + * Sets the source and language name of the source to parse + * + * Also sets up other defaults, such as the default encoding + * + * <b>USAGE:</b> + * + * <pre>$geshi =& new GeSHi($source, $language); + * if (false !== ($msg = $geshi->error())) { + * // Handle error here: error message in $msg + * } + * $code = $geshi->parseCode();</pre> + * + * @param string The source code to highlight + * @param string The language to highlight the source with + * @param string The path to the GeSHi data files. <b>This is no longer used!</b> The path is detected + * automatically by GeSHi, this paramters is only included for backward compatibility. If + * you want to set the path to the GeSHi data directories yourself, you should define the + * GESHI_ROOT constant before including class.geshi.php. + * @since 1.0.0 + */ + function GeSHi ($source, $language_name, $path = '') + { + geshi_dbg('GeSHi::GeSHi (language='.$language_name.')', GESHI_DBG_API); + + // Initialise timing + $initial_times = array(0 => '0 0', 1 => '0 0'); + $this->_times = array( + 'pre' => $initial_times, + 'parse' => $initial_times, + 'post' => $initial_times + ); + + $this->_styler =& new GeSHiStyler; + + // @todo [blocking 1.1.5] Make third parameter an option array thing + + $this->setFileExtension(GESHI_DEFAULT_FILE_EXTENSION); + //$this->setOutputFormat(GESHI_OUTPUT_HTML); + //$this->setEncoding(GESHI_DEFAULT_ENCODING); + + // Set the initial source/language + $this->setSource($source); + $this->setLanguage($language_name); + } + + /** + * Returns an error message if there has been an error. Useful for debugging, + * but not recommended for use on a live site. + * + * The last error that occured is returned by this method + * @todo [blocking 1.1.9] Documentation: has this changed from 1.0.X? + * + * @return false|string A message if there is an error, else false + * @since 1.0.0 + */ + function error () + { + geshi_dbg('GeSHi::error()', GESHI_DBG_ERR | GESHI_DBG_API); + if ($this->_error) { + $msg = $this->_getErrorMessage(); + geshi_dbg(' ERR: ' . $this->_error . ': ' . $msg, GESHI_DBG_API | GESHI_DBG_ERR); + return sprintf('<br /><strong>GeSHi Error:</strong> %s (code %s)<br />', + $msg, + '<a href="http://geshi.org/developers/error-codes/#' . $this->_error + . '">#' . $this->_error . '</a>' + ); + } + geshi_dbg(' No error', GESHI_DBG_ERR | GESHI_DBG_API); + return false; + } + + /** + * Sets the source code to highlight + * + * @param string The source code to highlight + * @since 1.0.0 + */ + function setSource ($source) + { + geshi_dbg('GeSHi::setSource(' . substr($source, 0, 15) . '...)', GESHI_DBG_API); + $this->_source = $source; + if (!$this->_sourceValid()) { + geshi_dbg('@e Source code is not valid!', GESHI_DBG_API | GESHI_DBG_ERR); + } + } + + /** + * Sets the source code to highlight. This method is deprecated, and will be + * removed in 1.4/2.0. + * + * @param string The source code to highlight + * @since 1.0.0 + * @deprecated In favour of {@link setSource()} + */ + function set_source ($source) + { + $this->setSource($source); + } + + /** + * Sets the language to use for highlighting + * + * @param string The language to use for highlighting + * @since 1.0.0 + */ + function setLanguage ($language_name) + { + $this->_times['pre'][0] = microtime(); + geshi_dbg('GeSHi::setLanguage('.$language_name.')', GESHI_DBG_API); + $this->_language = strtolower($language_name); + + // Make a legal language name + if (false === strpos($this->_language, '/')) { + $this->_language .= '/'.$this->_language; + geshi_dbg(' Language name converted to '.$this->_language, GESHI_DBG_API); + } + + if ($this->_languageNameValid()) { + // load language now + geshi_dbg('@o Language name fine, loading data', GESHI_DBG_API); + $this->_parsePreProcess(); + } else { + geshi_dbg('@e Language name not OK! (code '.$this->_error.')', GESHI_DBG_API | GESHI_DBG_ERR); + } + + $this->_times['pre'][1] = microtime(); + geshi_dbg(' Language data loaded in ' . number_format($this->getTime('pre'), 3) . ' seconds', GESHI_DBG_API); + } + + /** + * Sets the language to use for highlighting. This method is deprecated, and + * will be removed in 1.4/2.0. + * + * @param string The language to use for highlighting + * @since 1.0.0 + * @deprecated In favour of {@link setLanguage()} + */ + function set_language($language_name) + { + $this->setLanguage($language_name); + } + + /** + * Sets whether this object should cache the root context as loaded. Use + * this if you're going to use the same language in this object to parse + * multiple source codes. + * + * @param boolean true if caching of context data should be used + */ + function cacheRootContext ($flag = true) + { + geshi_dbg('GeSHi::cacheRootContext(' . $flag . ')', GESHI_DBG_API); + $this->_cacheRootContext = ($flag) ? true : false; + $this->_cachedRootContext = ($this->_cacheRootContext) ? $this->_rootContext : null; + geshi_dbg(' Set caching to ' . $flag . ', cached root context size = ' . count($this->_cachedRootContext), GESHI_DBG_API); + } + + /** + * Sets the file extension to use when getting external php files + * + * @param string The file extension for PHP files. Can be specified with or without the leading "." + */ + function setFileExtension ($extension) + { + $this->_styler->fileExtension = ('.' == substr($extension, 0, 1)) ? $extension : '.' . $extension; + geshi_dbg('GeSHi::setFileExtension(' . $this->_styler->fileExtension . ')', GESHI_DBG_API); + } + + /** + * Returns various timings related to this object. + * + * For example, how long it took to load a specific context, + * or parse the source code. + * + * You can pass a string to this method, it will return various timings based + * on what string you pass: + * + * <ul> + * <li>If you pass <b>'total'</b> (default), you will get the time it took to + * load, parse and post-process the last call to {@link GeSHi::parseCode()}.</li> + * <li>If you pass <b>'pre'</b>, you will get the time it took to load the last + * language. If caching of the root context is enabled, then this time will likely + * be close to zero if you are calling this method after second and subsequent calls + * to {@link GeSHi::parseCode()}.</li> + * <li>If youpass <b>'parse'</b>, you will get the time it took to parse the last + * time {@link GeSHi::parseCode()} was called. + * + * @param string What time you want to access + * @return false|double The time if there is a time, else false if there was an error + */ + function getTime ($type = 'total') + { + geshi_dbg('GeSHi::getTime(' . $type . ')', GESHI_DBG_API); + if (isset($this->_times[$type])) { + geshi_dbg('@o Valid type', GESHI_DBG_API); + $start = explode(' ', $this->_times[$type][0]); + $end = explode(' ', $this->_times[$type][1]); + return $end[0] + $end[1] - $start[0] - $start[1]; + } elseif ('total' == $type) { + return $this->getTime('pre') + $this->getTime('parse') + $this->getTime('post'); + } + geshi_dbg('@w Type passed to getTime is invalid', GESHI_DBG_API | GESHI_DBG_ERR); + $this->_error = GESHI_ERROR_INVALID_TIME_TYPE; + return false; + } + + /** + * Sets styles of contexts in the source code + * + * @param string The selector to use, this is the style name of a context. Example: php/php + * @param string The CSS styles to apply to the context + */ + function setStyles ($selector, $styles) + { + geshi_dbg('GeSHi::setStyles(' . $selector . ', ' . $styles . ')', GESHI_DBG_API); + $this->_styler->setStyle($selector, $styles); + } + + /** + * Returns the version of this GeSHi + * + * @return string The version of this GeSHi + * @static + */ + function getVersion () + { + geshi_dbg('GeSHi::getVersion()', GESHI_DBG_API); + return GESHI_VERSION; + } + + /** + * Returns the version of this GeSHi + * + * @return string The version of this GeSHi + * @deprecated in favour of {@link GeSHi::getVersion()} + */ + function get_version () + { + return GeSHi::getVersion(); + } + + /** + * Syntax-highlights the source code + * + * @return string The source code, highlighted + */ + function parseCode () + { + $this->_times['parse'][0] = microtime(); + geshi_dbg('GeSHi::parseCode()', GESHI_DBG_API | GESHI_DBG_PARSE); + + if ($this->_error) { + // Bail out + geshi_dbg('@e Error occured!!', GESHI_DBG_PARSE); + $this->_times['parse'][1] = $this->_times['post'][0] = microtime(); + $result = $this->_parsePostProcess(); + $this->_times['post'][1] = microtime(); + return $result; + } + + // Kill the cached root context, replacing with + // the new root context if needed + if ($this->_cacheRootContext) { + $this->_rootContext = $this->_cachedRootContext; + } + + //@todo [blocking 1.1.5] does this space still need to be added? + $code = ' ' . $this->_source; + // Runtime setup of context tree/styler info + // Reset the parse data to nothing + $this->_styler->resetParseData(); + // Remove contexts from the parse tree that aren't interesting + $this->_rootContext->trimUselessChildren($code); + // The important bit - parse the code + $this->_rootContext->parseCode($code); + + + $this->_times['parse'][1] = $this->_times['post'][0] = microtime(); + $result = $this->_parsePostProcess(); + $this->_times['post'][1] = microtime(); + + return $result; + } + + // + // Private Methods + // + + /**#@+ + * @access private + */ + /** + * Get the error message relating to the current error code + * + * @return string The error message relating to the current error code + */ + function _getErrorMessage () + { + if ($this->_error) { + $messages = array ( + // @todo [blocking 1.1.5] Move out of here + GESHI_ERROR_NO_SUCH_LANG => 'GeSHi could not find the language {LANGUAGE} (using path {LANGPATH})', + GESHI_ERROR_NO_INPUT => 'No source code passed to GeSHi to highlight', + GESHI_ERROR_LANG_NAME_ILLEGAL_CHARS => 'The language name {LANGUAGE} contains illegal characters', + //GESHI_ERROR_ILLEGAL_PATH => 'The path {PATH} is not a readable directory', + //GESHI_ERROR_NO_SUCH_THEME => 'GeSHi could not find the theme {THEME} (using path {THEMEPATH})', + //GESHI_ERROR_STRICT_MODE_NO_OPENER => 'Strict mode is enabled but there is no opener for the root context', + GESHI_ERROR_INVALID_TIME_TYPE => 'Call getTime with the only parameter set to one of "pre", "parse", "post" or "total"', + GESHI_ERROR_FILE_UNAVAILABLE => 'A file that GeSHi requires to parse using the language ' . $this->_language . ' is unavailable' + ); + + $variable_substitutes = array ( + '{LANGUAGE}' => $this->_language, + '{PATH}' => GESHI_ROOT, + '{LANGPATH}' => GESHI_LANGUAGES_ROOT, + //'{THEMEPATH}' => GESHI_THEMES_ROOT, + //'{THEME}' => $this->_styler->themeName + ); + + $message = $messages[$this->_error]; + foreach ($variable_substitutes as $string => $replacement) { + $message = str_replace($string, $replacement, $message); + } + $message = htmlspecialchars($message, ENT_COMPAT, $this->_styler->charset); + return $message; + } + return ''; + } + + /** + * Check that the language name to be used is valid + * + * @return boolean true if the language name is valid, else false + */ + function _languageNameValid () + { + geshi_dbg('GeSHi::_languageNameValid('.$this->_language.')', GESHI_DBG_API); + + // Check if the language contains illegal characters. If language names do + // not match this regular expression, they are not valid. This is a useful + // security check as well, if people blindly use a post/get variable as the + // language name... + if (!preg_match('#[a-z][a-z0-9]*(/[a-z][a-z0-9]*)+#', $this->_language)) { + geshi_dbg('@e Language name contains illegal characters', GESHI_DBG_API | GESHI_DBG_ERR); + $this->_error = GESHI_ERROR_LANG_NAME_ILLEGAL_CHARS; + return false; + } + + // Check that the language file for this language exists + $language_file = $this->_getLanguageDataFile(); + geshi_dbg(' Language file to use: ' . $language_file, GESHI_DBG_API); + + if (!geshi_can_include($language_file)) { + geshi_dbg('@e Language does not exist on filesystem', GESHI_DBG_API | GESHI_DBG_ERR); + $this->_error = GESHI_ERROR_NO_SUCH_LANG; + return false; + } + + geshi_dbg('@o Language name is fine', GESHI_DBG_API); + return true; + } + + /** + * Checks to make sure that the source code inputted is valid + * + * The source is valid when: + * + * <ul> + * <li>it is not empty</li> + * </ul> + * + * @return true if the source code is valid, else false + */ + function _sourceValid () + { + geshi_dbg('GeSHi::_sourceValid()', GESHI_DBG_API); + // Is source empty? + if ('' == trim($this->_source)) { + geshi_dbg('@e No source code inputted', GESHI_DBG_API | GESHI_DBG_ERR); + $this->_error = GESHI_ERROR_NO_INPUT; + return false; + } + geshi_dbg('@o Source code OK', GESHI_DBG_API); + return true; + // @todo [blocking 1.1.9] Other things can go in here - checks against max and min length etc + } + + /** + * Prepare the source code for parsing + */ + function _parsePreProcess () + { + geshi_dbg('GeSHi::parsePreProcess()', GESHI_DBG_API); + + // Strip newlines to common form + $this->_source = str_replace("\r\n", "\n", $this->_source); + $this->_source = str_replace("\r", "\n", $this->_source); + + // Load all the data needed for parsing this language + $language_file = $this->_getLanguageDataFile(); + geshi_dbg(' Loading language data from ' . GESHI_LANGUAGES_ROOT . $language_file, GESHI_DBG_API); + require $language_file; + + if ($error_data = $this->_rootContext->load($this->_styler)) { + geshi_dbg('@e Could not load the context data tree: code(' . $error_data['code'] . ') in context ' . $error_data['name'], GESHI_DBG_API | GESHI_DBG_ERR); + $this->_error = $error_data['code']; + } + + // Inform the context tree that all contexts have been loaded, so it is OK to search through + // the tree for default styles as needed. + $this->_rootContext->loadStyleData(); + + // Save a copy of the root context if we are caching + $this->_cachedRootContext = ($this->_cacheRootContext) ? $this->_rootContext : null; + + geshi_dbg('Finished preprocessing', GESHI_DBG_API); + } + + /** + * Builds the result string to return, by looking at the context data array + * + * This is to be moved into a new class: GeSHi_Highlighter, which will extend GeSHi to + * do this job. The GeSHi class will still be able to highlight source code, but this + * behaviour is deprecated and will be removed in the next major release. + * + * @return The code, post-processed. + */ + function _parsePostProcess () + { + if ($this->_error) { + // If there was an error, the source will be in string form + return '<pre style="background-color:#fcc;border:1px solid #c99;">' . htmlspecialchars($this->_source) .'</pre>'; + } + + // $this->_data should hold an array( + // 0 => array(0=>string of code, 1=> context name identifier + $result = ''; + $data = $this->_styler->getParseData(); + // TO BE REMOVED from stable release + if (GESHI_DBG & GESHI_DBG_PARSE) { + $result .= '<pre style="background-color:#ffc;border:1px solid #cc9;">'; + foreach ($data as $token) { + if (!isset($check)) { + $token[0] = substr($token[0], 1); // remove padding + $check = 0; + } + $result .= '[' . $token[1] . ']: ' . htmlspecialchars($token[0]) . "\n"; + } + unset($check); + $result .= '</pre>'; + } + + $result .= '<pre style="background-color:#ffc;border:1px solid #cc9;">'; + foreach ($data as $token) { + if (!isset($check)) { + $token[0] = substr($token[0], 1); // remove padding (slow?) + $check = 0; + } + if ($token[2]) { + $result .= '<a href="' . $token[2] . '">'; + } + $result .= '<span style="' . $this->_styler->getStyle($token[1]) . '" '; +// $result .= 'class="' . str_replace(array('/', '_'), '-', $token[1]) . '" '; + $result .= 'title="' . $token[1] . '">' . htmlspecialchars($token[0]) . '</span>'; + if ($token[2]) { + // there's a URL associated with this token + $result .= '</a>'; + } + } + $result .= '</pre>'; + + // @todo [blocking 1.1.1] (bug 12) Evaluate feasability and get working if possible the functionality below... + //$result = preg_replace('#([^"])(((https?)|(ftp))://[a-z0-9\-]+\.([a-z0-9\-\.]+)+/?([a-zA-Z0-9\.\-_%]+/?)*\??([a-zA-Z0-9=&\[\];%]+)?(\#[a-zA-Z0-9\-_]+)?)#', '\\1<a href="\\2">\\2</a>', $result); + //$result = preg_replace('#([a-z0-9\._\-]+@[[a-z0-9\-\.]+[a-z]+)#si', '<a href="mailto:\\1">\\1</a>', $result); + + return $result; + } + + + /** + * Helper function to convert a language name to the file name where its data will reside + * + * @return The absolute path of the language file where the current language data will be sourced + */ + function _getLanguageDataFile () + { + geshi_dbg('GeSHi::_getLanguageDataFile()', GESHI_DBG_API); + if ('/' == GESHI_DIR_SEPARATOR) { + $language_file = $this->_language . $this->_styler->fileExtension; + } else { + $language_file = explode('/', $this->_language); + $language_file = implode(GESHI_DIR_SEPARATOR, $language_file) . $this->_styler->fileExtension; + } + geshi_dbg('Language file is ' . $language_file, GESHI_DBG_API); + return GESHI_LANGUAGES_ROOT . $language_file; + } + /**#@-*/ +} +?> + diff --git a/paste/include/geshi/.project b/paste/include/geshi/.project new file mode 100644 index 0000000..2ba3183 --- /dev/null +++ b/paste/include/geshi/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>geshi-src</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>net.sourceforge.phpeclipse.parserbuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>net.sourceforge.phpeclipse.phpnature</nature> + </natures> +</projectDescription> diff --git a/paste/include/geshi/classes/class.geshicodecontext.php b/paste/include/geshi/classes/class.geshicodecontext.php new file mode 100644 index 0000000..53ac023 --- /dev/null +++ b/paste/include/geshi/classes/class.geshicodecontext.php @@ -0,0 +1,550 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package core + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** + * This class represents a "Code" context - one where keywords and + * regular expressions can be used to highlight part of the context. + * + * If the context you are in requires keyword or regular expression + * support, then GeSHiCodeContext is the context type that you need. + * + * <b>Usage:</b> + * + * Use this class in a context or language file, to define a code + * context: + * + * <pre> 'CHILD_CONTEXTS' => array( + * ... + * new GeSHiCodeContext([params]) + * ... + * ),</pre> + * + * <pre> 'CONTEXTS' => array( + * ... + * new GeSHiCodeContext([params]) + * ... + * ),</pre> + * + * @package core + * @author Nigel McNie <nigel@geshi.org> + * @since 1.1.0 + * @version 1.1.0 + * @see GeSHiContext + * + */ +class GeSHiCodeContext extends GeSHiContext +{ + /**#@+ + * @var array + * @access private + */ + + /** + * Keywords for this code context + * @var array + */ + var $_contextKeywords = array(); + + /** + * Characters that cannot appear before a keyword + * @var array + */ + var $_contextCharactersDisallowedBeforeKeywords = array(); + + /** + * Characters that cannot appear after a keyword + * @var array + */ + var $_contextCharactersDisallowedAfterKeywords = array(); + + /** + * A lookup table for use with regex matched starters/enders + * @var array + */ + var $_contextKeywordLookup; + + /** + * A symbol array + * @var array + */ + var $_contextSymbols = array(); + + /** + * A regex array + * @var array + */ + var $_contextRegexps = array(); + + /** + * An array of object "splitters" + */ + var $_objectSplitters = array(); + + /** + * Whether this code context has finished loading yet + * @todo [blocking 1.1.1] Do this by static variable? + */ + var $_codeContextLoaded = false; + + /**#@-*/ + + + /** + * Redefinition of {@link GeSHiContext::load()} in order to also + * load keywords, regular expressions etc. + * + */ + function load (&$styler) + { + parent::load($styler); + + if ($this->_codeContextLoaded) { + return; + } + $this->_codeContextLoaded = true; + + // Add regex for methods + foreach ($this->_objectSplitters as $data) { + $splitter_match = ''; + foreach ($data[0] as $splitter) { + $splitter_match .= preg_quote($splitter) . '|'; + } + + $this->_contextRegexps[] = array( + 0 => array( + "#(" . substr($splitter_match, 0, -1) . ")(\s*)([a-zA-Z\*\(_][a-zA-Z0-9_\*]*)#" + ), + 1 => '', // char to check for + 2 => array( + 1 => true, + 2 => true, // highlight splitter + 3 => array($data[1], $data[2], $data[3]) // $data[3] says whether to give code a go at the match first + ) + ); + } + } + + /** + * Overrides GeSHiContext::loadStyleData to load style data + */ + function loadStyleData () + { + // @todo [blocking 1.1.1] Skip if already loaded??? + // Set styles for keywords + //geshi_dbg('Loading style data for context ' . $this->getName(), GESHI_DBG_PARSE); + // @todo [blocking 1.1.1] Style data for infectious context loaded many times, could be reduced to one? + //@todo [blocking 1.1.1] array_keys loop construct if possible + foreach ($this->_contextKeywords as $keyword_group_array) { + geshi_dbg($keyword_group_array[1] . ' ' . $keyword_group_array[2], GESHI_DBG_PARSE); + $this->_styler->setStyle($keyword_group_array[1], $keyword_group_array[2]); + } + + // Set styles for regex groups + foreach ($this->_contextRegexps as $data) { + foreach ($data[2] as $group) { + $this->_styler->setStyle($group[0], $group[1]); + } + } + + // Set styles for symbols + foreach ($this->_contextSymbols as $data) { + $this->_styler->setStyle($data[1], $data[2]); + } + + parent::loadStyleData(); + } + + /** + * Overrides {@link GeSHiContext::_addParseData()} to highlight a code context, including + * keywords, symbols and regular expression matches + * + * @param string The code to add as parse data + * @param string The first character of the context after this + */ + function _addParseData ($code, $first_char_of_next_context = '') + { + //$first_char_of_next_context = ''; + geshi_dbg('GeSHiCodeContext::_addParseData(' . substr($code, 0, 15) . ', ' . $first_char_of_next_context . ')', GESHI_DBG_PARSE); + + $regex_matches = array(); + foreach ($this->_contextRegexps as $regex_group_key => $regex_data) { + geshi_dbg(' Regex group: ' . $regex_group_key, GESHI_DBG_PARSE); + // Set style of this group + // $regex_data = array( + // 0 => regex (with brackets to signify groupings + // 1 => a string that if not matched, this part ain't done (speeds stuff up) + // 2 => array( + // 1 => array(name of first group, default style of first group) + // 2 => array(name of second group, ... + // ... + if (!$regex_data[1] || false !== strpos($code, $regex_data[1])) { + foreach ($regex_data[0] as $regex) { + geshi_dbg(' Trying regex ' . $regex . '... ', GESHI_DBG_PARSE, false); + $matches = array(); + preg_match_all($regex, $code, $matches); + geshi_dbg('found ' . count($matches[0]) . ' matches', GESHI_DBG_PARSE); + + // If there are matches... + if (count($matches[0])) { + foreach ($matches[0] as $key => $match) { + // $match is the full match of the regex. We need to get it out of the string, + // although we also need its position in the string + $pos = strpos($code, $match); + // neat splicey jobbie to get rid of the keyword (can't do str_replace...) + // ADDED SPACE FILLERS + $code = substr($code, 0, $pos) . str_repeat("\0", strlen($match)) . substr($code, $pos + strlen($match)); + + // make an array of data for this regex + $data = array(); + foreach ($matches as $match_data) { + $data[] = $match_data[$key]; + } + $regex_matches[] = array(0 => $pos, 1 => $regex_group_key, 2 => $data); + } + } + } + } + } + geshi_dbg(' Regex matches: ' . str_replace("\n", "\r", print_r($regex_matches, true)), GESHI_DBG_PARSE); + + $regex_replacements = array(); + foreach ($regex_matches as $data) { + // $data[0] is the pos + // $data[1] is the key + // $data[2][0] contains the full match + // $data[2][1] contains what is in the first brackets + // $data[2][2] contains what is in the second brackets... + foreach ($data[2] as $key => $match) { + // skip the full match which is in $data[2][0] + if ($key) { + // If there is a name for this bracket group ($key) in this regex group ($data[1])... + if (isset($this->_contextRegexps[$data[1]][2][$key]) && is_array($this->_contextRegexps[$data[1]][2][$key])) { + // If we should be attempting to have a go at code highlighting first... + if (/*isset($this->_contextRegexps[$data[1]][2][$key][2]) && */ + true === $this->_contextRegexps[$data[1]][2][$key][2]) { + // Highlight the match, and put the code into the result + $highlighted_matches = $this->_codeContextHighlight($match); + foreach ($highlighted_matches as $stuff) { + if ($stuff[1] == $this->_contextName) { + $regex_replacements[$data[0]][] = array($stuff[0], $this->_contextRegexps[$data[1]][2][$key][0]); + } else { + $regex_replacements[$data[0]][] = $stuff; + } + } + } else { + $regex_replacements[$data[0]][] = array($match, + $this->_contextRegexps[$data[1]][2][$key][0]); //name in [0], s in [1] + } + // Else, perhaps it is simply set. If so, we highlight it as if it were + // part of the code context + } elseif (isset($this->_contextRegexps[$data[1]][2][$key])) { + // this may end up as array(array(match,name),array(match,name),array..) + //@todo [blocking 1.1.1] may need to pass the first char of next context here if it's at the end... + $parse_data = $this->_codeContextHighlight($match); + foreach ($parse_data as $pdata) { + $regex_replacements[$data[0]][] = $pdata; + } + } + // Else, don't add it at all... + } + } + } + geshi_dbg(' Regex replacements: ' . str_replace("\n", "\r", print_r($regex_replacements, true)), GESHI_DBG_PARSE); + // Now what we do is make an array that looks like this: + // array( + // [position] => [replacement for regex] + // [position] => [replacement for regex] + // ... + // ) + // so we can put them back in as we build the result + + + // The aim is to end up with an array( + // 0 => array(code, contextname) + // 1 => array(code, contextname) + // 2 => ... + // + // $regex_replacements is an array( + // pos => array of arrays like the above, in order + // pos => ... + // + // codeContextHighlight should return something similar + + $parse_data = $this->_codeContextHighlight($code, $regex_replacements, $first_char_of_next_context); + foreach ($parse_data as $data) { + if (!isset($data[2])) { + $this->_styler->addParseData($data[0], $data[1]); + } else { + $this->_styler->addParseData($data[0], $data[1], $data[2]); + } + } + } + + + /** + * Given code, returns an array of context data about it + */ + function _codeContextHighlight ($code, $regex_replacements = array(), $first_char_of_next_context = '') + { + geshi_dbg('GeSHiCodeContext::_codeContextHighlight(' . substr($code, 0, 15) . ', ' . + (($regex_replacements) ? 'array(...)' : 'null') . ', ' . $first_char_of_next_context . ')', GESHI_DBG_PARSE); + //$first_char_of_next_context = ''; + + if (!is_array($this->_contextKeywordLookup)) { + $this->_createContextKeywordLookup(); + } + + $result = array(0 => array('', '')); + $result_pointer = 0; + $length = strlen($code); + $keyword_match_allowed = true; + $earliest_pos = false; + $earliest_keyword = ''; + $earliest_keyword_group = 0; + + // For each character + for ($i = 0; $i < $length; $i++) { + if (isset($regex_replacements[$i])) { + geshi_dbg(' Regex replacements available at position ' . $i . ': ' . $regex_replacements[$i][0][0] . '...', GESHI_DBG_PARSE); + // There's regular expressions expected to go here + foreach ($regex_replacements[$i] as $replacement) { + $result[++$result_pointer] = $replacement; + } + // Allow keyword matching immediately after regular expressions + $keyword_match_allowed = true; + } + + $char = substr($code, $i, 1); + if ("\0" == $char) { + // Not interested in null characters inserted by regex replacements + continue; + } + + // Take symbols into account before doing this + if (!$this->_contextKeywordLookup) { + $this->_checkForSymbol($char, $result, $result_pointer); + continue; + } + + geshi_dbg('@b Current char is: ' . str_replace("\n", '\n', $char), GESHI_DBG_PARSE); + + if ($keyword_match_allowed && isset($this->_contextKeywordLookup[$char])) { + foreach ($this->_contextKeywordLookup[$char] as $keyword_array) { + // keyword array is 0 => keyword, 1 => kwgroup + if (strlen($keyword_array[0]) < $earliest_keyword) { + // We can skip keywords that are shorter than the best + // earliest we can currently do + geshi_dbg(' [skipping ' . $keyword_array[0], GESHI_DBG_PARSE); + continue; + } + geshi_dbg(' Checking code for ' . $keyword_array[0], GESHI_DBG_PARSE); + // If case sensitive + if ($this->_contextKeywords[$keyword_array[1]][3]) { + $next_part_is_keyword = ($keyword_array[0] == substr($code, $i, strlen($keyword_array[0]))); + } else { + $next_part_is_keyword = (strtolower($keyword_array[0]) == strtolower(substr($code, $i, strlen($keyword_array[0])))); + } + + geshi_dbg(" next part is keyword: $next_part_is_keyword", GESHI_DBG_PARSE); + // OPTIMIZE (use lookup to remember for length $foo(1 => false, 2 => false) so if kw is length 1 or 2 then don't need to check + //$after_allowed = ( !in_array(substr($code, $i + strlen($keyword_array[0]), 1), array_diff($this->_context_characters_disallowed_after_keywords, $this->_context_keywords[$keyword_array[1]][4])) ); + // the first char of the keyword is always $char??? + $after_char = substr($code, $i + strlen($keyword_array[0]), 1); + // if '' == $after_char, it's at the end of the context so we need + // the first char from the next context... + if ( '' == $after_char ) $after_char = $first_char_of_next_context; + + geshi_dbg(" after char to check: |$after_char|", GESHI_DBG_PARSE); + $after_allowed = ('' == $after_char || !ctype_alnum($after_char) || + (ctype_alnum($after_char) && + !ctype_alnum($char)) ); + $after_allowed = ($after_allowed && + !in_array($after_char, $this->_contextCharactersDisallowedAfterKeywords)); + // Disallow underscores after keywords + $after_allowed = ($after_allowed && ($after_char != '_')); + + // If where we are up to is a keyword, and it's allowed to be here (before was already + // tested by $keyword_match_allowed) + if ($next_part_is_keyword && $after_allowed) { + //if ( false === $earliest_pos || $pos < $earliest_pos || ($pos == $earliest_pos && strlen($keyword_array[0]) > strlen($earliest_keyword)) ) + if (strlen($keyword_array[0]) > strlen($earliest_keyword)) { + geshi_dbg('@bfound', GESHI_DBG_PARSE); + // what is _pos for? + // What are any of them for?? + $earliest_pos = true;//$pos; + // BUGFIX: just in case case sensitive matching used, get data from string + // instead of from data array + $earliest_keyword = substr($code, $i, strlen($keyword_array[0])); + $earliest_keyword_group = $keyword_array[1]; + } + } + } + } + + // reset matching of keywords + //$keyword_match_allowed = false; + + //echo "Current pos = $i, earliest keyword is " . htmlspecialchars($earliest_keyword) . ' at ' . $earliest_pos . "\n"; + //echo "Symbol string is |$current_symbols|\n"; + + if (false !== $earliest_pos) { + geshi_dbg('Keyword matched: ' . $earliest_keyword, GESHI_DBG_PARSE); + // there's a keyword match! + + $result[++$result_pointer] = array($earliest_keyword, + $this->_contextKeywords[$earliest_keyword_group][1], + $this->_getURL($earliest_keyword, $earliest_keyword_group)); + $i += strlen($earliest_keyword) - 1; + geshi_dbg("strlen of earliest keyword is " . strlen($earliest_keyword) . " (pos is $i)", GESHI_DBG_PARSE); + // doesn't help + $earliest_pos = false; + $earliest_keyword = ''; + } else { + // Check for a symbol instead + $this->_checkForSymbol($char, $result, $result_pointer); + } + + /// If we move this to the end we might be able to get rid of the last one [DONE] + /// The second test on the first line is a little contentious - allows functions that don't + /// start with an alpha character to be within other words, e.g abc<?php, where <?php is a kw + $before_char = substr($code, $i, 1); + $before_char_is_alnum = ctype_alnum($before_char); + $keyword_match_allowed = (!$before_char_is_alnum || ($before_char_is_alnum && !ctype_alnum($char))); + $keyword_match_allowed = ($keyword_match_allowed && !in_array($before_char, + $this->_contextCharactersDisallowedBeforeKeywords)); + // Disallow underscores before keywords + $keyword_match_allowed = ($keyword_match_allowed && ('_' != $before_char)); + geshi_dbg(' Keyword matching allowed: ' . $keyword_match_allowed, GESHI_DBG_PARSE); + geshi_dbg(' [checked ' . substr($code, $i, 1) . ' against ' . print_r($this->_contextCharactersDisallowedBeforeKeywords, true), GESHI_DBG_PARSE); + } + + unset($result[0]); + //geshi_dbg('@b Resultant Parse Data:', GESHI_DBG_PARSE); + //geshi_dbg(str_replace("\n", "\r", print_r($result, true)), GESHI_DBG_PARSE); + //return array(array($code, $this->_contextName)); + return $result; + } + + + /** + * Checks the specified character to see if it is a symbol, and + * adds it to the result array according to its findings. + * + * @param string The possible symbol to check + * @param array The current result data that will be appended to + * @param int The pointer to the current result record + */ + function _checkForSymbol($possible_symbol, &$result,&$result_pointer) + { + $skip = false; + geshi_dbg('Checking ' . $possible_symbol . ' for symbol match', GESHI_DBG_PARSE); + foreach ($this->_contextSymbols as $symbol_data) { + if (in_array($possible_symbol, $symbol_data[0])) { + // we've matched the symbol in $symbol_group + // start the current symbols string + if ($result[$result_pointer][1] == $symbol_data[1]) { + $result[$result_pointer][0] .= $possible_symbol; + } else { + $result[++$result_pointer] = array($possible_symbol, $symbol_data[1]); + } + $skip = true; + break; + } + } + if (!$skip) { + if ($result[$result_pointer][1] == $this->_contextName) { + $result[$result_pointer][0] .= $possible_symbol; + } else { + $result[++$result_pointer] = array($possible_symbol, $this->_contextName); + } + } + } + + /// THIS FUNCTION NEEDS TO DIE!!! + /// When language files are able to be compiled, they should list their keywords + /// in this form already. + function _createContextKeywordLookup () + { + geshi_dbg('GeSHiCodeContext::_createContextKeywordLookup()', GESHI_DBG_PARSE); + + $this->_contextKeywordLookup = array(); + foreach ($this->_contextKeywords as $keyword_group_key => $keyword_group_array) { + geshi_dbg(" keyword group key: $keyword_group_key", GESHI_DBG_PARSE); + + foreach ($keyword_group_array[0] as $keyword) { + // If keywords are case sensitive, add them straight in. + // Otherwise, if they're not and the first char of the lookup is alphabetical, + // add it to both parts of the lookup (a and A for example). + $key = substr($keyword, 0, 1); + if (ctype_alpha($key) && !$keyword_group_array[3]) { + $this->_contextKeywordLookup[strtoupper(substr($keyword, 0, 1))][] = + array(0 => $keyword, 1 => $keyword_group_key /*$keyword_group_array[1]*/); + $this->_contextKeywordLookup[strtolower(substr($keyword, 0, 1))][] = + array(0 => $keyword, 1 => $keyword_group_key /*$keyword_group_array[1]*/); + } else { + $this->_contextKeywordLookup[$key][] = + array(0 => $keyword, 1 => $keyword_group_key /*$keyword_group_array[1]*/); + } + } + } + if (isset($key)) { + geshi_dbg(' Lookup created, first entry: ' . print_r($this->_contextKeywordLookup[$key][0], true), GESHI_DBG_PARSE); + } else { + geshi_dbg(' Lookup created with no entries', GESHI_DBG_PARSE); + } + } + + + /** + * Turns keywords into <a href="url">>keyword<</a> if needed + * + * @todo [blocking 1.1.5] This method still needs to listen to set_link_target, set_link_styles etc + */ + function _getURL ($keyword, $earliest_keyword_group) + { + if ($this->_contextKeywords[$earliest_keyword_group][4] != '') { + // Remove function_exists() call? Valid language files will define functions required... + if (substr($this->_contextKeywords[$earliest_keyword_group][4], -2) == '()' && + function_exists(substr($this->_contextKeywords[$earliest_keyword_group][4], 0, -2))) { + $href = call_user_func(substr($this->_contextKeywords[$earliest_keyword_group][4], 0, -2), $keyword); + } else { + $href = str_replace('{FNAME}', $keyword, $this->_contextKeywords[$earliest_keyword_group][4]); + } + return $href; + } + return ''; + } +} + +?> diff --git a/paste/include/geshi/classes/class.geshicontext.php b/paste/include/geshi/classes/class.geshicontext.php new file mode 100644 index 0000000..964d8b3 --- /dev/null +++ b/paste/include/geshi/classes/class.geshicontext.php @@ -0,0 +1,721 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package core + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** + * The GeSHiContext class + * + * @package core + * @author Nigel McNie + * @since 1.1.0 + * @version 1.1.0 + */ +class GeSHiContext +{ + /**#@- + * @access private + */ + + /** + * The context name. A unique identifier that corresponds to a path under + * the GESHI_CLASSES_ROOT folder where the configuration file for this + * context is. + * @var string + */ + var $_contextName; + + /** + * The file name from where to load data for this context + * @var string + */ + var $_fileName; + + /** + * The dialect name of this context + * @var string + */ + var $_dialectName; + + /** + * The styler helper object + * @var GeSHiStyler + */ + var $_styler; + + /** + * The context delimiters + * @var array + */ + var $_contextDelimiters = array(); + + /** + * The child contexts + * @var array + */ + var $_childContexts = array(); + + /** + * The style type of this context, used for backward compatibility + * with GeSHi 1.0.X + * @var int + */ + var $_contextStyleType = GESHI_STYLE_NONE; + + /** + * Delimiter parse data. Controls which context - the parent or child - + * should parse the delimiters for a context + * @var int + */ + var $_delimiterParseData = GESHI_CHILD_PARSE_BOTH; + + /** + * The overriding child context, if any + * @var GeSHiContext + */ + var $_overridingChildContext; + + /** + * The matching regex table for regex starters + * @var array + */ + var $_startRegexTable = array(); + + /** + * The "infectious context". Will be used to "infect" the context + * tree with itself - this is how PHP inserts itself into HTML contexts + * @var GeSHiContext + */ + var $_infectiousContext; + + /** + * Whether this context has been already loaded + * @var boolean + */ + var $_loaded = false; + + /** + * The name for stuff detected in the start of a context + * @var string + */ + var $_startName = 'start'; + + /** + * The name for stuff detected in the end of a context + * @var string + */ + var $_endName = 'end'; + + /** + * Whether this context is an alias context + * @var boolean + */ + var $_isAlias = false; + /**#@-*/ + + /** + * Creates a new GeSHiContext. + * + * @param string The name of the language this context represents + * @param string The dialect of the language this context represents + * @param string The name of the context + * @param array The name used for aliasing + * @todo [blocking 1.1.9] Better comment + */ + function GeSHiContext ($language_name, $dialect_name = '', $context_name = '', $alias_name = '') + { + // Set dialect + if ('' == $dialect_name) { + $dialect_name = $language_name; + } + $this->_dialectName = $dialect_name; + + // Set the context and file names + if ('' == $context_name) { + // Root of a language + $this->_fileName = $this->_contextName = $language_name . '/' . $dialect_name; + return; + } + if (0 === strpos($context_name, 'common')) { + $this->_fileName = $context_name; + // Strip "common/" from context name to get the actual name... + $context_name = substr($context_name, 7); + } else { + $this->_fileName = $language_name . '/' . $context_name; + } + if ($alias_name) { + $this->_contextName = $alias_name; + $this->_isAlias = true; + } else { + $this->_contextName = "$language_name/$dialect_name/$context_name"; + } + } + + /** + * Returns the name of this context + * + * @return string The full name of this context (language, dialect and context) + */ + function getName () + { + return $this->_contextName; + } + + function getStartName () + { + return $this->_startName; + } + + function getEndName () + { + return $this->_endName; + } + + function isAlias () + { + return $this->_isAlias; + } + + /** + * Loads the context data + */ + function load (&$styler) + { + geshi_dbg('Loading context: ' . $this->_contextName, GESHI_DBG_PARSE); + + if ($this->_loaded) { + geshi_dbg('@oAlready loaded', GESHI_DBG_PARSE); + return; + } + $this->_loaded = true; + + $this->_styler =& $styler; + + if (!geshi_can_include(GESHI_CONTEXTS_ROOT . $this->_fileName . $this->_styler->fileExtension)) { + geshi_dbg('@e Cannot get context information for ' . $this->getName() . ' from file ' + . GESHI_CONTEXTS_ROOT . $this->_fileName . $this->_styler->fileExtension, GESHI_DBG_ERR); + return array('code' => GESHI_ERROR_FILE_UNAVAILABLE, 'name' => $this->_contextName); + } + + // Load the data for this context + $CONTEXT = $this->_contextName; + $CONTEXT_START = "$this->_contextName/$this->_startName"; + $CONTEXT_END = "$this->_contextName/$this->_endName"; + $DIALECT = $this->_dialectName; + // @todo [blocking 1.1.5] This needs testing to see if it is faster + if (false) { + $language_file_name = GESHI_CONTEXTS_ROOT . $this->_contextName . $this->_styler->fileExtension; + $cached_data = $this->_styler->getCacheData($language_file_name); + if (null == $cached_data) { + // Data not loaded for this context yet + //geshi_dbg('@wLoading data for context ' . $this->_contextName, GESHI_DBG_PARSE); + // Get the data, stripping the start/end PHP code markers which aren't allowed in eval() + $cached_data = substr(implode('', file($language_file_name)), 5, -3); + $this->_styler->setCacheData($language_file_name, $cached_data); + } else { + //geshi_dbg('@oRetrieving data from cache for context ' . $this->_contextName, GESHI_DBG_PARSE); + } + eval($cached_data); + } else { + require GESHI_CONTEXTS_ROOT . $this->_fileName . $this->_styler->fileExtension; + } + + // Push the infectious context into the child contexts + if (null != $this->_infectiousContext) { + // Add the context to each of the current contexts... + $keys = array_keys($this->_childContexts); + foreach ($keys as $key) { + $this->_childContexts[$key]->infectWith($this->_infectiousContext); + } + // And add the infectious context to this context itself + $this->_childContexts[] =& $this->_infectiousContext; + geshi_dbg(' Added infectious context ' . $this->_infectiousContext->getName() + . ' to ' . $this->getName(), GESHI_DBG_PARSE); + } + + // Recursively load the child contexts + $keys = array_keys($this->_childContexts); + foreach ($keys as $key) { + $this->_childContexts[$key]->load($styler); + } + + // Load the overriding child context, if any + if ($this->_overridingChildContext) { + if (null != $this->_infectiousContext) { + $this->_overridingChildContext->infectWith($this->_infectiousContext); + } + $this->_overridingChildContext->load($styler); + } + //geshi_dbg('@o Finished loading context ' . $this->_styleName . ' successfully', GESHI_DBG_PARSE); + } + + /** + * Adds an "infectious child" to this context. + * + * Relies on child being a subclass of or actually being a GeSHiContext + */ + function infectWith (&$context) + { + $this->_infectiousContext =& $context; + //geshi_dbg(' Added infectious context ' . $context->getName() + // . ' to ' . $this->getName(), GESHI_DBG_PARSE); + } + + + /** + * Loads style data for the given context. Not implemented here, but can be overridden + * by a child class to get style data from its parent + * + * Note to self: This is needed by GeSHiCodeContext, so don't touch it! + */ + function loadStyleData () + { + //geshi_dbg('Loading style data for context ' . $this->getName(), GESHI_DBG_PARSE); + // Recursively load the child contexts + $keys = array_keys($this->_childContexts); + foreach ($keys as $key) { + $this->_childContexts[$key]->loadStyleData(); + } + + // Load the style data for the overriding child context, if any + if ($this->_overridingChildContext) { + $this->_overridingChildContext->loadStyleData(); + } + } + + /** + * Checks each child to see if it's useful. If not, then remove it + * + * @param string The code that can be used to check if a context + * is needed. + */ + function trimUselessChildren ($code) + { + //geshi_dbg('GeSHiContext::trimUselessChildren()', GESHI_DBG_API | GESHI_DBG_PARSE); + $new_children = array(); + $keys = array_keys($this->_childContexts); + + foreach ($keys as $key) { + //geshi_dbg(' Checking child: ' . $this->_childContexts[$key]->getName() . ': ', GESHI_DBG_PARSE, false); + if (!$this->_childContexts[$key]->contextCanStart($code)) { + // This context will _never_ be useful - and nor will its children + //geshi_dbg('@buseless, removed', GESHI_DBG_PARSE); + // RAM saving technique + // But we shouldn't remove highlight data if the child is an + // "alias" context, since the real context might need the data + if (!$this->_childContexts[$key]->isAlias()) { + $this->_styler->removeStyleData($this->_childContexts[$key]->getName(), + $this->_childContexts[$key]->getStartName(), + $this->_childContexts[$key]->getEndName()); + } + unset($this->_childContexts[$key]); + } + } + + // Recurse into the remaining children, checking them + $keys = array_keys($this->_childContexts); + foreach ($keys as $key) { + $this->_childContexts[$key]->trimUselessChildren($code); + } + } + + /** + * Parses the given code + */ + function parseCode (&$code, $context_start_key = -1, $context_start_delimiter = '', $ignore_context = '', + $first_char_of_next_context = '') + { + geshi_dbg('*** GeSHiContext::parseCode(' . $this->_contextName . ') ***', GESHI_DBG_PARSE); + geshi_dbg('CODE: ' . str_replace("\n", "\r", substr($code, 0, 100)) . "<<<<<\n", GESHI_DBG_PARSE); + if ($context_start_delimiter) geshi_dbg('Delimiter: ' . $context_start_delimiter, GESHI_DBG_PARSE); + // Skip empty/almost empty contexts + if (!$code || ' ' == $code) { + $this->_addParseData($code); + return; + } + + // FIRST: + // If there is an "overriding child context", it should immediately take control + // of the entire parsing. + // An "overriding child context" has the following properties: + // * No starter or ender delimiter + // + // The overridden context has the following properties: + // * Explicit starter/ender + // * No children (they're not relevant after all) + // + // An example: HTML embeds CSS highlighting by using the html/css context. This context + // has one overriding child context: css. After all, once in the CSS context, HTML don't care + // anymore. + // Likewise, javascript embedded in HTML is an overriding child - HTML does the work of deciding + // exactly where javascript gets called, and javascript does the rest. + // + + // If there is an overriding context... + if ($this->_overridingChildContext) { + // Find the end of this thing + $finish_data = $this->_getContextEndData($code, $context_start_key, $context_start_delimiter, true); // true? + // If this context should not parse the ender, add it on to the stuff to parse + if ($this->shouldParseEnder()) { + $finish_data['pos'] += $finish_data['len']; + } + // Make a temp copy of the stuff the occ will parse + $tmp = substr($code, 0, $finish_data['pos']); + // Tell the occ to parse the copy + $this->_overridingChildContext->parseCode($tmp); // start with no starter at all + // trim the code + $code = substr($code, $finish_data['pos']); + return; + } + + // Add the start of this context to the parse data if it is already known + if ($context_start_delimiter) { + $this->_addParseDataStart($context_start_delimiter); + $code = substr($code, strlen($context_start_delimiter)); + } + + $original_length = strlen($code); + + while ('' != $code) { + if (strlen($code) != $original_length) { + geshi_dbg('CODE: ' . str_replace("\n", "\r", substr($code, 0, 100)) . "<<<<<\n", GESHI_DBG_PARSE); + } + // Second parameter: if we are at the start of the context or not + // Pass the ignored context so it can be properly ignored + $earliest_context_data = $this->_getEarliestContextData($code, strlen($code) == $original_length, + $ignore_context); + $finish_data = $this->_getContextEndData($code, $context_start_key, $context_start_delimiter, + strlen($code) == $original_length); + geshi_dbg('@bEarliest context data: pos=' . $earliest_context_data['pos'] . ', len=' . + $earliest_context_data['len'], GESHI_DBG_PARSE); + geshi_dbg('@bFinish data: pos=' . $finish_data['pos'] . ', len=' . $finish_data['len'], GESHI_DBG_PARSE); + + // If there is earliest context data we parse up to it then hand control to that context + if ($earliest_context_data) { + if ($finish_data) { + // Merge to work out who wins + if ($finish_data['pos'] <= $earliest_context_data['pos']) { + geshi_dbg('Earliest context and Finish data: finish is closer', GESHI_DBG_PARSE); + + // Add the parse data + $this->_addParseData(substr($code, 0, $finish_data['pos']), substr($code, $finish_data['pos'], 1)); + + // If we should pass the ender, add the parse data + if ($this->shouldParseEnder()) { + $this->_addParseDataEnd(substr($code, $finish_data['pos'], $finish_data['len'])); + $finish_data['pos'] += $finish_data['len']; + } + // Trim the code and return the unparsed delimiter + $code = substr($code, $finish_data['pos']); + return $finish_data['dlm']; + } else { + geshi_dbg('Earliest and finish data, but earliest gets priority', GESHI_DBG_PARSE); + $foo = true; + } + } else { $foo = true; /** no finish data */} + + if (isset($foo)) geshi_dbg('Earliest data but not finish data', GESHI_DBG_PARSE); + // Highlight up to delimiter + ///The "+ len" can be manipulated to do starter and ender data + if (!$earliest_context_data['con']->shouldParseStarter()) { + $earliest_context_data['pos'] += $earliest_context_data['len']; + //BUGFIX: null out dlm so it doesn't squash the actual rest of context + $earliest_context_data['dlm'] = ''; + } + + // We should parseCode() the substring. + // BUT we have to remember that we should ignore the child context we've matched, + // else we'll have a wee recursion problem on our hands... + $tmp = substr($code, 0, $earliest_context_data['pos']); + $this->parseCode($tmp, -1, '', $earliest_context_data['con']->getName(), + substr($code, $earliest_context_data['pos'], 1)); // parse with no starter + $code = substr($code, $earliest_context_data['pos']); + $ender = $earliest_context_data['con']->parseCode($code, $earliest_context_data['key'], $earliest_context_data['dlm']); + // check that the earliest context actually wants the ender + if (!$earliest_context_data['con']->shouldParseEnder() && $earliest_context_data['dlm'] == $ender) { + geshi_dbg('earliest_context_data[dlm]=' . $earliest_context_data['dlm'] . ', ender=' . $ender, GESHI_DBG_PARSE); + // second param = first char of next context + $this->_addParseData(substr($code, 0, strlen($ender)), substr($code, strlen($ender), 1)); + $code = substr($code, strlen($ender)); + } + } else { + if ($finish_data) { + // finish early... + geshi_dbg('No earliest data but finish data', GESHI_DBG_PARSE); + + // second param = first char of next context + $this->_addParseData(substr($code, 0, $finish_data['pos']), substr($code, $finish_data['pos'], 1)); + + if ($this->shouldParseEnder()) { + $this->_addParseDataEnd(substr($code, $finish_data['pos'], $finish_data['len'])); + $finish_data['pos'] += $finish_data['len']; + } + $code = substr($code, $finish_data['pos']); + // return the length for use above + return $finish_data['dlm']; + } else { + geshi_dbg('No earliest or finish data', GESHI_DBG_PARSE); + // All remaining code is in this context + $this->_addParseData($code, $first_char_of_next_context); + $code = ''; + return; // not really needed (?) + } + } + } + } + + /** + * @return true if this context wants to parse its start delimiters + */ + function shouldParseStarter() + { + return $this->_delimiterParseData & GESHI_CHILD_PARSE_LEFT; + } + + /** + * @return true if this context wants to parse its end delimiters + */ + function shouldParseEnder () + { + return $this->_delimiterParseData & GESHI_CHILD_PARSE_RIGHT; + } + + /** + * Return true if it is possible for this context to parse this code at all + */ + function contextCanStart ($code) + { + foreach ($this->_contextDelimiters as $key => $delim_array) { + foreach ($delim_array[0] as $delimiter) { + geshi_dbg(' Checking delimiter ' . $delimiter . '... ', GESHI_DBG_PARSE, false); + $data = geshi_get_position($code, $delimiter, 0, $delim_array[2]); + + if (false !== $data['pos']) { + return true; + } + } + } + return false; + } + + /** + * Works out the closest child context + * + * @param $ignore_context The context to ignore (if there is one) + */ + function _getEarliestContextData ($code, $start_of_context, $ignore_context) + { + geshi_dbg(' GeSHiContext::_getEarliestContextData(' . $this->_contextName . ', '. $start_of_context . ')', GESHI_DBG_API | GESHI_DBG_PARSE); + $earliest_pos = false; + $earliest_len = false; + $earliest_con = null; + $earliest_key = -1; + $earliest_dlm = ''; + + foreach ($this->_childContexts as $context) { + if ($ignore_context == $context->getName()) { + // whups, ignore you... + continue; + } + $data = $context->getContextStartData($code, $start_of_context); + geshi_dbg(' ' . $context->_contextName . ' says it can start from ' . $data['pos'], GESHI_DBG_PARSE, false); + + if (-1 != $data['pos']) { + if ((false === $earliest_pos) || $earliest_pos > $data['pos'] || + ($earliest_pos == $data['pos'] && $earliest_len < $data['len'])) { + geshi_dbg(' which is the earliest position', GESHI_DBG_PARSE); + $earliest_pos = $data['pos']; + $earliest_len = $data['len']; + $earliest_con = $context; + $earliest_key = $data['key']; + $earliest_dlm = $data['dlm']; + } else { + geshi_dbg('', GESHI_DBG_PARSE); + } + } else { + geshi_dbg('', GESHI_DBG_PARSE); + } + } + // What do we need to know? + // Well, assume that one of the child contexts can parse + // Then, parseCode() is going to call parseCode() recursively on that object + // + if (false !== $earliest_pos) { + return array('pos' => $earliest_pos, 'len' => $earliest_len, 'con' => $earliest_con, 'key' => $earliest_key, 'dlm' => $earliest_dlm); + } else { + return false; + } + } + + /** + * Checks the context delimiters for this context against the passed + * code to see if this context can help parse the code + */ + function getContextStartData ($code, $start_of_context) + { + //geshi_dbg(' GeSHi::getContextStartInformation(' . $this->_contextName . ')', GESHI_DBG_PARSE | GESHI_DBG_API); + geshi_dbg(' ' . $this->_contextName, GESHI_DBG_PARSE); + + $first_position = -1; + $first_length = -1; + $first_key = -1; + $first_dlm = ''; + + foreach ($this->_contextDelimiters as $key => $delim_array) { + foreach ($delim_array[0] as $delimiter) { + geshi_dbg(' Checking delimiter ' . $delimiter . '... ', GESHI_DBG_PARSE, false); + $data = geshi_get_position($code, $delimiter, 0, $delim_array[2], true); + geshi_dbg(print_r($data, true), GESHI_DBG_PARSE, false); + $position = $data['pos']; + $length = $data['len']; + if (isset($data['tab'])) { + geshi_dbg('Table: ' . print_r($data['tab'], true), GESHI_DBG_PARSE); + $this->_startRegexTable = $data['tab']; + $delimiter = $data['tab'][0]; + } + + if (false !== $position) { + geshi_dbg('found at position ' . $position . ', checking... ', GESHI_DBG_PARSE, false); + if ((-1 == $first_position) || ($first_position > $position) || + (($first_position == $position) && ($first_length < $length))) { + geshi_dbg('@bearliest! (length ' . $length . ')', GESHI_DBG_PARSE); + $first_position = $position; + $first_length = $length; + $first_key = $key; + $first_dlm = $delimiter; + } + } else { + geshi_dbg('', GESHI_DBG_PARSE); + } + } + } + + return array('pos' => $first_position, 'len' => $first_length, + 'key' => $first_key, 'dlm' => $first_dlm); + } + + /** + * GetContextEndData + */ + function _getContextEndData ($code, $context_open_key, $context_opener, $beginning_of_context) + { + geshi_dbg('GeSHiContext::_getContextEndData(' . $this->_contextName . ', ' . $context_open_key . ', ' + . $context_opener . ', ' . $beginning_of_context . ')', GESHI_DBG_API | GESHI_DBG_PARSE); + $context_end_pos = false; + $context_end_len = -1; + $context_end_dlm = ''; + + // Bail out if context open key tells us that there is no ender for this context + if (-1 == $context_open_key) { + geshi_dbg(' no opener so no ender', GESHI_DBG_PARSE); + return false; + } + + foreach ($this->_contextDelimiters[$context_open_key][1] as $ender) { + geshi_dbg(' Checking ender: ' . str_replace("\n", '\n', $ender), GESHI_DBG_PARSE, false); + $ender = $this->_substitutePlaceholders($ender); + geshi_dbg(' converted to ' . $ender, GESHI_DBG_PARSE); + + $position = geshi_get_position($code, $ender); + geshi_dbg(' Ender ' . $ender . ': ' . print_r($position, true), GESHI_DBG_PARSE); + $length = $position['len']; + $position = $position['pos']; + + // BUGFIX:skip around crap starters + if (false === $position) { + continue; + } + + if ((false === $context_end_pos) || ($position < $context_end_pos) || ($position == $context_end_pos && strlen($ender) > $context_end_len)) { + $context_end_pos = $position; + $context_end_len = $length; + $context_end_dlm = $ender; + } + } + geshi_dbg('Context ' . $this->_contextName . ' can finish at position ' . $context_end_pos, GESHI_DBG_PARSE); + + if (false !== $context_end_pos) { + return array('pos' => $context_end_pos, 'len' => $context_end_len, 'dlm' => $context_end_dlm); + } else { + return false; + } + } + + /** + * Adds parse data to the overall result + * + * This method is mainly designed so that subclasses of GeSHiContext can + * override it to break the context up further - for example, GeSHiStringContext + * uses it to add escape characters + * + * @param string The code to add + * @param string The first character of the next context (used by GeSHiCodeContext) + */ + function _addParseData ($code, $first_char_of_next_context = '') + { + $this->_styler->addParseData($code, $this->_contextName); + } + + /** + * Adds parse data for the start of a context to the overallresult + */ + function _addParseDataStart ($code) + { + $this->_styler->addParseDataStart($code, $this->_contextName, $this->_startName); + } + + /** + * Adds parse data for the end of a context to the overallresult + */ + function _addParseDataEnd ($code) + { + $this->_styler->addParseDataEnd($code, $this->_contextName, $this->_endName); + } + + /** + * Substitutes placeholders for values matched in opening regular expressions + * for contexts with their actual values + * + * + */ + function _substitutePlaceholders ($ender) + { + if ($this->_startRegexTable) { + foreach ($this->_startRegexTable as $key => $match) { + $ender = str_replace('!!!' . $key, quotemeta($match), $ender); + } + } + return $ender; + } +} + +?> diff --git a/paste/include/geshi/classes/class.geshistringcontext.php b/paste/include/geshi/classes/class.geshistringcontext.php new file mode 100644 index 0000000..1d712e5 --- /dev/null +++ b/paste/include/geshi/classes/class.geshistringcontext.php @@ -0,0 +1,190 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package core + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** + * The GeSHiStringContext class. This class extends GeSHiContext to handle + * the concept of escape characters that strings often use. + * + * @package core + * @author Nigel McNie <nigel@geshi.org> + * @since 1.1.0 + * @version 1.1.0 + * @see GeSHiContext + */ +class GeSHiStringContext extends GeSHiContext +{ + /**#@- + * @access private + */ + var $_escapeCharacters; + + // Characters that should be escaped + var $_charsToEscape; + + /** + * This is used by the 'DELIM' "character" in the _charsToEscape array. We + * abuse the fact that _addParseData will be called right after _getContextEndData + * if the context is to be passed + */ + var $_lastOpener; + + /**#@-*/ + + /** + * GetContextEndData + */ + function _getContextEndData ($code, $context_open_key, $context_opener) + { + geshi_dbg('GeSHiStringContext::_getContextEndData(' . $this->_contextName . ', ' . $context_open_key . ', ' . $context_opener . ')', GESHI_DBG_API | GESHI_DBG_PARSE); + $this->_lastOpener = $context_opener; + + foreach ($this->_contextDelimiters[$context_open_key][1] as $ender) { + geshi_dbg(' Checking ender: ' . $ender, GESHI_DBG_PARSE); + + // Prepare ender regexes if needed + $ender = $this->_substitutePlaceholders($ender); + geshi_dbg(' ender after substitution: ' . $ender, GESHI_DBG_PARSE); + + $pos = 0; + while (true) { + $pos = geshi_get_position($code, $ender, $pos); + if (false === $pos) { + break; + } + $len = $pos['len']; + $pos = $pos['pos']; + + $possible_string = substr($code, 0, $pos); + geshi_dbg(' String might be: ' . $possible_string, GESHI_DBG_PARSE); + + foreach ($this->_escapeCharacters as $escape_char) { + // remove escaped escape characters + $possible_string = str_replace($escape_char . $escape_char, '', $possible_string); + } + + geshi_dbg(' String with double escapes removed: ' . $possible_string, GESHI_DBG_PARSE); + + //@todo [blocking 1.1.1] possible bug: only last escape character checked here + if (substr($possible_string, -1) != $escape_char) { + // We may have found the correct ender. If we haven't, then this string + // never ends and we will set the end position to the length of the code + // substr($code, $pos, 1) == $ender + $endpos = geshi_get_position($code, $ender, $pos); + geshi_dbg(' position of ender: ' . $endpos['pos'], GESHI_DBG_PARSE); + $pos = ($pos && $endpos['pos'] === $pos) ? $pos : strlen($code); + return array('pos' => $pos, 'len' => $len, 'dlm' => $ender); + } + // else, start further up + ++$pos; + } + } + return false; + } + + /** + * Overrides addParseData to add escape characters also + */ + function _addParseData ($code, $first_char_of_next_context = '') + { + geshi_dbg('GeSHiStringContext::_addParseData(' . substr($code, 0, 15) . '...)', GESHI_DBG_PARSE); + + $length = strlen($code); + $string = ''; + for ($i = 0; $i < $length; $i++) { + $char = substr($code, $i, 1); + geshi_dbg('Char: ' . $char, GESHI_DBG_PARSE); + $skip = false; + + foreach ($this->_escapeCharacters as $escape_char) { + $len = 1; + if ($char == $escape_char && (false !== ($len = $this->_shouldBeEscaped(substr($code, $i + 1))))) { + geshi_dbg('Match: len = ' . $len, GESHI_DBG_PARSE); + if ($string) { + $this->_styler->addParseData($string, $this->_contextName); + $string = ''; + } + // Needs a better name than /esc + $this->_styler->addParseData($escape_char . substr($code, $i + 1, $len), $this->_contextName . '/esc'); + // FastForward + $i += $len; + $skip = true; + break; + } + } + + if (!$skip) { + $string .= $char; + } + } + if ($string) { + $this->_styler->addParseData($string, $this->_contextName); + } + } + + /** + * Checks whether the character(s) at the start of the parameter string are + * characters that should be escaped. + * + * @param string The string to check the beginning of for escape characters + * @return int|false The length of the escape character sequence, else false + */ + function _shouldBeEscaped ($code) + { + // Feature: If 'DELIM' is one of the "characters" in the _charsToEscape array, then it is + // replaced by the context opener + $chars_to_escape = str_replace('DELIM', $this->_lastOpener, $this->_charsToEscape); + + geshi_dbg('Checking: ' . substr($code, 0, 15), GESHI_DBG_PARSE); + foreach ($chars_to_escape as $match) { + if ('REGEX' != substr($match, 0, 5)) { + geshi_dbg('Test: ' . $match, GESHI_DBG_PARSE); + if (substr($code, 0, 1) == $match) { + return 1; + } + } else { + geshi_dbg(' Testing via regex: ' . $match . '... ', GESHI_DBG_PARSE, false); + $data = geshi_get_position($code, $match, 0); + if (0 === $data['pos']) { + geshi_dbg('match, data = ' . print_r($data, true), GESHI_DBG_PARSE); + return $data['len']; + } + geshi_dbg('no match', GESHI_DBG_PARSE); + } + } + // No matches... + return false; + } +} + +?> diff --git a/paste/include/geshi/classes/class.geshistyler.php b/paste/include/geshi/classes/class.geshistyler.php new file mode 100644 index 0000000..fa56478 --- /dev/null +++ b/paste/include/geshi/classes/class.geshistyler.php @@ -0,0 +1,224 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package core + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** + * The GeSHiStyler class + * + * @package core + * @author Nigel McNie <nigel@geshi.org> + * @since 1.1.0 + * @version 1.1.0 + */ +class GeSHiStyler +{ + /** + * @var string + */ + var $charset; + + /** + * @var string + */ + var $fileExtension; + + /** + * @var array + */ + var $_styleData = array(); + + /** + * @var array + */ + var $_parseData; + + /** + * @var int + */ + var $_parseDataPointer = 0; + + /** + * @var array + */ + var $_contextCacheData = array(); + + function setStyle ($context_name, $style, $start_name = 'start', $end_name = 'end') + { + // @todo [blocking 1.1.1] Why is this called sometimes with blank data? + geshi_dbg('GeSHiStyler::setStyle(' . $context_name . ', ' . $style . ')', GESHI_DBG_PARSE); + $this->_styleData[$context_name] = $style; + /*if (!isset($this->_styleData["$context_name/$start_name"])) { + $this->_styleData["$context_name/$start_name"] = $style; + } + if (!isset($this->_styleData["$context_name/$end_name"])) { + $this->_styleData["$context_name/$end_name"] = $style; + }*/ + } + + /*function setStartStyle ($context_name, $style) + { + $this->_styleData["$context_name/$this->_startName"] = $style; + } + + function setStartName ($name) + { + $this->_startName = $name; + }*/ + + function removeStyleData ($context_name, $context_start_name = 'start', $context_end_name = 'end') + { + unset($this->_styleData[$context_name]); + unset($this->_styleData["$context_name/$context_start_name"]); + unset($this->_styleData["$context_name/$context_end_name"]); + geshi_dbg(' removed style data for ' . $context_name, GESHI_DBG_PARSE); + } + + /*function setEndStyle ($context_name, $style) + { + $this->_styleData["$context_name/$this->_endName"] = $style; + } + + function setEndName ($name) + { + $this->_endName = $name; + }*/ + + function getStyle ($context_name) + { + if (isset($this->_styleData[$context_name])) { + return $this->_styleData[$context_name]; + } + // If style for starter/ender requested and we got here, use the default + if ('/end' == substr($context_name, -4)) { + $this->_styleData[$context_name] = $this->_styleData[substr($context_name, 0, -4)]; + return $this->_styleData[$context_name]; + } + if ('/start' == substr($context_name, -6)) { + $this->_styleData[$context_name] = $this->_styleData[substr($context_name, 0, -6)]; + return $this->_styleData[$context_name]; + } + + //@todo [blocking 1.1.5] Make the default style for otherwise unstyled elements configurable + $this->_styleData[$context_name] = 'color:#000;'; + return 'color:#000;'; + } + /* + function getStyleStart ($context_name) + { + if (isset($this->_styleData["$context_name/$this->_startName"])) { + return $this->_styleData["$context_name/$this->_startName"]; + } + $this->_styleData["$context_name/$this->_startName"] = $this->getStyle($context_name); + return $this->_styleData["$context_name/$this->_startName"]; + } + + function getStyleEnd ($context_name) + { + if (isset($this->_styleData["$context_name/$this->_endName"])) { + return $this->_styleData["$context_name/$this->_endName"]; + } + $this->_styleData["$context_name/$this->_endName"] = $this->getStyle($context_name); + return $this->_styleData["$context_name/$this->_endName"]; + }*/ + /* + function startIsUnique ($context_name) + { + return (isset($this->_styleData["$context_name/$this->_startName"]) + && '' != $this->_styleData["$context_name/$this->_startName"] + && $this->_styleData["$context_name/$this->_startName"] != $this->_styleData[$context_name]); + } + + function endIsUnique ($context_name) + { + $r = (isset($this->_styleData["$context_name/$this->_endName"]) + && '' != $this->_styleData["$context_name/$this->_endName"] + && $this->_styleData["$context_name/$this->_endName"] != $this->_styleData[$context_name]); + geshi_dbg('GeSHiStyler::endIsUnique(' . $context_name . ') = ' . $r, GESHI_DBG_PARSE); + return $r; + } + */ + function resetParseData () + { + $this->_parseData = null; + $this->_parseDataPointer = 0; + } + + /** + * This method adds parse data. It tries to merge it also if two + * consecutive contexts with the same name add parse data (which is + * very possible). + */ + function addParseData ($code, $context_name, $url = '') + { + if ($context_name == $this->_parseData[$this->_parseDataPointer][1]) { + // same context, same URL + $this->_parseData[$this->_parseDataPointer][0] .= $code; + } else { + $this->_parseData[++$this->_parseDataPointer] = array($code, $context_name, $url); + } + } + + function addParseDataStart ($code, $context_name, $start_name = 'start') + { + $this->addParseData($code, "$context_name/$start_name"); + } + + function addParseDataEnd ($code, $context_name, $end_name = 'end') + { + $this->addParseData($code, "$context_name/$end_name"); + } + + function getParseData () + { + return $this->_parseData; + } + + /** + * Sets cache data + */ + function setCacheData ($cached_file_name, $cache_str) + { + $this->_contextCacheData[$cached_file_name] = $cache_str; + } + + /** + * Gets cache data + */ + function getCacheData ($cached_file_name) + { + return isset($this->_contextCacheData[$cached_file_name]) ? + $this->_contextCacheData[$cached_file_name] : null; + } +} + +?> diff --git a/paste/include/geshi/classes/css/class.geshicssinlinemediacontext.php b/paste/include/geshi/classes/css/class.geshicssinlinemediacontext.php new file mode 100644 index 0000000..28bfb5e --- /dev/null +++ b/paste/include/geshi/classes/css/class.geshicssinlinemediacontext.php @@ -0,0 +1,60 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** + * The GeSHiCSSInlineMediaContext class + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @since 1.1.0 + * @version 1.1.0 + * @see GeSHiContext + */ +class GeSHiCSSInlineMediaContext extends GeSHiContext +{ + /** + * Overrides {@link GeSHiContext::_addParseDataStart()} to + * highlight the start of the inline media context correctly + * + * @param string The code that is part of the start of this context + * @access private + */ + function _addParseDataStart ($code) + { + $this->_styler->addParseData('@media', $this->_contextName . '/starter'); + $this->_styler->addParseDataStart(substr($code, 6), $this->_contextName); + } +} + +?> diff --git a/paste/include/geshi/classes/php/class.geshiphpdoublestringcontext.php b/paste/include/geshi/classes/php/class.geshiphpdoublestringcontext.php new file mode 100644 index 0000000..c7532eb --- /dev/null +++ b/paste/include/geshi/classes/php/class.geshiphpdoublestringcontext.php @@ -0,0 +1,182 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** + * The GeSHiPHPDoubleStringContext class represents a PHP double string + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @since 1.1.0 + * @version 1.1.0 + * @see GeSHiStringContext, GeSHiContext + */ +class GeSHiPHPDoubleStringContext extends GeSHiStringContext +{ + /** + * A cached copy of the parent name + * @var string + * @access private + */ + var $_parentName; + + /** + * The regular expressions used to match variables + * in this context. + * + * {@internal Do Not Change These! The code logic + * depends on them, they are just assigned here so + * that they aren't assigned every time the + * _addParseData method is called}} + * + * @var array + * @access private + */ + var $_regexes = array( + 'REGEX#(\{?\$\$?\{?[a-zA-Z_][a-zA-Z0-9_]*\}?)#', + 'REGEX#(\{?\$\$?\{?[a-zA-Z_][a-zA-Z0-9_]*\[[\$a-zA-Z0-9_\s\[\]\']*\]\}?)#', + 'REGEX#(\{?)(\$\$?\{?[a-zA-Z_][a-zA-Z0-9_]*)(\s*->\s*)([a-zA-Z_][a-zA-Z0-9_]*)(\}?)#' + ); + + /** + * Loads data for a PHP Double String Context. + * + * @var GeSHiStyler The styler to be used for this context + */ + function load (&$styler) + { + parent::load($styler); + $this->_parentName = parent::getName(); + } + + /** + * Adds code detected as being in this context to the parse data + */ + function _addParseData ($code, $first_char_of_next_context = '') + { + geshi_dbg('GeSHiPHPDoubleStringContext::_addParseData(' . substr($code, 0, 15) . '...)', GESHI_DBG_PARSE); + + while (true) { + $earliest_data = array('pos' => false, 'len' => 0); + foreach ($this->_regexes as $regex) { + $data = geshi_get_position($code, $regex, 0, false, true); // request table + if ((false != $data['pos'] && false === $earliest_data['pos']) || + (false !== $data['pos']) && + (($data['pos'] < $earliest_data['pos']) || + ($data['pos'] == $earliest_data['pos'] && $data['len'] > $earliest_data['len']))) { + $earliest_data = $data; + } + } + + if (false === $earliest_data['pos']) { + // No more variables in this string + break; + } + + // bugfix: because we match a var, it might have been escaped. + // so only do to -1 so we can catch slash if it has been + $pos = ($earliest_data['pos']) ? $earliest_data['pos'] - 1 : 0; + $len = ($earliest_data['pos']) ? $earliest_data['len'] + 1 : $earliest_data['len']; + parent::_addParseData(substr($code, 0, $pos)); + + // Now the entire possible var is in: + $possible_var = substr($code, $pos, $len); + geshi_dbg('Found variable at position ' . $earliest_data['pos'] . '(' . $possible_var . ')', GESHI_DBG_PARSE); + + // Check that the dollar sign that started this variable was not escaped + //$first_part = str_replace('\\\\', '', substr($code, 0, $pos)); + //if ('\\' == substr($first_part, -1)) { + // If \\ before var and { is not next character after that... + if ('\\' == substr($possible_var, 0, 1) && '{' != substr($possible_var, 1, 1)) { + // This variable has been escaped, so add the escaped dollar sign + // as the correct context, and the rest of the variable (recurse to catch + // other variables inside this possible variable) + geshi_dbg('Variable was escaped', GESHI_DBG_PARSE); + $this->_styler->addParseData(substr($possible_var, 0, 2), $this->_parentName . '/esc'); + $this->_addParseData(substr($possible_var, 2)); + } else { + // Add first character that might have been a \\ but in fact isn't to the parent + // but only do it if we had to modify the position + if ('$' != substr($possible_var, 0, 1)) { + parent::_addParseData(substr($possible_var, 0, 1)); + $possible_var = substr($possible_var, 1); + } + + // Many checks could go in here... + // @todo [blocking 1.1.5] check for ${foo} variables: start { matched by end } + // because at the moment ${foo is matched for example. + if ('{' == substr($possible_var, 0, 1)) { + if ('}' == substr($possible_var, -1)) { + $start_brace = '{'; + } else { + $start_brace = ''; + parent::_addParseData('{'); + // remove brace from $possible_var. This will only be used + // if the variable isn't an OO variable anyway... + $possible_var = substr($possible_var, 1); + } + } else { + $start_brace = ''; + } + + if (isset($earliest_data['tab'][5])) { + // Then we matched off the third regex - the one that does objects + // The first { if there is one, and $this (which is in index 2 + $this->_styler->addParseData($start_brace . $earliest_data['tab'][2], $this->_parentName . '/var'); + // The -> with any whitespace around it + $this->_styler->addParseData($earliest_data['tab'][3], $this->_parentName . '/sym0'); + // The method name + $this->_styler->addParseData($earliest_data['tab'][4], $this->_parentName . '/oodynamic'); + // The closing }, if any + if ($earliest_data['tab'][5]) { + if ($start_brace) { + $this->_styler->addParseData($earliest_data['tab'][5], $this->_parentName . '/var'); + } else { + parent::_addParseData('}'); + } + } + } else { + $this->_styler->addParseData($possible_var, $this->_parentName . '/var'); + } + + } + + // Chop off what we have done + $code = substr($code, $earliest_data['pos'] + $earliest_data['len']); + } + // Add the rest + parent::_addParseData($code, $first_char_of_next_context); + } +} + +?> diff --git a/paste/include/geshi/contexts/codeworker/codeworker.php b/paste/include/geshi/contexts/codeworker/codeworker.php new file mode 100644 index 0000000..0ea1155 --- /dev/null +++ b/paste/include/geshi/contexts/codeworker/codeworker.php @@ -0,0 +1,126 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** Get the GeSHiStringContext class */ +require_once GESHI_CLASSES_ROOT . 'class.geshistringcontext.php'; + +$this->_childContexts = array( + new GeSHiContext('codeworker', $DIALECT, 'common/multi_comment'), + new GeSHiContext('codeworker', $DIALECT, 'common/single_comment'), + new GeSHiStringContext('codeworker', $DIALECT, 'common/single_string'), + new GeSHiStringContext('codeworker', $DIALECT, 'common/double_string'), + new GeSHiContext('codeworker', $DIALECT, 'roughtext') +); + +$this->_styler->setStyle($CONTEXT, 'color:#000;'); + +$this->_contextKeywords = array( + 0 => array( + 0 => array( + 'foreach', 'forfile', 'in', 'if', 'else', 'while', 'do', 'local', 'ref', 'localref', + 'value', 'node', 'function', 'return', 'insert', 'pushItem', 'break' + ), + 1 => $CONTEXT . '/keywords', + 2 => 'color:#000;font-weight:bold;', + 3 => false, + 4 => '' + ), + 1 => array( + 0 => array( + 'traceLine', 'removeElement', 'clearVariable', 'incrementIndentLevel', + 'decrementIndentLevel', 'setInputLocation', 'readChars', 'getShortFilename', + 'getInputFilename', 'getOutputFilename', 'replaceString', 'subString', 'rsubString', + 'findLastString', 'leftString', 'midString', 'startString', 'toLowerString', + 'toUpperString', 'composeCLikeString', 'composeHTMLLikeString', 'loadFile', 'size', + 'empty', 'key', 'first', 'last' + ), + 1 => $CONTEXT . '/functions', + 2 => 'color:#006;', + 3 => false, + 4 => '' + ), + 2 => array( + 0 => array( + 'project', 'this', '_ARGS', '_REQUEST', 'true', 'false' + ), + 1 => $CONTEXT . '/constants', + 2 => 'color:#900;font-weight:bold;', + 3 => false, + 4 => '' + ), + 3 => array( + 0 => array( + 'parseAsBNF', 'parseStringAsBNF', 'translate', 'translateString' + ), + 1 => $CONTEXT . '/sfunctions', + 2 => 'color:#006;font-weight:bold;', + 3 => false, + 4 => '' + ) +); + +$this->_contextSymbols = array( + 0 => array( + 0 => array( + '|', '=', '!', ':', '(', ')', ',', '<', '>', '&', '$', '+', '-', '*', '/', + '{', '}', ';', '[', ']', '~', '?' + ), + 1 => $CONTEXT . '/sym', + 2 => 'color:#008000;' + ) +); + +$this->_contextRegexps = array( + 0 => array( + 0 => array( + '/(#[a-zA-Z][a-zA-Z0-9\-_]*)/' + ), + 1 => '#', + 2 => array( + 1 => array($CONTEXT . '/preprocessor', 'color:#933;', false) + ) + ), + 1 => geshi_use_doubles($CONTEXT), + 2 => geshi_use_integers($CONTEXT) +); + +$this->_objectSplitters = array( + 0 => array( + 0 => array('.'), + 1 => $CONTEXT . '/oodynamic', + 2 => 'color:#559;', + 3 => true // Check that matched method isn't a keyword first + ) +); +?> diff --git a/paste/include/geshi/contexts/codeworker/cworkercwt.php b/paste/include/geshi/contexts/codeworker/cworkercwt.php new file mode 100644 index 0000000..69310ae --- /dev/null +++ b/paste/include/geshi/contexts/codeworker/cworkercwt.php @@ -0,0 +1,138 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** Get the GeSHiStringContext class */ +require_once GESHI_CLASSES_ROOT . 'class.geshistringcontext.php'; + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('@', '<%'), + 1 => array('@', '%>'), + 2 => false + ) +); + +$this->_childContexts = array( + // Normally you'd use $DIALECT for the second parameter, but we want this + // context to be as much like codeworker/codeworker as possible + new GeSHiContext('codeworker', 'codeworker', 'common/multi_comment'), + new GeSHiContext('codeworker', 'codeworker', 'common/single_comment'), + new GeSHiStringContext('codeworker', 'codeworker', 'common/single_string'), + new GeSHiStringContext('codeworker', 'codeworker', 'common/double_string') +); + +//Skip styling since should already be done in codeworker/codeworker +//$this->_styler->setStyle($CONTEXT, 'color:#000;'); + +$this->_contextKeywords = array( + 0 => array( + 0 => array( + 'foreach', 'forfile', 'in', 'if', 'else', 'while', 'do', 'local', 'ref', 'localref', + 'value', 'node', 'function', 'return', 'insert', 'pushItem', 'break' + ), + // Again, we're faking being like codeworker + 1 => 'codeworker/codeworker/keywords', + 2 => 'color:#000;font-weight:bold;', + 3 => false, + 4 => '' + ), + 1 => array( + 0 => array( + 'traceLine', 'removeElement', 'clearVariable', 'incrementIndentLevel', + 'decrementIndentLevel', 'setInputLocation', 'readChars', 'getShortFilename', + 'getInputFilename', 'getOutputFilename', 'replaceString', 'subString', 'rsubString', + 'findLastString', 'leftString', 'midString', 'startString', 'toLowerString', + 'toUpperString', 'composeCLikeString', 'composeHTMLLikeString', 'loadFile', 'size', + 'empty', 'key', 'first', 'last' + ), + 1 => 'codeworker/codeworker/functions', + 2 => 'color:#006;', + 3 => false, + 4 => '' + ), + 2 => array( + 0 => array( + 'project', 'this', '_ARGS', '_REQUEST', 'true', 'false' + ), + 1 => 'codeworker/codeworker/constants', + 2 => 'color:#900;font-weight:bold;', + 3 => false, + 4 => '' + ), + 3 => array( + 0 => array( + 'parseAsBNF', 'parseStringAsBNF', 'translate', 'translateString' + ), + 1 => 'codeworker/codeworker/sfunctions', + 2 => 'color:#006;font-weight:bold;', + 3 => false, + 4 => '' + ) +); + +$this->_contextSymbols = array( + 0 => array( + 0 => array( + '|', '=', '!', ':', '(', ')', ',', '<', '>', '&', '$', '+', '-', '*', '/', + '{', '}', ';', '[', ']', '~', '?' + ), + 1 => 'codeworker/codeworker/sym', + 2 => 'color:#008000;' + ) +); + +$this->_contextRegexps = array( + 0 => array( + 0 => array( + '/(#[a-zA-Z][a-zA-Z0-9\-_]*)/' + ), + 1 => '#', + 2 => array( + 1 => array('codeworker/codeworker/preprocessor', 'color:#933;', false) + ) + ), + 1 => geshi_use_doubles('codeworker/codeworker'), + 2 => geshi_use_integers('codeworker/codeworker') +); + +$this->_objectSplitters = array( + 0 => array( + 0 => array('.'), + 1 => 'codeworker/codeworker/oodynamic', + 2 => 'color:#559;', + 3 => true // Check that matched method isn't a keyword first + ) +); + +?> diff --git a/paste/include/geshi/contexts/codeworker/cwt.php b/paste/include/geshi/contexts/codeworker/cwt.php new file mode 100644 index 0000000..46337e9 --- /dev/null +++ b/paste/include/geshi/contexts/codeworker/cwt.php @@ -0,0 +1,41 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_styler->setStyle($CONTEXT, 'color:#f00;'); + +$this->_childContexts = array( + new GeSHiCodeContext('codeworker', $DIALECT, 'cworkercwt') +); + +?> diff --git a/paste/include/geshi/contexts/codeworker/roughtext.php b/paste/include/geshi/contexts/codeworker/roughtext.php new file mode 100644 index 0000000..4e465b5 --- /dev/null +++ b/paste/include/geshi/contexts/codeworker/roughtext.php @@ -0,0 +1,58 @@ +<?php
+/**
+ * GeSHi - Generic Syntax Highlighter
+ *
+ * For information on how to use GeSHi, please consult the documentation
+ * found in the docs/ directory, or online at http://geshi.org/docs/
+ *
+ * This file is part of GeSHi.
+ *
+ * GeSHi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * GeSHi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GeSHi; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * You can view a copy of the GNU GPL in the COPYING file that comes
+ * with GeSHi, in the docs/ directory.
+ *
+ * @package lang
+ * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL
+ * @copyright (C) 2005 Nigel McNie
+ * @version 1.1.0 + *
+ */
+
+$this->_contextDelimiters = array(
+ 0 => array(
+ 0 => array('REGEX#generate\s*\(\s*\{#'),
+ 1 => array('}'),
+ 2 => false
+ ),
+ 1 => array(
+ 0 => array('REGEX#generateString\s*\(\s*\{#'),
+ 1 => array('}'),
+ 2 => false
+ ),
+ 2 => array(
+ 0 => array('REGEX#expand\s*\(\s*\{#'),
+ 1 => array('}'),
+ 2 => false
+ )
+);
+
+$this->_styler->setStyle($CONTEXT, 'color:#f00;');
+//$this->_contextStyleType = GESHI_STYLE_NONE;
+$this->_delimiterParseData = GESHI_CHILD_PARSE_NONE;
+$this->_overridingChildContext =& new GeSHiCodeContext('codeworker', 'cwt');
+
+?>
diff --git a/paste/include/geshi/contexts/common/double_string.php b/paste/include/geshi/contexts/common/double_string.php new file mode 100644 index 0000000..d45eca1 --- /dev/null +++ b/paste/include/geshi/contexts/common/double_string.php @@ -0,0 +1,51 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('"'), + 1 => array('"'), + 2 => false + ) +); + +$this->_styler->setStyle($CONTEXT, 'color:#f00;'); +$this->_contextStyleType = GESHI_STYLE_STRINGS; + +// String only stuff +$this->_escapeCharacters = array('\\'); +$this->_charsToEscape = array('n', 'r', 't', '\\', '"'); +$this->_styler->setStyle($CONTEXT . '/esc', 'color:#006;font-weight:bold;'); + +?> diff --git a/paste/include/geshi/contexts/common/multi_comment.php b/paste/include/geshi/contexts/common/multi_comment.php new file mode 100644 index 0000000..8a24ab1 --- /dev/null +++ b/paste/include/geshi/contexts/common/multi_comment.php @@ -0,0 +1,46 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('/*'), + 1 => array('*/'), + 2 => false + ) +); + +$this->_styler->setStyle($CONTEXT, 'color:#888;font-style:italic;'); +$this->_contextStyleType = GESHI_STYLE_COMMENTS; + +?> diff --git a/paste/include/geshi/contexts/common/single_comment.php b/paste/include/geshi/contexts/common/single_comment.php new file mode 100644 index 0000000..067074c --- /dev/null +++ b/paste/include/geshi/contexts/common/single_comment.php @@ -0,0 +1,46 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('//'), + 1 => array("\n"), + 2 => false + ) +); + +$this->_styler->setStyle($CONTEXT, 'color:#888;font-style:italic;'); +$this->_contextStyleType = GESHI_STYLE_COMMENTS; + +?> diff --git a/paste/include/geshi/contexts/common/single_string.php b/paste/include/geshi/contexts/common/single_string.php new file mode 100644 index 0000000..3007aae --- /dev/null +++ b/paste/include/geshi/contexts/common/single_string.php @@ -0,0 +1,51 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array("'"), + 1 => array("'"), + 2 => false + ) +); + +$this->_styler->setStyle($CONTEXT, 'color:#f00;'); +$this->_contextStyleType = GESHI_STYLE_STRINGS; + +// String only stuff +$this->_escapeCharacters = array('\\'); +$this->_charsToEscape = array('\\', "'"); +$this->_styler->setStyle($CONTEXT . '/esc', 'color:#006;font-weight:bold;'); + +?> diff --git a/paste/include/geshi/contexts/common/single_string_eol.php b/paste/include/geshi/contexts/common/single_string_eol.php new file mode 100644 index 0000000..1146471 --- /dev/null +++ b/paste/include/geshi/contexts/common/single_string_eol.php @@ -0,0 +1,51 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array("'"), + 1 => array("'", "\n"), + 2 => false + ) +); + +$this->_styler->setStyle($CONTEXT, 'color:#f00;'); +$this->_contextStyleType = GESHI_STYLE_STRINGS; + +// String only stuff +$this->_escapeCharacters = array('\\'); +$this->_charsToEscape = array('\\', "'"); +$this->_styler->setStyle($CONTEXT . '/esc', 'color:#006;font-weight:bold;'); + +?> diff --git a/paste/include/geshi/contexts/css/at_rule.php b/paste/include/geshi/contexts/css/at_rule.php new file mode 100644 index 0000000..bc6536b --- /dev/null +++ b/paste/include/geshi/contexts/css/at_rule.php @@ -0,0 +1,74 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('@import', '@charset'), + 1 => array(';'), + 2 => false + ) +); + +$this->_childContexts = array( + new GeSHiStringContext('css', $DIALECT, 'string') +); + +$this->_styler->setStyle($CONTEXT_START, 'color:#c9c;font-weight:bold;'); +$this->_styler->setStyle($CONTEXT_END, 'color:#008000;'); + +$this->_contextKeywords = array( + 0 => array( + 0 => array( + 'url' + ), + 1 => $this->_contextName . '/blah', + 2 => 'color:#933;', + 3 => false, + 4 => '' + ) +); + +$this->_contextSymbols = array( + 0 => array( + 0 => array( + ':', ';', '(', ')' + ), + // name (should names have / in them like normal contexts? YES + 1 => $this->_contextName . '/sym', + // style + 2 => 'color:#008000;' + ) +); + +?> diff --git a/paste/include/geshi/contexts/css/attribute_selector.php b/paste/include/geshi/contexts/css/attribute_selector.php new file mode 100644 index 0000000..5914621 --- /dev/null +++ b/paste/include/geshi/contexts/css/attribute_selector.php @@ -0,0 +1,49 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('['), + 1 => array(']'), + 2 => false + ) +); + +$this->_childContexts = array( + new GeSHiStringContext('css', $DIALECT, 'string') +); + +$this->_styler->setStyle($CONTEXT, 'color:#008000;'); + +?> diff --git a/paste/include/geshi/contexts/css/css.php b/paste/include/geshi/contexts/css/css.php new file mode 100644 index 0000000..b2e2afe --- /dev/null +++ b/paste/include/geshi/contexts/css/css.php @@ -0,0 +1,103 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** Get the GeSHiCSSInlineMediaContext class */ +require_once GESHI_CLASSES_ROOT . 'css' . GESHI_DIR_SEPARATOR . 'class.geshicssinlinemediacontext.php'; + +$this->_childContexts = array( + new GeSHiCSSInlineMediaContext('css', $DIALECT, 'inline_media'), + new GeSHiCodeContext('css', $DIALECT, 'rule'), + new GeSHiContext('css', $DIALECT, 'common/multi_comment'), + new GeSHiContext('css', $DIALECT, 'attribute_selector'), + new GeSHiCodeContext('css', $DIALECT, 'at_rule') +); + +$this->_styler->setStyle($CONTEXT, 'color:#000;'); + +$this->_contextKeywords = array( + 0 => array( + 0 => array( + '@font-face' + ), + 1 => $CONTEXT . '/atrules', + 2 => 'color:#c9c;font-weight:bold;', + 3 => false, + 4 => '' + ), + 1 => array( + 0 => array( + 'hover', 'link', 'visited', 'active', 'focus', 'first-child', 'first-letter', + 'first-line', 'before', 'after' + ), + 1 => $CONTEXT . '/psuedoclasses', + 2 => 'color:#33f;', + 3 => false, + 4 => '' + ) +); + +$this->_contextSymbols = array( + 0 => array( + 0 => array( + ',', '*', '>', '+' + ), + // name (should names have / in them like normal contexts? YES + 1 => $CONTEXT . '/sym', + // style + 2 => 'color:#008000;' + ) +); + +$this->_contextRegexps = array( + 0 => array( + 0 => array( + '#(\.[a-zA-Z][a-zA-Z0-9\-_]*)#' + ), + 1 => '.', + 2 => array( + 1 => array($CONTEXT . '/class', 'color:#c9c;', false)// Don't check whether the match is actually a keyword + ) + ), + 1 => array( + 0 => array( + '/(#[a-zA-Z][a-zA-Z0-9\-_]*)/' + ), + 1 => '#', + 2 => array( + 1 => array($CONTEXT . '/id', 'color:#c9c;font-weight:bold;', false) + ) + ) +); + +?> diff --git a/paste/include/geshi/contexts/css/inline_media.php b/paste/include/geshi/contexts/css/inline_media.php new file mode 100644 index 0000000..3d17a5b --- /dev/null +++ b/paste/include/geshi/contexts/css/inline_media.php @@ -0,0 +1,54 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('REGEX#@media\s+\w+\s+\{#'), + 1 => array('}'), + 2 => false + ) +); + +$this->_childContexts = array( + new GeSHiCodeContext('css', $DIALECT, 'rule') +); + +$this->_styler->setStyle($CONTEXT, 'color:#b1b100;'); +$this->_styler->setStyle($CONTEXT_START, 'color:#000;font-weight:bold;'); +$this->_styler->setStyle($CONTEXT_END, 'color:#000;font-weight:bold;'); +// GeSHiCSSInlineMediaContext stuff +// @todo [blocking 1.1.1] do this with new alias stuff? +$this->_styler->setStyle($CONTEXT . '/starter', 'color:#c9c;font-weight:bold;'); + +?> diff --git a/paste/include/geshi/contexts/css/rule.php b/paste/include/geshi/contexts/css/rule.php new file mode 100644 index 0000000..7309f69 --- /dev/null +++ b/paste/include/geshi/contexts/css/rule.php @@ -0,0 +1,301 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** Get the GeSHiStringContext class */ +require_once GESHI_CLASSES_ROOT . 'class.geshistringcontext.php'; + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('{'), + 1 => array('}'), + 2 => false + ) +); + +$this->_childContexts = array( + new GeSHiStringContext('css', $DIALECT, 'string'), + new GeSHiContext('css', $DIALECT, 'common/multi_comment') +); + +$this->_styler->setStyle($CONTEXT_START, 'font-weight:bold;color:#000;'); +$this->_styler->setStyle($CONTEXT_END, 'font-weight:bold;color:#000;'); + +$this->_contextKeywords = array( + 0 => array( + // keywords + 0 => array( + 'azimuth', 'background', 'background-attachment', 'background-color', 'background-image', + 'background-position', 'background-repeat', 'border', 'border-bottom', 'border-bottom-color', + 'border-bottom-style', 'border-bottom-width', 'border-collapse', 'border-color', 'border-left', + 'border-left-color', 'border-left-style', 'border-left-width', 'border-right', 'border-right-color', + 'border-right-style', 'border-right-width', 'border-spacing', 'border-style', 'border-top', + 'border-top-color', 'border-top-style', 'border-top-width', 'border-width', 'bottom', + 'caption-side', 'clear', 'clip', 'color', 'content', 'counter-increment', 'counter-reset', 'cue', + 'cue-after', 'cue-before', 'cursor', 'direction', 'display', 'elevation', 'empty-cells', 'float', + 'font', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', + 'font-variant', 'font-weight', 'height', 'left', 'letter-spacing', 'line-height', 'list-style', + 'list-style-image', 'list-style-keyword', 'list-style-position', 'list-style-type', 'margin', + 'margin-bottom', 'margin-left', 'margin-right', 'margin-top', 'marker-offset', 'max-height', + 'max-width', 'min-height', 'min-width', 'orphans', 'outline', 'outline-color', 'outline-style', + 'outline-width', 'overflow', 'padding', 'padding-bottom', 'padding-left', 'padding-right', + 'padding-top', 'page', 'page-break-after', 'page-break-before', 'page-break-inside', 'pause', + 'pause-after', 'pause-before', 'pitch', 'pitch-range', 'play-during', 'position', 'quotes', + 'richness', 'right', 'size', 'speak', 'speak-header', 'speak-numeral', 'speak-punctuation', + 'speech-rate', 'stress', 'table-layout', 'text-align', 'text-decoration', 'text-decoration-color', + 'text-indent', 'text-shadow', 'text-transform', 'top', 'unicode-bidi', 'vertical-align', + 'visibility', 'voice-family', 'volume', 'white-space', 'widows', 'width', 'word-spacing', + 'z-index', 'konq_bgpos_x', 'konq_bgpos_y', 'unicode-range', 'units-per-em', 'src', 'panose-1', + 'stemv', 'stemh', 'slope', 'cap-height', 'x-height', 'ascent', 'descent', 'widths', 'bbox', + 'definition-src', 'baseline', 'centerline', 'mathline', 'topline', '!important' + ), + // name + 1 => $CONTEXT . '/attrs', + // style + 2 => 'color:#000;font-weight:bold;', + // case sensitive + 3 => false, + // url + 4 => '' + ), + 1 => array( + 0 => array( + 'url', 'attr', 'rect', 'rgb', 'counter', 'counters', 'local', 'format' + ), + 1 => $CONTEXT . '/paren', + 2 => 'color:#933;', + 3 => false, + 4 => '' + ), + 2 => array( + 0 => array( + 'aqua', 'black', 'blue', 'fuchsia', 'gray', 'green', 'lime', 'maroon', 'navy', 'olive', + 'purple', 'red', 'silver', 'teal', 'white', 'yellow', 'ActiveBorder', 'ActiveCaption', + 'AppWorkspace', 'Background', 'ButtonFace', 'ButtonHighlight', 'ButtonShadow', 'ButtonText', + 'CaptionText', 'GrayText', 'Highlight', 'HighlightText', 'InactiveBorder', 'InactiveCaption', + 'InactiveCaptionText', 'InfoBackground', 'InfoText', 'Menu', 'MenuText', 'Scrollbar', + 'ThreeDDarkShadow', 'ThreeDFace', 'ThreeDHighlight', 'ThreeDLightShadow', 'ThreeDShadow', + 'Window', 'WindowFrame', 'WindowText' + ), + 1 => $CONTEXT . '/colors', + 2 => 'color:#339;', + 3 => false, + 4 => '' + ), + 3 => array( + 0 => array( + 'inherit', 'none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', + 'outset', 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', 'smaller', + 'larger', 'italic', + 'oblique', + 'small-caps', + 'normal', + 'bold', + 'bolder', + 'lighter', + 'light', + 'transparent', + 'repeat', + 'repeat-x', + 'repeat-y', + 'no-repeat', + 'baseline', + 'sub', + 'super', + 'top', + 'text-top', + 'middle', + 'bottom', + 'text-bottom', + 'left', + 'right', + 'center', + 'justify', + 'konq-center', + 'disc', + 'circle', + 'square', + 'decimal', + 'decimal-leading-zero', + 'lower-roman', + 'upper-roman', + 'lower-greek', + 'lower-alpha', + 'lower-latin', + 'upper-alpha', + 'upper-latin', + 'hebrew', + 'armenian', + 'georgian', + 'cjk-ideographic', + 'hiragana', + 'katakana', + 'hiragana-iroha', + 'katakana-iroha', + 'inline', + 'block', + 'list-item', + 'run-in', + 'compact', + 'marker', + 'table', + 'inline-table', + 'table-row-group', + 'table-header-group', + 'table-footer-group', + 'table-row', + 'table-column-group', + 'table-column', + 'table-cell', + 'table-caption', + 'auto', + 'crosshair', + 'default', + 'pointer', + 'move', + 'e-resize', + 'ne-resize', + 'nw-resize', + 'n-resize', + 'se-resize', + 'sw-resize', + 's-resize', + 'w-resize', + 'text', + 'wait', + 'help', + 'above', + 'absolute', + 'always', + 'avoid', + 'below', + 'bidi-override', + 'blink', + 'both', + 'capitalize', + 'caption', + 'close-quote', + 'collapse', + 'condensed', + 'crop', + 'cross', + 'embed', + 'expanded', + 'extra-condensed', + 'extra-expanded', + 'fixed', + 'hand', + 'hide', + 'higher', + 'icon', + 'inside', + 'invert', + 'landscape', + 'level', + 'line-through', + 'loud', + 'lower', + 'lowercase', + 'ltr', + 'menu', + 'message-box', + 'mix', + 'narrower', + 'no-close-quote', + 'no-open-quote', + 'nowrap', + 'open-quote', + 'outside', + 'overline', + 'portrait', + 'pre', + 'relative', + 'rtl', + 'scroll', + 'semi-condensed', + 'semi-expanded', + 'separate', + 'show', + 'small-caption', + 'static', + 'static-position', + 'status-bar', + 'thick', + 'thin', + 'ultra-condensed', + 'ultra-expanded', + 'underline', + 'uppercase', + 'visible', + 'wider', + 'break', + 'serif', + 'sans-serif', + 'cursive', + 'fantasy', + 'monospace' + ), + 1 => $CONTEXT . '/types', + 2 => 'color:#393;', + 3 => false, + 4 => '' + ) +); + +$this->_contextSymbols = array( + 0 => array( + 0 => array( + ':', ';', '(', ')', ',' + ), + // name (should names have / in them like normal contexts? YES + 1 => $CONTEXT . '/sym', + // style + 2 => 'color:#008000;' + ) +); + +$this->_contextRegexps = array( + 0 => array( + 0 => array( + '#([-+]?[0-9]((em)|(ex)|(px)|(in)|(cm)|(mm)|(pt)|(pc)|%))#', + '/(#(([0-9a-fA-F]){3}){1,2})/', + '/([0-9]+)/' + ), + 1 => '', + 2 => array( + 1 => array($CONTEXT . '/value', 'color: #933;', false) + ) + ) +); + +?> diff --git a/paste/include/geshi/contexts/css/string.php b/paste/include/geshi/contexts/css/string.php new file mode 100644 index 0000000..fffe255 --- /dev/null +++ b/paste/include/geshi/contexts/css/string.php @@ -0,0 +1,55 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('"'), + 1 => array('"'), + 2 => false + ), + 1 => array( + 0 => array("'"), + 1 => array("'"), + 2 => false + ) +); + +$this->_styler->setStyle($CONTEXT, 'color:#f00;'); +$this->_contextStyleType = GESHI_STYLE_STRINGS; + +$this->_escapeCharacters = array('\\'); +$this->_charsToEscape = array('\\', 'A', 'DELIM'); +$this->_styler->setStyle($CONTEXT . '/esc', 'color:#006;font-weight:bold;'); + +?> diff --git a/paste/include/geshi/contexts/delphi/asm.php b/paste/include/geshi/contexts/delphi/asm.php new file mode 100644 index 0000000..dd63b4f --- /dev/null +++ b/paste/include/geshi/contexts/delphi/asm.php @@ -0,0 +1,271 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Benny Baumann <BenBE@benbe.omorphia.de>, Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('asm'), + 1 => array('end'), + 2 => false + ) +); + +$this->_childContexts = array( + new GeSHiContext('delphi', $DIALECT, 'preprocessor'), + new GeSHiContext('delphi', $DIALECT, 'common/single_comment') +); + +$this->_styler->setStyle($CONTEXT, 'color:#00f;'); +$this->_styler->setStyle($CONTEXT_START, 'color:#f00;font-weight:bold;'); +$this->_styler->setStyle($CONTEXT_END, 'color:#f00;font-weight:bold;'); + +$this->_contextKeywords = array( + //Assembler Directives + 0 => array( + 0 => array( + 'db','dd','dw' + ), + 1 => $CONTEXT . '/keywords', + 2 => 'color:#00f; font-weight:bold;', + 3 => false, + 4 => '' + ), + + 1 => array( + 0 => array( + 'large', 'small', + 'offset','vmtoffset','dmtindex', + 'byte', 'word', 'dword', 'qword', 'tbyte', 'ptr' + ), + 1 => $CONTEXT . '/control', + 2 => 'color:#00f; font-weight: bold;', + 3 => false, + 4 => '' + ), + + //CPU i386 instructions + 2 => array( + 0 => array( +/* + // @todo order the i386 instruction set + + 'aaa','aad','aam','aas','adc','add','and','call','cbw','clc','cld','cli','cmc','cmp', + 'cmps','cmpsb','cmpsw','cwd','daa','das','dec','div','esc','hlt','idiv','imul','in','inc', + 'int','into','iret','ja','jae','jb','jbe','jc','jcxz','je','jg','jge','jl','jle','jmp', + 'jna','jnae','jnb','jnbe','jnc','jne','jng','jnge','jnl','jnle','jno','jnp','jns','jnz', + 'jo','jp','jpe','jpo','js','jz','lahf','lds','lea','les','lods','lodsb','lodsw','loop', + 'loope','loopew','loopne','loopnew','loopnz','loopnzw','loopw','loopz','loopzw','mov', + 'movs','movsb','movsw','mul','neg','nop','not','or','out','pop','popf','push','pushf', + 'rcl','rcr','ret','retf','retn','rol','ror','sahf','sal','sar','sbb','scas','scasb','scasw', + 'shl','shr','stc','std','sti','stos','stosb','stosw','sub','test','wait','xchg','xlat', + 'xlatb','xor','bound','enter','ins','insb','insw','leave','outs','outsb','outsw','popa','pusha','pushw', + 'arpl','lar','lsl','sgdt','sidt','sldt','smsw','str','verr','verw','clts','lgdt','lidt','lldt','lmsw','ltr', + 'bsf','bsr','bt','btc','btr','bts','cdq','cmpsd','cwde','insd','iretd','iretdf','iretf', + 'jecxz','lfs','lgs','lodsd','loopd','looped','loopned','loopnzd','loopzd','lss','movsd', + 'movsx','movzx','outsd','popad','popfd','pushad','pushd','pushfd','scasd','seta','setae', + 'setb','setbe','setc','sete','setg','setge','setl','setle','setna','setnae','setnb','setnbe', + 'setnc','setne','setng','setnge','setnl','setnle','setno','setnp','setns','setnz','seto','setp', + 'setpe','setpo','sets','setz','shld','shrd','stosd','bswap','cmpxchg','invd','invlpg', + 'wbinvd','xadd','lock','rep','repe','repne','repnz','repz' +*/ + 'AAA','AAD','AAM','AAS','ADC','ADD','AND','ARPL','BOUND','BSF','BSR','BSWAP','BT','BTC','BTR', + 'BTS','CALL','CBW','CDQ','CLC','CLD','CLI','CLTS','CMC','CMP','CMPSB','CMPSD','CMPSW', + 'CMPXCHG','CMPXCHG486','CMPXCHG8B','CPUID','CWD','CWDE', + 'cmova','cmovae','cmovb','cmovbe','cmovc','cmovcxz','cmove','cmovg','cmovge','cmovl','cmovle', + 'cmovna','cmovnae','cmovnb','cmovnbe','cmovnc','cmovne','cmovng','cmovnge','cmovnl','cmovnle', + 'cmovno','cmovnp','cmovns','cmovnz','cmovo','cmovp','cmovpe','cmovpo','cmovs','cmovz', + 'DAA','DAS','DEC','DIV','EMMS','ENTER','HLT','IBTS','ICEBP','IDIV','IMUL','IN','INC','INSB', + 'INSD','INSW','INT','INT01','INT1','INT03','INT3','INTO','INVD','INVLPG','IRET','IRETD','IRETW', + 'JCXZ','JECXZ','JMP','ja','jae','jb','jbe','jc','jcxz','je','jg','jge','jl','jle','jna','jnae', + 'jnb','jnbe','jnc','jne','jng','jnge','jnl','jnle','jno','jnp','jns','jnz','jo','jp','jpe', + 'jpo','js','jz','LAHF','LAR','LCALL','LDS','LEA','LEAVE','LES','LFS','LGDT','LGS','LIDT', + 'LJMP','LLDT','LMSW','LOADALL','LOADALL286','LOCK','LODSB','LODSD','LODSW','LOOP','LOOPE', + 'LOOPNE','LOOPNZ','LOOPZ','LSL','LSS','LTR','MOV','MOVD','MOVQ','MOVSB','MOVSD','MOVSW','MOVSX', + 'MOVZX','MUL','NEG','NOP','NOT','OR','OUT','OUTSB','OUTSD','OUTSW','POP','POPA','POPAD','POPAW', + 'POPF','POPFD','POPFW','PUSH','PUSHA','PUSHAD','PUSHAW','PUSHF','PUSHFD','PUSHFW','RCL','RCR', + 'RDSHR','RDMSR','RDPMC','RDTSC','REP','REPE','REPNE','REPNZ','REPZ','RET','RETF','RETN','ROL', + 'ROR','RSDC','RSLDT','RSM','SAHF','SAL','SALC','SAR','SBB','SCASB','SCASD','SCASW','SGDT', + 'seta','setae','setb','setbe','setc','setcxz','sete','setg','setge','setl','setle','setna', + 'setnae','setnb','setnbe','setnc','setne','setng','setnge','setnl','setnle','setno','setnp', + 'setns','setnz','seto','setp','setpe','setpo','sets','setz', + 'SHL','SHLD','SHR','SHRD','SIDT','SLDT','SMI','SMINT','SMINTOLD','SMSW','STC','STD','STI','STOSB', + 'STOSD','STOSW','STR','SUB','SVDC','SVLDT','SVTS','SYSCALL','SYSENTER','SYSEXIT','SYSRET','TEST', + 'UD1','UD2','UMOV','VERR','VERW','WAIT','WBINVD','WRSHR','WRMSR','XADD','XBTS','XCHG','XLAT', + 'XLATB','XOR' + ), + 1 => $CONTEXT . '/instr_i386', + 2 => 'color:#00f; font-weight:bold;', + 3 => false, + 4 => '' + ), + + //FPU i387 instructions + 3 => array( + 0 => array( + /* + // @todo order the i387 instruction set + 'f2xm1','fabs','fadd','faddp','fbld','fbstp','fchs','fclex','fcom','fcomp','fcompp','fdecstp', + 'fdisi','fdiv','fdivp','fdivr','fdivrp','feni','ffree','fiadd','ficom','ficomp','fidiv', + 'fidivr','fild','fimul','fincstp','finit','fist','fistp','fisub','fisubr','fld','fld1', + 'fldcw','fldenv','fldenvw','fldl2e','fldl2t','fldlg2','fldln2','fldpi','fldz','fmul', + 'fmulp','fnclex','fndisi','fneni','fninit','fnop','fnsave','fnsavew','fnstcw','fnstenv', + 'fnstenvw','fnstsw','fpatan','fprem','fptan','frndint','frstor','frstorw','fsave', + 'fsavew','fscale','fsqrt','fst','fstcw','fstenv','fstenvw','fstp','fstsw','fsub','fsubp', + 'fsubr','fsubrp','ftst','fwait','fxam','fxch','fxtract','fyl2x','fyl2xp1', + 'fsetpm','fcos','fldenvd','fnsaved','fnstenvd','fprem1','frstord','fsaved','fsin','fsincos', + 'fstenvd','fucom','fucomp','fucompp' + */ + 'F2XM1','FABS','FADD','FADDP','FBLD','FBSTP','FCHS','FCLEX','FCMOVB','FCMOVBE','FCMOVE','FCMOVNB', + 'FCMOVNBE','FCMOVNE','FCMOVNU','FCMOVU','FCOM','FCOMI','FCOMIP','FCOMP','FCOMPP','FCOS','FDECSTP', + 'FDISI','FDIV','FDIVP','FDIVR','FDIVRP','FEMMS','FENI','FFREE','FIADD','FICOM','FICOMP','FIDIV', + 'FIDIVR','FILD','FIMUL','FINCSTP','FINIT','FIST','FISTP','FISUB','FISUBR','FLD','FLD1','FLDCW', + 'FLDENV','FLDL2E','FLDL2T','FLDLG2','FLDLN2','FLDPI','FLDZ','FMUL','FMULP','FNCLEX','FNDISI', + 'FNENI','FNINIT','FNOP','FNSAVE','FNSTCW','FNSTENV','FNSTSW','FPATAN','FPREM','FPREM1','FPTAN', + 'FRNDINT','FRSTOR','FSAVE','FSCALE','FSETPM','FSIN','FSINCOS','FSQRT','FST','FSTCW','FSTENV', + 'FSTP','FSTSW','FSUB','FSUBP','FSUBR','FSUBRP','FTST','FUCOM','FUCOMI','FUCOMIP','FUCOMP', + 'FUCOMPP','FWAIT','FXAM','FXCH','FXTRACT','FYL2X','FYL2XP1' + ), + 1 => $CONTEXT . '/instr_i387', + 2 => 'color:#00f; font-weight:bold;', + 3 => false, + 4 => '' + ), + + //MMX instruction set + 4 => array( + 0 => array( + // @todo order the mmx instruction set + + 'FFREEP','FXRSTOR','FXSAVE','PREFETCHNTA','PREFETCHT0','PREFETCHT1','PREFETCHT2','SFENCE', + 'MASKMOVQ','MOVNTQ','PAVGB','PAVGW','PEXTRW','PINSRW','PMAXSW','PMAXUB','PMINSW','PMINUB', + 'PMOVMSKB','PMULHUW','PSADBW','PSHUFW', + + 'PACKSSDW','PACKSSWB','PACKUSWB','PADDB','PADDD','PADDSB','PADDSIW','PADDSW','PADDUSB','PADDUSW', + 'PADDW','PAND','PANDN','PAVEB','PCMPEQB','PCMPEQD','PCMPEQW','PCMPGTB','PCMPGTD', + 'PCMPGTW','PDISTIB','PFCMPEQ','PFCMPGE','PFCMPGT','PMACHRIW','PMADDWD', + 'PMAGW','PMVGEZB','PMVLZB','PMVNZB','PMVZB', + 'POR','PSLLD','PSLLQ','PSLLW','PSRAD','PSRAW','PSRLD','PSRLQ','PSRLW', + 'PSUBB','PSUBD','PSUBSB','PSUBSIW','PSUBSW','PSUBUSB','PSUBUSW','PSUBW','PUNPCKHBW','PUNPCKHDQ', + 'PUNPCKHWD','PUNPCKLBW','PUNPCKLDQ','PUNPCKLWD','PXOR' + ), + 1 => $CONTEXT . '/instr/mmx', + 2 => 'color:#00f; font-weight:bold;', + 3 => false, + 4 => '' + ), + + //SSE instruction set + 5 => array( + 0 => array( + // @todo order the SSE instruction set + 'ADDPS','ADDSS','ANDNPS','ANDPS','CMPEQPS','CMPEQSS','CMPLEPS','CMPLESS','CMPLTPS','CMPLTSS', + 'CMPNEQPS','CMPNEQSS','CMPNLEPS','CMPNLESS','CMPNLTPS','CMPNLTSS','CMPORDPS','CMPORDSS', + 'CMPUNORDPS','CMPUNORDSS','CMPPS','CMPSS','COMISS','CVTPI2PS','CVTPS2PI','CVTSI2SS','CVTSS2SI', + 'CVTTPS2PI','CVTTSS2SI','DIVPS','DIVSS','LDMXCSR','MAXPS','MAXSS','MINPS','MINSS','MOVAPS', + 'MOVHPS','MOVLHPS','MOVLPS','MOVHLPS','MOVMSKPS','MOVNTPS','MOVSS','MOVUPS','MULPS','MULSS', + 'ORPS','RCPPS','RCPSS','RSQRTPS','RSQRTSS','SHUFPS','SQRTPS','SQRTSS','STMXCSR','SUBPS', + 'SUBSS','UCOMISS','UNPCKHPS','UNPCKLPS','XORPS' + ), + 1 => $CONTEXT . '/instr/sse', + 2 => 'color:#00f; font-weight:bold;', + 3 => false, + 4 => '' + ), + + //3DNow instruction set + 6 => array( + 0 => array( + // @todo order the 3Dnow! instruction set + 'PAVGUSB','PF2ID','PFACC','PFADD','PFMUL','PFRCP','PFRCPIT1','PFRCPIT2','PFRSQIT1','PFRSQRT', + 'PFSUB','PFSUBR','PFMAX','PFMIN','PI2FD','PMULHRIW','PMULHRWA','PMULHRWC','PMULHW','PMULLW', + 'PREFETCH','PREFETCHW' + ), + 1 => $CONTEXT . '/instr/3Dnow', + 2 => 'color:#00f; font-weight:bold;', + 3 => false, + 4 => '' + ), + + //3DNowExt instruction set + 7 => array( + 0 => array( + // @todo order the 3Dnow! Ext instruction set + 'PFNACC','PFPNACC','PI2FW','PF2IW','PSWAPD' + ), + 1 => $CONTEXT . '/instr/3Dnow2', + 2 => 'color:#00f; font-weight:bold;', + 3 => false, + 4 => '' + ) +); + +$this->_contextSymbols = array( + 0 => array( + 0 => array( + ',', ';', '[', ']', '.' + ), + 1 => $CONTEXT . '/sym', + 2 => 'color:#008000;' + ) +); + +$this->_contextRegexps = array( + 0 => array( + 0 => array('#([a-zA-Z]+:)#'), + 1 => ':', + 2 => array( + 1 => array($CONTEXT . '/label', 'color:#933;', false) + ) + ), + 1 => array( + 0 => array( + '/(\$[0-9a-fA-F_]+)/' + ), + 1 => '$', + 2 => array( + 1 => array($CONTEXT . '/hex', 'color: #2bf;', false) + ) + ), + 2 => geshi_use_integers($CONTEXT) +); + +$this->_objectSplitters = array( + 0 => array( + 0 => array('.'), + 1 => $CONTEXT . '/oodynamic', + 2 => 'color:#559;', + 3 => false // If true, check that matched method isn't a keyword first + ) +); + +?> diff --git a/paste/include/geshi/contexts/delphi/delphi.php b/paste/include/geshi/contexts/delphi/delphi.php new file mode 100644 index 0000000..56f763c --- /dev/null +++ b/paste/include/geshi/contexts/delphi/delphi.php @@ -0,0 +1,382 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Benny Baumann <BenBE@benbe.omorphia.de>, Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +// @todo [blocking 1.1.1] Rename OCCs with parent's name in front for theming +// BenBE: What do you mean? +// My todo for theming support, not relevant to delphi +// @todo [blocking 1.1.1] make keywords not keywords if they don't have a ( after +// them (e.g. a variable named "sum" will be highlighted as a keyword even if it isn't) +$this->_childContexts = array( + new GeSHiContext('delphi', $DIALECT, 'multi_comment'), + new GeSHiContext('delphi', $DIALECT, 'common/single_comment'), + new GeSHiContext('delphi', $DIALECT, 'common/single_string_eol'), + new GeSHiContext('delphi', $DIALECT, 'preprocessor'), + new GeSHiCodeContext('delphi', $DIALECT, 'asm'), + new GeSHiCodeContext('delphi', $DIALECT, 'extern', 'delphi/' . $DIALECT), + new GeSHiCodeContext('delphi', $DIALECT, 'property', 'delphi/' . $DIALECT) +); + +//$this->_styler->setStyle($CONTEXT, 'color:#000;'); + +$this->_contextKeywords = array( + 0 => array( + 0 => array( + //@todo [blocking 1.1.1] get keywords normal way + 'And', + 'Array', + 'As', + 'Asm', + 'At', + 'Begin', + 'Case', + 'Class', + 'Const', + 'Constructor', + 'Contains', + 'Destructor', + 'DispInterface', + 'Div', + 'Do', + 'DownTo', + 'Else', + 'End', + 'Except', + 'File', + 'Finalization', + 'Finally', + 'For', + 'Function', + 'Goto', + 'If', + 'Implementation', + 'In', + 'Inherited', + 'Initialization', + 'Inline', + 'Interface', + 'Is', + 'Label', + 'Mod', + 'Not', + 'Object', + 'Of', + 'On', + 'Or', + 'Packed', + 'Package', + 'Procedure', + 'Program', + 'Property', + 'Raise', + 'Record', + 'Requires', + 'Repeat', + 'Resourcestring', + 'Set', + 'Shl', + 'Shr', + 'Then', + 'ThreadVar', + 'To', + 'Try', + 'Type', + 'Unit', + 'Until', + 'Uses', + 'Var', + 'While', + 'With', + 'Xor', + + 'Private', 'Protected', 'Public', 'Published', + + 'Virtual', 'Abstract', 'Override', 'Overload', + + 'cdecl', 'stdcall', 'register', 'pascal', 'safecall', 'near', 'far', 'varargs', + + 'assembler' + ), + 1 => $CONTEXT . '/keywords', + 2 => 'color:#f00; font-weight:bold;', + 3 => false, + 4 => '' + ), + 1 => array( + 0 => array( + 'Boolean', 'ByteBool', 'LongBool', 'WordBool', 'Bool', + + 'Byte', 'SmallInt', + 'ShortInt', 'Word', + 'Integer', 'Cardinal', + 'LongInt', 'DWORD', + 'Int64', + + 'Single', 'Double', 'Extended', + 'Real48', 'Real', 'Comp', 'Currency', + + 'Pointer', + + 'Char', 'AnsiChar', 'WideChar', + 'PChar', 'PAnsiChar', 'PWideChar', + 'String', 'AnsiString', 'WideString', + + 'THandle' + ), + 1 => $CONTEXT . '/keytypes', + 2 => 'color:#000; font-weight:bold;', + 3 => false, + 4 => '' + ), + + 2 => array( + 0 => array( + 'nil', + 'false', 'true' + ), + 1 => $CONTEXT . '/keyidents', + 2 => 'color:#000; font-weight:bold;', + 3 => false, + 4 => '' + ), + + //Standard functions of Unit System + 3 => array( + 0 => array( + 'Abs','AcquireExceptionObject','Addr','AnsiToUtf8','Append','ArcTan','Assert','Assigned','AssignFile', + 'BeginThread','BlockRead','BlockWrite','Break','ChDir','Chr','Close','CloseFile','CompToCurrency', + 'CompToDouble','Concat','Continue','Copy','Cos','Dec','Delete','Dispose','DoubleToComp','EndThread', + 'EnumModules','EnumResourceModules','Eof','Eoln','Erase','ExceptAddr','ExceptObject','Exclude','Exit', + 'Exp','FilePos','FileSize','FillChar','Finalize','FindClassHInstance','FindHInstance','FindResourceHInstance', + 'Flush','Frac','FreeMem','Get8087CW','GetDir','GetLastError','GetMem','GetMemoryManager', + 'GetModuleFileName','GetVariantManager','Halt','Hi','High','Inc','Include','Initialize','Insert', + 'Int','IOResult','IsMemoryManagerSet','IsVariantManagerSet','Length','Ln','Lo','Low','MkDir','Move', + 'New','Odd','OleStrToString','OleStrToStrVar','Ord','ParamCount','ParamStr','Pi','Pos','Pred','Ptr', + 'PUCS4Chars','Random','Randomize','Read','ReadLn','ReallocMem','ReleaseExceptionObject','Rename', + 'Reset','Rewrite','RmDir','Round','RunError','Seek','SeekEof','SeekEoln','Set8087CW','SetLength', + 'SetLineBreakStyle','SetMemoryManager','SetString','SetTextBuf','SetVariantManager','Sin','SizeOf', + 'Slice','Sqr','Sqrt','Str','StringOfChar','StringToOleStr','StringToWideChar','Succ','Swap','Trunc', + 'Truncate','TypeInfo','UCS4StringToWideString','UnicodeToUtf8','UniqueString','UpCase','UTF8Decode', + 'UTF8Encode','Utf8ToAnsi','Utf8ToUnicode','Val','VarArrayRedim','VarClear','WideCharLenToString', + 'WideCharLenToStrVar','WideCharToString','WideCharToStrVar','WideStringToUCS4String','Write','WriteLn' + ), + 1 => $CONTEXT . '/stdprocs/system', + 2 => 'color:#444;', + 3 => false, + 4 => '' + ), + + //Standard functions of Unit SysUtils + 4 => array( + 0 => array( + 'Abort','AddExitProc','AddTerminateProc','AdjustLineBreaks','AllocMem','AnsiCompareFileName', + 'AnsiCompareStr','AnsiCompareText','AnsiDequotedStr','AnsiExtractQuotedStr','AnsiLastChar', + 'AnsiLowerCase','AnsiLowerCaseFileName','AnsiPos','AnsiQuotedStr','AnsiSameStr','AnsiSameText', + 'AnsiStrComp','AnsiStrIComp','AnsiStrLastChar','AnsiStrLComp','AnsiStrLIComp','AnsiStrLower', + 'AnsiStrPos','AnsiStrRScan','AnsiStrScan','AnsiStrUpper','AnsiUpperCase','AnsiUpperCaseFileName', + 'AppendStr','AssignStr','Beep','BoolToStr','ByteToCharIndex','ByteToCharLen','ByteType', + 'CallTerminateProcs','ChangeFileExt','CharLength','CharToByteIndex','CharToByteLen','CompareMem', + 'CompareStr','CompareText','CreateDir','CreateGUID','CurrentYear','CurrToStr','CurrToStrF','Date', + 'DateTimeToFileDate','DateTimeToStr','DateTimeToString','DateTimeToSystemTime','DateTimeToTimeStamp', + 'DateToStr','DayOfWeek','DecodeDate','DecodeDateFully','DecodeTime','DeleteFile','DirectoryExists', + 'DiskFree','DiskSize','DisposeStr','EncodeDate','EncodeTime','ExceptionErrorMessage', + 'ExcludeTrailingBackslash','ExcludeTrailingPathDelimiter','ExpandFileName','ExpandFileNameCase', + 'ExpandUNCFileName','ExtractFileDir','ExtractFileDrive','ExtractFileExt','ExtractFileName', + 'ExtractFilePath','ExtractRelativePath','ExtractShortPathName','FileAge','FileClose','FileCreate', + 'FileDateToDateTime','FileExists','FileGetAttr','FileGetDate','FileIsReadOnly','FileOpen','FileRead', + 'FileSearch','FileSeek','FileSetAttr','FileSetDate','FileSetReadOnly','FileWrite','FinalizePackage', + 'FindClose','FindCmdLineSwitch','FindFirst','FindNext','FloatToCurr','FloatToDateTime', + 'FloatToDecimal','FloatToStr','FloatToStrF','FloatToText','FloatToTextFmt','FmtLoadStr','FmtStr', + 'ForceDirectories','Format','FormatBuf','FormatCurr','FormatDateTime','FormatFloat','FreeAndNil', + 'GetCurrentDir','GetEnvironmentVariable','GetFileVersion','GetFormatSettings', + 'GetLocaleFormatSettings','GetModuleName','GetPackageDescription','GetPackageInfo','GUIDToString', + 'IncAMonth','IncludeTrailingBackslash','IncludeTrailingPathDelimiter','IncMonth','InitializePackage', + 'InterlockedDecrement','InterlockedExchange','InterlockedExchangeAdd','InterlockedIncrement', + 'IntToHex','IntToStr','IsDelimiter','IsEqualGUID','IsLeapYear','IsPathDelimiter','IsValidIdent', + 'Languages','LastDelimiter','LoadPackage','LoadStr','LowerCase','MSecsToTimeStamp','NewStr', + 'NextCharIndex','Now','OutOfMemoryError','QuotedStr','RaiseLastOSError','RaiseLastWin32Error', + 'RemoveDir','RenameFile','ReplaceDate','ReplaceTime','SafeLoadLibrary','SameFileName','SameText', + 'SetCurrentDir','ShowException','Sleep','StrAlloc','StrBufSize','StrByteType','StrCat', + 'StrCharLength','StrComp','StrCopy','StrDispose','StrECopy','StrEnd','StrFmt','StrIComp', + 'StringReplace','StringToGUID','StrLCat','StrLComp','StrLCopy','StrLen','StrLFmt','StrLIComp', + 'StrLower','StrMove','StrNew','StrNextChar','StrPas','StrPCopy','StrPLCopy','StrPos','StrRScan', + 'StrScan','StrToBool','StrToBoolDef','StrToCurr','StrToCurrDef','StrToDate','StrToDateDef', + 'StrToDateTime','StrToDateTimeDef','StrToFloat','StrToFloatDef','StrToInt','StrToInt64', + 'StrToInt64Def','StrToIntDef','StrToTime','StrToTimeDef','StrUpper','Supports','SysErrorMessage', + 'SystemTimeToDateTime','TextToFloat','Time','GetTime','TimeStampToDateTime','TimeStampToMSecs', + 'TimeToStr','Trim','TrimLeft','TrimRight','TryEncodeDate','TryEncodeTime','TryFloatToCurr', + 'TryFloatToDateTime','TryStrToBool','TryStrToCurr','TryStrToDate','TryStrToDateTime','TryStrToFloat', + 'TryStrToInt','TryStrToInt64','TryStrToTime','UnloadPackage','UpperCase','WideCompareStr', + 'WideCompareText','WideFmtStr','WideFormat','WideFormatBuf','WideLowerCase','WideSameStr', + 'WideSameText','WideUpperCase','Win32Check','WrapText' + ), + 1 => $CONTEXT . '/stdprocs/sysutils', + 2 => 'color:#444;', + 3 => false, + 4 => '' + ), + + //Standard functions of Unit Classes + 5 => array( + 0 => array( + 'ActivateClassGroup','AllocateHwnd','BinToHex','CheckSynchronize','CollectionsEqual','CountGenerations', + 'DeallocateHwnd','EqualRect','ExtractStrings','FindClass','FindGlobalComponent','GetClass', + 'GroupDescendantsWith','HexToBin','IdentToInt','InitInheritedComponent','IntToIdent','InvalidPoint', + 'IsUniqueGlobalComponentName','LineStart','ObjectBinaryToText','ObjectResourceToText', + 'ObjectTextToBinary','ObjectTextToResource','PointsEqual','ReadComponentRes','ReadComponentResEx', + 'ReadComponentResFile','Rect','RegisterClass','RegisterClassAlias','RegisterClasses', + 'RegisterComponents','RegisterIntegerConsts','RegisterNoIcon','RegisterNonActiveX','SmallPoint', + 'StartClassGroup','TestStreamFormat','UnregisterClass','UnregisterClasses','UnregisterIntegerConsts', + 'UnregisterModuleClasses','WriteComponentResFile' + ), + 1 => $CONTEXT . '/stdprocs/classes', + 2 => 'color:#444;', + 3 => false, + 4 => '' + ), + + //Standard functions of Unit Math + 6 => array( + 0 => array( + 'ArcCos', 'ArcCosh', 'ArcCot', 'ArcCotH', 'ArcCsc', 'ArcCscH', 'ArcSec', 'ArcSecH', 'ArcSin', + 'ArcSinh', 'ArcTan2', 'ArcTanh', 'Ceil', 'CompareValue', 'Cosecant', 'Cosh', 'Cot', 'Cotan', + 'CotH', 'Csc', 'CscH', 'CycleToDeg', 'CycleToGrad', 'CycleToRad', 'DegToCycle', 'DegToGrad', + 'DegToRad', 'DivMod', 'DoubleDecliningBalance', 'EnsureRange', 'Floor', 'Frexp', 'FutureValue', + 'GetExceptionMask', 'GetPrecisionMode', 'GetRoundMode', 'GradToCycle', 'GradToDeg', 'GradToRad', + 'Hypot', 'InRange', 'InterestPayment', 'InterestRate', 'InternalRateOfReturn', 'IntPower', + 'IsInfinite', 'IsNan', 'IsZero', 'Ldexp', 'LnXP1', 'Log10', 'Log2', 'LogN', 'Max', 'MaxIntValue', + 'MaxValue', 'Mean', 'MeanAndStdDev', 'Min', 'MinIntValue', 'MinValue', 'MomentSkewKurtosis', + 'NetPresentValue', 'Norm', 'NumberOfPeriods', 'Payment', 'PeriodPayment', 'Poly', 'PopnStdDev', + 'PopnVariance', 'Power', 'PresentValue', 'RadToCycle', 'RadToDeg', 'RadToGrad', 'RandG', 'RandomRange', + 'RoundTo', 'SameValue', 'Sec', 'Secant', 'SecH', 'SetExceptionMask', 'SetPrecisionMode', 'SetRoundMode', + 'Sign', 'SimpleRoundTo', 'SinCos', 'Sinh', 'SLNDepreciation', 'StdDev', 'Sum', 'SumInt', 'SumOfSquares', + 'SumsAndSquares', 'SYDDepreciation', 'Tan', 'Tanh', 'TotalVariance', 'Variance' + ), + 1 => $CONTEXT . '/stdprocs/math', + 2 => 'color:#444;', + 3 => false, + 4 => '' + ), +); + +$this->_contextSymbols = array( + 0 => array( + 0 => array( + '+', '-', '*', '/' + ), + 1 => $CONTEXT . '/mathsym', + 2 => 'color:#008000;' + ), + 1 => array( + 0 => array( + ':', ';', ',' + ), + 1 => $CONTEXT . '/ctrlsym', + 2 => 'color:#008000;' + ), + 2 => array( + 0 => array( + '<', '=', '>' + ), + 1 => $CONTEXT . '/cmpsym', + 2 => 'color:#008000;' + ), + 3 => array( + 0 => array( + '(', ')', '[', ']' + ), + 1 => $CONTEXT . '/brksym', + 2 => 'color:#008000;' + ), + 4 => array( + 0 => array( + '.', '@', '^' + ), + 1 => $CONTEXT . '/oopsym', + 2 => 'color:#008000;' + ) +// '|', '=', '!', ':', '(', ')', ',', '<', '>', '&', '$', '+', '-', '*', '/', +// '{', '}', ';', '[', ']', '~', '?' +); + +$this->_contextRegexps = array( + 0 => array( + 0 => array( + '/(#[0-9]+)/' + ), + 1 => '#', + 2 => array( + 1 => array($CONTEXT . '/char', 'color:#db9;', false) + ) + ), + 1 => array( + 0 => array( + '/(#\$[0-9a-fA-F]+)/' + ), + 1 => '#', + 2 => array( + 1 => array($CONTEXT . '/charhex', 'color:#db9;', false) + ) + ), + 2 => array( + 0 => array( + '/(\$[0-9a-fA-F]+)/' + ), + 1 => '$', + 2 => array( + 1 => array($CONTEXT . '/hex', 'color: #2bf;', false) + ) + ), + 3 => array( + 0 => array( + '/(\.\.)/' + ), + 1 => '.', + 2 => array( + 1 => array($CONTEXT . '/ctrlsym', 'color: #008000;', false) + ) + ), + 4 => geshi_use_doubles($CONTEXT, true), // second parameter says leading zero is required. + 5 => geshi_use_integers($CONTEXT) +); + +$this->_objectSplitters = array( + 0 => array( + 0 => array('.'), + 1 => $CONTEXT . '/oodynamic', + 2 => 'color:#559;', + 3 => false // If true, check that matched method isn't a keyword first + ) +); + +?> diff --git a/paste/include/geshi/contexts/delphi/exports_brackets.php b/paste/include/geshi/contexts/delphi/exports_brackets.php new file mode 100644 index 0000000..7621366 --- /dev/null +++ b/paste/include/geshi/contexts/delphi/exports_brackets.php @@ -0,0 +1,178 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Benny Baumann <BenBE@benbe.omorphia.de>, Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('('), + 1 => array(')'), + 2 => false + ) +); + + +$this->_childContexts = array( + new GeSHiContext('delphi', $DIALECT, 'preprocessor'), + new GeSHiContext('delphi', $DIALECT, 'common/single_comment'), + new GeSHiContext('delphi', $DIALECT, 'multi_comment') +); + + +//$this->_styler->setStyle($CONTEXT, 'color:#000;'); +//$this->_styler->setStartStyle($CONTEXT, 'color:#f00;font-weight:bold;'); +//$this->_styler->setEndStyle($CONTEXT, 'color:#00f;'); +$this->_startName = 'brksym'; // highlight starter as if it was a keyword +$this->_endName = 'brksym'; // highlight ender as if it was a ctrlsym + +$this->_contextKeywords = array( + 0 => array( + 0 => array( + //@todo get keywords normal way + 'var', 'out', 'const', 'array' + ), + 1 => $CONTEXT . '/keywords', + 2 => 'color:#f00; font-weight:bold;', + 3 => false, + 4 => '' + ), + 1 => array( + 0 => array( + 'Boolean', 'ByteBool', 'LongBool', 'WordBool', 'Bool', + + 'Byte', 'SmallInt', + 'ShortInt', 'Word', + 'Integer', 'Cardinal', + 'LongInt', 'DWORD', + 'Int64', + + 'Single', 'Double', 'Extended', + 'Real48', 'Real', 'Comp', 'Currency', + + 'Pointer', + + 'Char', 'AnsiChar', 'WideChar', + 'PChar', 'PAnsiChar', 'PWideChar', + 'String', 'AnsiString', 'WideString', + + 'THandle' + ), + 1 => $CONTEXT . '/keytypes', + 2 => 'color:#000; font-weight:bold;', + 3 => false, + 4 => '' + ), + 2 => array( + 0 => array( + //@todo get keywords normal way + 'nil', + 'false', 'true' + ), + 1 => $CONTEXT . '/keyidents', + 2 => 'color:#000; font-weight:bold;', + 3 => false, + 4 => '' + ) +); + +$this->_contextSymbols = array( +/* 0 => array( + 0 => array( + // @todo [blocking 1.1.1] are the [ and ] needed? They're handled by starter and ender, do they ever actually + // occur *inside* this context? (deferred to 1.1.1) + + // BenBE: [] might just well occure as part of a function declaration. But it's thus unlikly that there's no + // absolut requirement to handle them. I actually would have to check if the Delphi compiler actually compiles + // such source (I doubt it will compile). + // @todo Test if exports ABC(A: Array[13..37] of Integer) name 'ABC'; actually compiles. + '(', ']' + ), + 1 => $CONTEXT . '/brksym', + 2 => 'color:#008000;' + ),*/ + 1 => array( + 0 => array( + ':', ';', ',', '=' + ), + 1 => $CONTEXT . '/ctrlsym', + 2 => 'color:#008000;' + ), + 2 => array( + 0 => array( + '.' + ), + 1 => $CONTEXT . '/oopsym', + 2 => 'color:#008000;' + ) +); + +$this->_contextRegexps = array( + 0 => array( + 0 => array( + '/(#[0-9]+)/' + ), + 1 => '#', + 2 => array( + 1 => array($CONTEXT . '/char', 'color:#db9;', false) + ) + ), + 1 => array( + 0 => array( + '/(#\$[0-9a-fA-F]+)/' + ), + 1 => '#', + 2 => array( + 1 => array($CONTEXT . '/charhex', 'color:#db9;', false) + ) + ), + 2 => array( + 0 => array( + '/(\$[0-9a-fA-F]+)/' + ), + 1 => '$', + 2 => array( + 1 => array($CONTEXT . '/hex', 'color: #2bf;', false) + ) + ), + 3 => geshi_use_integers($CONTEXT) +); + +$this->_objectSplitters = array( + 0 => array( + 0 => array('.'), + 1 => $CONTEXT . '/oodynamic', + 2 => 'color:#559;', + 3 => false // If true, check that matched method isn't a keyword first + ) +); + +?> diff --git a/paste/include/geshi/contexts/delphi/extern.php b/paste/include/geshi/contexts/delphi/extern.php new file mode 100644 index 0000000..a96516f --- /dev/null +++ b/paste/include/geshi/contexts/delphi/extern.php @@ -0,0 +1,131 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Benny Baumann <BenBE@benbe.omorphia.de>, Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('exports'), + 1 => array(';'), + 2 => false + ), + 1 => array( + 0 => array('external'), + 1 => array(';'), + 2 => false + ) +); + +$this->_childContexts = array( + new GeSHiContext('delphi', $DIALECT, 'preprocessor'), + new GeSHiContext('delphi', $DIALECT, 'multi_comment'), + new GeSHiContext('delphi', $DIALECT, 'common/single_comment'), + new GeSHiContext('delphi', $DIALECT, 'common/single_string_eol'), + new GeSHiCodeContext('delphi', $DIALECT, 'exports_brackets', 'delphi/' . $DIALECT) +); + +//$this->_styler->setStyle($CONTEXT, 'color:#000;'); +//$this->_styler->setStyle($CONTEXT_START, 'color:#f00;font-weight:bold;'); +//$this->_styler->setStyle($CONTEXT_END, 'color:#00f;'); +$this->_startName = 'keywords'; +$this->_endName = 'ctrlsym'; + +$this->_contextKeywords = array( + 0 => array( + 0 => array( + 'name','index','resident' + ), + 1 => $CONTEXT . '/keywords', + 2 => 'color:#f00; font-weight:bold;', + 3 => false, + 4 => '' + ), +); + +$this->_contextSymbols = array( + 0 => array( + 0 => array( + ',', '[', ']', '.' + ), + 1 => $CONTEXT . '/sym', + 2 => 'color:#008000;' + ), + 1 => array( + 0 => array( + '(', ')', '[', ']' + ), + 1 => $CONTEXT . '/brksym', + 2 => 'color:#008000;' + ) +); + +$this->_contextRegexps = array( + 0 => array( + 0 => array( + '/(#[0-9]+)/' + ), + 1 => '#', + 2 => array( + 1 => array($CONTEXT . '/char', 'color:#db9;', false) + ) + ), + 1 => array( + 0 => array( + '/(#\$[0-9a-fA-F]+)/' + ), + 1 => '#', + 2 => array( + 1 => array($CONTEXT . '/charhex', 'color:#db9;', false) + ) + ), + 2 => array( + 0 => array( + '/(\$[0-9a-fA-F]+)/' + ), + 1 => '$', + 2 => array( + 1 => array($CONTEXT . '/hex', 'color: #2bf;', false) + ) + ), + 3 => geshi_use_integers($CONTEXT) +); + +$this->_objectSplitters = array( + 0 => array( + 0 => array('.'), + 1 => $CONTEXT . '/oodynamic', + 2 => 'color:#559;', + 3 => false // If true, check that matched method isn't a keyword first + ) +); + +?> diff --git a/paste/include/geshi/contexts/delphi/multi_comment.php b/paste/include/geshi/contexts/delphi/multi_comment.php new file mode 100644 index 0000000..76e3284 --- /dev/null +++ b/paste/include/geshi/contexts/delphi/multi_comment.php @@ -0,0 +1,51 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Benny Baumann <BenBE@benbe.omorphia.de>, Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('{'), + 1 => array('}'), + 2 => false + ), + 1 => array( + 0 => array('(*'), + 1 => array('*)'), + 2 => false + ) +); + +$this->_styler->setStyle($CONTEXT, 'color:#888;font-style:italic;'); +$this->_contextStyleType = GESHI_STYLE_COMMENTS; + +?> diff --git a/paste/include/geshi/contexts/delphi/preprocessor.php b/paste/include/geshi/contexts/delphi/preprocessor.php new file mode 100644 index 0000000..da66662 --- /dev/null +++ b/paste/include/geshi/contexts/delphi/preprocessor.php @@ -0,0 +1,51 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Benny Baumann <BenBE@benbe.omorphia.de>, Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('{$'), + 1 => array('}'), + 2 => false + ), + 1 => array( + 0 => array('(*$'), + 1 => array('*)'), + 2 => false + ) +); + +$this->_styler->setStyle($CONTEXT, 'color:#080;font-style:italic;'); +$this->_contextStyleType = GESHI_STYLE_COMMENTS; + +?> diff --git a/paste/include/geshi/contexts/delphi/property.php b/paste/include/geshi/contexts/delphi/property.php new file mode 100644 index 0000000..db87a1a --- /dev/null +++ b/paste/include/geshi/contexts/delphi/property.php @@ -0,0 +1,157 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Benny Baumann <BenBE@benbe.omorphia.de>, Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('property'), + 1 => array(';'), + 2 => false + ) +); + + +$this->_childContexts = array( + new GeSHiContext('delphi', $DIALECT, 'preprocessor'), + new GeSHiContext('delphi', $DIALECT, 'common/single_comment'), + new GeSHiContext('delphi', $DIALECT, 'multi_comment'), + new GeSHiCodeContext('delphi', $DIALECT, 'property_index', 'delphi/' . $DIALECT) +); + +//$this->_styler->setStyle($CONTEXT, 'color:#000;'); +//$this->_styler->setStartStyle($CONTEXT, 'color:#f00;font-weight:bold;'); +//$this->_styler->setEndStyle($CONTEXT, 'color:#00f;'); +$this->_startName = 'keywords'; // highlight starter as if it was a keyword +$this->_endName = 'ctrlsym'; // highlight ender as if it was a ctrlsym + +$this->_contextKeywords = array( + 0 => array( + 0 => array( + 'read','write','index','stored','default','nodefault','implements', + 'dispid','readonly','writeonly' + ), + 1 => $CONTEXT . '/keywords', + 2 => 'color:#f00; font-weight:bold;', + 3 => false, + 4 => '' + ), + 1 => array( + 0 => array( + 'Boolean', 'ByteBool', 'LongBool', 'WordBool', 'Bool', + + 'Byte', 'SmallInt', + 'ShortInt', 'Word', + 'Integer', 'Cardinal', + 'LongInt', 'DWORD', + 'Int64', + + 'Single', 'Double', 'Extended', + 'Real48', 'Real', 'Comp', 'Currency', + + 'Pointer', + + 'Char', 'AnsiChar', 'WideChar', + 'PChar', 'PAnsiChar', 'PWideChar', + 'String', 'AnsiString', 'WideString', + + 'THandle' + ), + 1 => $CONTEXT . '/keytypes', + 2 => 'color:#000; font-weight:bold;', + 3 => false, + 4 => '' + ), + 2 => array( + 0 => array( + //@todo get keywords normal way + 'nil', + 'false', 'true' + ), + 1 => $CONTEXT . '/keyidents', + 2 => 'color:#000; font-weight:bold;', + 3 => false, + 4 => '' + ) +); + +$this->_contextSymbols = array( + 0 => array( + 0 => array( + ':' + ), + 1 => $CONTEXT . '/ctrlsym', + 2 => 'color:#008000;' + ) +); + +$this->_contextRegexps = array( + 0 => array( + 0 => array( + '/(#[0-9]+)/' + ), + 1 => '#', + 2 => array( + 1 => array($CONTEXT . '/char', 'color:#db9;', false) + ) + ), + 1 => array( + 0 => array( + '/(#\$[0-9a-fA-F]+)/' + ), + 1 => '#', + 2 => array( + 1 => array($CONTEXT . '/charhex', 'color:#db9;', false) + ) + ), + 2 => array( + 0 => array( + '/(\$[0-9a-fA-F]+)/' + ), + 1 => '$', + 2 => array( + 1 => array($CONTEXT . '/hex', 'color: #2bf;', false) + ) + ), + 3 => geshi_use_integers($CONTEXT) +); + +$this->_objectSplitters = array( + 0 => array( + 0 => array('.'), + 1 => $CONTEXT . '/oodynamic', + 2 => 'color:#559;', + 3 => false // If true, check that matched method isn't a keyword first + ) +); + +?> diff --git a/paste/include/geshi/contexts/delphi/property_index.php b/paste/include/geshi/contexts/delphi/property_index.php new file mode 100644 index 0000000..c9bf62b --- /dev/null +++ b/paste/include/geshi/contexts/delphi/property_index.php @@ -0,0 +1,143 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Benny Baumann <BenBE@benbe.omorphia.de>, Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('['), + 1 => array(']'), + 2 => false + ) +); + + +$this->_childContexts = array( + new GeSHiContext('delphi', $DIALECT, 'preprocessor'), + new GeSHiContext('delphi', $DIALECT, 'common/single_comment'), + new GeSHiContext('delphi', $DIALECT, 'multi_comment') +); + + +//$this->_styler->setStyle($CONTEXT, 'color:#000;'); +//$this->_styler->setStartStyle($CONTEXT, 'color:#f00;font-weight:bold;'); +//$this->_styler->setEndStyle($CONTEXT, 'color:#00f;'); +$this->_startName = 'brksym'; // highlight starter as if it was a keyword +$this->_endName = 'brksym'; // highlight ender as if it was a ctrlsym + +$this->_contextKeywords = array( + 0 => array( + 0 => array( + 'Boolean', 'ByteBool', 'LongBool', 'WordBool', 'Bool', + + 'Byte', 'SmallInt', + 'ShortInt', 'Word', + 'Integer', 'Cardinal', + 'LongInt', 'DWORD', + 'Int64', + + 'Single', 'Double', 'Extended', + 'Real48', 'Real', 'Comp', 'Currency', + + 'Pointer', + + 'Char', 'AnsiChar', 'WideChar', + 'PChar', 'PAnsiChar', 'PWideChar', + 'String', 'AnsiString', 'WideString', + + 'THandle' + ), + 1 => $CONTEXT . '/keytypes', + 2 => 'color:#000; font-weight:bold;', + 3 => false, + 4 => '' + ) +); + +$this->_contextSymbols = array( + 0 => array( + 0 => array( + ':', ';', ',' + ), + 1 => $CONTEXT . '/ctrlsym', + 2 => 'color:#008000;' + ), + 1 => array( + 0 => array( + '.' + ), + 1 => $CONTEXT . '/oopsym', + 2 => 'color:#008000;' + ) +); + +$this->_contextRegexps = array( + 0 => array( + 0 => array( + '/(#[0-9]+)/' + ), + 1 => '#', + 2 => array( + 1 => array($CONTEXT . '/char', 'color:#db9;', false) + ) + ), + 1 => array( + 0 => array( + '/(#\$[0-9a-fA-F]+)/' + ), + 1 => '#', + 2 => array( + 1 => array($CONTEXT . '/charhex', 'color:#db9;', false) + ) + ), + 2 => array( + 0 => array( + '/(\$[0-9a-fA-F]+)/' + ), + 1 => '$', + 2 => array( + 1 => array($CONTEXT . '/hex', 'color: #2bf;', false) + ) + ), + 3 => geshi_use_integers($CONTEXT) +); + +$this->_objectSplitters = array( + 0 => array( + 0 => array('.'), + 1 => $CONTEXT . '/oodynamic', + 2 => 'color:#559;', + 3 => false // If true, check that matched method isn't a keyword first + ) +); + +?>
\ No newline at end of file diff --git a/paste/include/geshi/contexts/doxygen/doxygen.php b/paste/include/geshi/contexts/doxygen/doxygen.php new file mode 100644 index 0000000..5d049d5 --- /dev/null +++ b/paste/include/geshi/contexts/doxygen/doxygen.php @@ -0,0 +1,44 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_childContexts = array( + new GeSHiContext('doxygen', $DIALECT, 'tag'), + new GeshiContext('doxygen', $DIALECT, 'link'), + new GeSHiContext('html', $DIALECT, 'tag') +); + +$this->_styler->setStyle($CONTEXT, 'color:#555;font-style:italic;'); +$this->_contextStyleType = GESHI_STYLE_COMMENTS; + +?> diff --git a/paste/include/geshi/contexts/doxygen/link.php b/paste/include/geshi/contexts/doxygen/link.php new file mode 100644 index 0000000..da68e2e --- /dev/null +++ b/paste/include/geshi/contexts/doxygen/link.php @@ -0,0 +1,46 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +// Delimiters have no bearing on OCCs +$this->_contextDelimiters = array( + 0 => array( + 0 => array('{@'), + 1 => array('}'), + 2 => false + ) +); + +$this->_styler->setStyle($CONTEXT, 'color:#0095ff;font-weight:bold;'); + +?> diff --git a/paste/include/geshi/contexts/doxygen/tag.php b/paste/include/geshi/contexts/doxygen/tag.php new file mode 100644 index 0000000..5158b54 --- /dev/null +++ b/paste/include/geshi/contexts/doxygen/tag.php @@ -0,0 +1,46 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +// Delimiters have no bearing on OCCs +$this->_contextDelimiters = array( + 0 => array( + 0 => array('@'), + 1 => array('REGEX#[^a-z]#'), + 2 => false + ) +); + +$this->_styler->setStyle($CONTEXT, 'color:#ca60ca;font-weight:bold;'); + +?> diff --git a/paste/include/geshi/contexts/html/comment.php b/paste/include/geshi/contexts/html/comment.php new file mode 100644 index 0000000..346b16b --- /dev/null +++ b/paste/include/geshi/contexts/html/comment.php @@ -0,0 +1,46 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('<!--'), + 1 => array('-->'), + 2 => false + ) +); + +$this->_styler->setStyle($CONTEXT, 'color:#888;'); +$this->_contextStyleType = GESHI_STYLE_COMMENTS; + +?> diff --git a/paste/include/geshi/contexts/html/css.php b/paste/include/geshi/contexts/html/css.php new file mode 100644 index 0000000..a6107f1 --- /dev/null +++ b/paste/include/geshi/contexts/html/css.php @@ -0,0 +1,49 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + //@todo [blocking 1.1.9] The <![CDATA[ was added to stop CSS jumping into attribute selector context + //the moment it was encountered, but this only really applies to XML + 0 => array('REGEX#<style[^>]+>\s*(<!\[CDATA\[)?#i'), + 1 => array('</style>'), + 2 => false + ) +); + +$this->_delimiterParseData = GESHI_CHILD_PARSE_NONE; + +$this->_overridingChildContext =& new GeSHiCodeContext('css'); + +?> diff --git a/paste/include/geshi/contexts/html/doctype.php b/paste/include/geshi/contexts/html/doctype.php new file mode 100644 index 0000000..818730c --- /dev/null +++ b/paste/include/geshi/contexts/html/doctype.php @@ -0,0 +1,50 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('<!DOCTYPE '), + 1 => array('>'), + 2 => false + ) +); + +$this->_childContexts = array( + // HTML strings have no escape characters, so the don't need to be GeSHiStringContexts + new GeSHiContext('html', $DIALECT, 'string') +); + +$this->_styler->setStyle($CONTEXT, 'font-weight:bold;color:#933;'); + +?> diff --git a/paste/include/geshi/contexts/html/html.php b/paste/include/geshi/contexts/html/html.php new file mode 100644 index 0000000..2e9169d --- /dev/null +++ b/paste/include/geshi/contexts/html/html.php @@ -0,0 +1,55 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_childContexts = array( + new GeSHiContext('html', $DIALECT, 'doctype'), + new GeSHiCodeContext('html', $DIALECT, 'tag'), + new GeSHiContext('html', $DIALECT, 'comment'), + new GeSHiContext('html', $DIALECT, 'css'), + new GeSHiContext('html', $DIALECT, 'javascript') +); + +$this->_styler->setStyle($CONTEXT, 'color:#000;'); + +$this->_contextRegexps = array( + 0 => array( + 0 => array('#(&(([a-z0-9]{2,5})|(\#[0-9]{2,4}));)#'), + 1 => '&', + 2 => array( + 1 => array($CONTEXT . '/entity', 'color: #00c;', false) + ) + ) +); + +?> diff --git a/paste/include/geshi/contexts/html/javascript.php b/paste/include/geshi/contexts/html/javascript.php new file mode 100644 index 0000000..1ba7352 --- /dev/null +++ b/paste/include/geshi/contexts/html/javascript.php @@ -0,0 +1,49 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('REGEX#<script[^>]+>#i'), + 1 => array('</script>'), + 2 => false + ) +); + +// If this is set to parse any of the delimiters, the OCC swallows it up - setStartStyle and +// setEndStyle have no meaning in a context with an OCC (actually, nor does setStyle) +$this->_delimiterParseData = GESHI_CHILD_PARSE_NONE; + +$this->_overridingChildContext = new GeSHiCodeContext('javascript'); + +?> diff --git a/paste/include/geshi/contexts/html/string.php b/paste/include/geshi/contexts/html/string.php new file mode 100644 index 0000000..55149e5 --- /dev/null +++ b/paste/include/geshi/contexts/html/string.php @@ -0,0 +1,56 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + // Each of ' and " delimiters. In their own group so they only end themselves + 0 => array( + 0 => array("'"), + 1 => array("'"), + 2 => false + ), + 1 => array( + 0 => array('"'), + 1 => array('"'), + 2 => false + ) +); + +$this->_childContexts = array( + new GeSHiContext('html', $DIALECT, 'string_javascript') +); + +$this->_styler->setStyle($CONTEXT, 'color:#933;'); +$this->_contextStyleType = GESHI_STYLE_STRINGS; + +?> diff --git a/paste/include/geshi/contexts/html/string_javascript.php b/paste/include/geshi/contexts/html/string_javascript.php new file mode 100644 index 0000000..f210bc0 --- /dev/null +++ b/paste/include/geshi/contexts/html/string_javascript.php @@ -0,0 +1,55 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +//@todo [blocking 1.1.1] (bug 11) Using a ^ before the starters does +// not work, because when useless contexts are purged neither the ^return +// nor the ^javascript: are matched so this context is removed. +// I'm leaving it until 1.1.1 to solve this. One way might be to add a flag +// to this array or a field to the GeSHiContext class that says "never remove +// me, even if I am useless" +$this->_contextDelimiters = array( + 0 => array( + 0 => array('REGEX#return#', 'REGEX#javascript:#'), + 1 => array('"'), + 2 => false + ) +); + +// If this is set to parse any of the delimiters, the OCC swallows it up - setStartStyle and +// setEndStyle have no meaning in a context with an OCC (actually, nor does setStyle) +$this->_delimiterParseData = GESHI_CHILD_PARSE_LEFT; + +$this->_overridingChildContext = new GeSHiCodeContext('javascript'); + +?> diff --git a/paste/include/geshi/contexts/html/tag.php b/paste/include/geshi/contexts/html/tag.php new file mode 100644 index 0000000..44bed38 --- /dev/null +++ b/paste/include/geshi/contexts/html/tag.php @@ -0,0 +1,98 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('REGEX#<[/a-z_0-6]+#i'), + 1 => array('>'), + 2 => false + ) +); + +$this->_childContexts = array( + // HTML strings have no escape characters, so the don't need to be GeSHiStringContexts + new GeSHiContext('html', $DIALECT, 'string') +); + +$this->_styler->setStyle($CONTEXT, 'color:#008000;'); +$this->_styler->setStyle($CONTEXT_START, 'font-weight:bold;color:#000;'); +$this->_styler->setStyle($CONTEXT_END, 'font-weight:bold;color:#000;'); + +$this->_contextKeywords = array( + 0 => array( + // keywords + 0 => array( + 'abbr', 'accept-charset', 'accept', 'accesskey', 'action', 'align', + 'alink', 'alt', 'archive', 'axis', 'background', 'bgcolor', 'border', + 'cellpadding', 'cellspacing', 'char', 'charoff', 'charset', 'checked', + 'cite', 'class', 'classid', 'clear', 'code', 'codebase', 'codetype', + 'color', 'cols', 'colspan', 'compact', 'content', 'coords', 'data', + 'datetime', 'declare', 'defer', 'dir', 'disabled', 'enctype', 'face', + 'for', 'frame', 'frameborder', 'headers', 'height', 'href', 'hreflang', + 'hspace', 'http-equiv', 'id', 'ismap', 'label', 'lang', 'language', + 'link', 'longdesc', 'marginheight', 'marginwidth', 'maxlength', 'media', + 'method', 'multiple', 'name', 'nohref', 'noresize', 'noshade', 'nowrap', + 'object', 'onblur', 'onchange', 'onclick', 'ondblclick', 'onfocus', + 'onkeydown', 'onkeypress', 'onkeyup', 'onload', 'onmousedown', + 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onreset', + 'onselect', 'onsubmit', 'onunload', 'profile', 'prompt', 'readonly', + 'rel', 'rev', 'rows', 'rowspan', 'rules', 'scheme', 'scope', 'scrolling', + 'selected', 'shape', 'size', 'span', 'src', 'standby', 'start', 'style', + 'summary', 'tabindex', 'target', 'text', 'title', 'type', 'usemap', + 'valign', 'value', 'valuetype', 'version', 'vlink', 'vspace', 'width' + ), + // name + 1 => $CONTEXT . '/attrs', + // style + 2 => 'color:#006;', + // case sensitive + 3 => false, + // url + 4 => '' + ) +); + +$this->_contextSymbols = array( + 0 => array( + 0 => array( + '=' + ), + // name (should names have / in them like normal contexts? YES + 1 => $CONTEXT . '/sym', + // style + 2 => 'color:#008000;' + ) +); + +?> diff --git a/paste/include/geshi/contexts/javascript/javascript.php b/paste/include/geshi/contexts/javascript/javascript.php new file mode 100644 index 0000000..4f4a672 --- /dev/null +++ b/paste/include/geshi/contexts/javascript/javascript.php @@ -0,0 +1,187 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** Get the GeSHiStringContext class */ +require_once GESHI_CLASSES_ROOT . 'class.geshistringcontext.php'; + +$this->_childContexts = array( + new GeSHiContext('javascript', $DIALECT, 'common/multi_comment'), + new GeSHiContext('javascript', $DIALECT, 'common/single_comment'), + new GeSHiStringContext('javascript', $DIALECT, 'common/single_string'), + new GeSHiStringContext('javascript', $DIALECT, 'common/double_string') +); + +$this->_contextKeywords = array( + 0 => array( + 0 => array( + 'break', 'case', 'catch', 'const', 'continue', 'default', 'delete', 'do', + 'else', 'false', 'finally', 'for', 'function', 'if', 'in', 'new', 'null', + 'return', 'switch', 'throw', 'true', 'try', 'typeof', 'var', 'void', + 'while', 'with' + ), + 1 => $CONTEXT . '/keywords', + 2 => 'color:#000;font-weight:bold;', + 3 => true, + 4 => '' + ), + 1 => array( + 0 => array( + 'escape', 'isFinite', 'isNaN', 'Number', 'parseFloat', 'parseInt', + 'reload', 'taint', 'unescape', 'untaint', 'write' + ), + 1 => $CONTEXT . '/functions', + 2 => 'color:#006;', + 3 => true, + 4 => '' + ), + 2 => array( + 0 => array( + 'Anchor', 'Applet', 'Area', 'Array', 'Boolean', 'Button', 'Checkbox', + 'Date', 'document', 'window', 'Image', 'FileUpload', 'Form', 'Frame', + 'Function', 'Hidden', 'Link', 'MimeType', 'Math', 'Max', 'Min', 'Layer', + 'navigator', 'Object', 'Password', 'Plugin', 'Radio', 'RegExp', 'Reset', + 'Screen', 'Select', 'String', 'Text', 'Textarea', 'this', 'Window' + ), + 1 => $CONTEXT . '/objects', + 2 => 'color:#393;font-weight:bold;', + 3 => true, + 4 => '' + ), + 3 => array( + 0 => array( + 'abs', 'acos', 'asin', 'atan', 'atan2', 'ceil', 'cos', 'ctg', 'E', 'exp', + 'floor', 'LN2', 'LN10', 'log', 'LOG2E', 'LOG10E', 'PI', 'pow', 'round', + 'sin', 'sqrt', 'SQRT1_2', 'SQRT2', 'tan' + ), + 1 => $CONTEXT . '/math', + 2 => 'color:#fd0;', + 3 => true, + 4 => '' + ), + 4 => array( + 0 => array( + 'onAbort', 'onBlur', 'onChange', 'onClick', 'onError', 'onFocus', 'onLoad', + 'onMouseOut', 'onMouseOver', 'onReset', 'onSelect', 'onSubmit', 'onUnload' + ), + 1 => $CONTEXT . '/events', + 2 => 'color:#fdb;', + 3 => true, + 4 => '' + ), + 5 => array( + 0 => array( + 'MAX_VALUE', 'MIN_VALUE', 'NEGATIVE_INFINITY', 'NaN', 'POSITIVE_INFINITY', + 'URL', 'UTC', 'above', 'action', 'alert', 'alinkColor', 'anchor', + 'anchors', 'appCodeNam', 'appName', 'appVersion', 'applets', 'apply', + 'argument', 'arguments', 'arity', 'availHeight', 'availWidth', 'back', + 'background', 'below', 'bgColor', 'big', 'blink', 'blur', 'bold', + 'border', 'call', 'caller', 'charAt', 'charCodeAt', 'checked', + 'clearInterval', 'clearTimeout', 'click', 'clip', 'close', 'closed', + 'colorDepth', 'compile', 'complete', 'confirm', 'constructor', 'cookie', + 'current', 'cursor', 'data', 'defaultChecked', 'defaultSelected', + 'defaultStatus', 'defaultValue', 'description', 'disableExternalCapture', + 'domain', 'elements', 'embeds', 'enableExternalCapture', 'enabledPlugin', + 'encoding', 'eval', 'exec', 'fgColor', 'filename', 'find', 'fixed', + 'focus', 'fontcolor', 'fontsize', 'form', 'formName', 'forms', 'forward', + 'frames', 'fromCharCode', 'getDate', 'getDay', 'getElementById', + 'getHours', 'getMiliseconds', 'getMinutes', 'getMonth', 'getSeconds', + 'getSelection', 'getTime', 'getTimezoneOffset', 'getUTCDate', 'getUTCDay', + 'getUTCFullYear', 'getUTCHours', 'getUTCMilliseconds', 'getUTCMinutes', + 'getUTCMonth', 'getUTCSeconds', 'getYear', 'global', 'go', 'hash', + 'height', 'history', 'home', 'host', 'hostname', 'href', 'hspace', + 'ignoreCase', 'images', 'index', 'indexOf', 'innerHeight', 'innerWidth', + 'input', 'italics', 'javaEnabled', 'join', 'language', 'lastIndex', + 'lastIndexOf', 'lastModified', 'lastParen', 'layerX', 'layerY', 'layers', + 'left', 'leftContext', 'length', 'link', 'linkColor', 'links', 'load', + 'location', 'locationbar', 'lowsrc', 'match', 'menubar', 'method', + 'mimeTypes', 'modifiers', 'moveAbove', 'moveBelow', 'moveBy', 'moveTo', + 'moveToAbsolute', 'multiline', 'name', 'negative_infinity', 'next', + 'open', 'opener', 'options', 'outerHeight', 'outerWidth', 'pageX', + 'pageXoffset', 'pageY', 'pageYoffset', 'parent', 'parse', 'pathname', + 'personalbar', 'pixelDepth', 'platform', 'plugins', 'pop', 'port', + 'positive_infinity', 'preference', 'previous', 'print', 'prompt', + 'protocol', 'prototype', 'push', 'referrer', 'refresh', 'releaseEvents', + 'reload', 'replace', 'reset', 'resizeBy', 'resizeTo', 'reverse', + 'rightContext', 'screenX', 'screenY', 'scroll', 'scrollBy', 'scrollTo', + 'scrollbar', 'search', 'select', 'selected', 'selectedIndex', 'self', + 'setDate', 'setHours', 'setMinutes', 'setMonth', 'setSeconds', 'setTime', + 'setTimeout', 'setUTCDate', 'setUTCDay', 'setUTCFullYear', 'setUTCHours', + 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds', + 'setYear', 'shift', 'siblingAbove', 'siblingBelow', 'small', 'sort', + 'source', 'splice', 'split', 'src', 'status', 'statusbar', 'strike', + 'sub', 'submit', 'substr', 'substring', 'suffixes', 'sup', 'taintEnabled', + 'target', 'test', 'text', 'title', 'toGMTString', 'toLocaleString', + 'toLowerCase', 'toSource', 'toString', 'toUTCString', 'toUpperCase', + 'toolbar', 'top', 'type', 'unshift', 'unwatch', 'userAgent', 'value', + 'valueOf', 'visibility', 'vlinkColor', 'vspace', 'watch', 'which', + 'width', 'write', 'writeln', 'x', 'y', 'zIndex' + //@todo [blocking 1.1.5] Some important and recent DOM additions for js seem to be ommited... + ), + 1 => $CONTEXT . '/methods', + 2 => 'color:#933;', + 3 => true, + 4 => '' + ) +); + +$this->_contextCharactersDisallowedBeforeKeywords = array('_'); +$this->_contextCharactersDisallowedAfterKeywords = array('_'); + +$this->_contextSymbols = array( + 0 => array( + 0 => array( + '(', ')', ',', ';', ':', '[', ']', + '+', '-', '*', '/', '&', '|', '!', '<', '>', + '{', '}', '=' + ), + // name (should names have / in them like normal contexts? YES + 1 => $CONTEXT . '/symbols', + // style + 2 => 'color:#008000;' + ) +); +$this->_contextRegexps = array( + 0 => geshi_use_doubles($CONTEXT), + 1 => geshi_use_integers($CONTEXT) +); + +$this->_objectSplitters = array( + 0 => array( + 0 => array('.'), + 1 => $CONTEXT . '/oodynamic', + 2 => 'color:#559;', + 3 => true // Check that matched method isn't a keyword first + ) +); +?> diff --git a/paste/include/geshi/contexts/php/double_string.php b/paste/include/geshi/contexts/php/double_string.php new file mode 100644 index 0000000..3434b92 --- /dev/null +++ b/paste/include/geshi/contexts/php/double_string.php @@ -0,0 +1,57 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('"'), + 1 => array('"'), + 2 => false + ) +); + +$this->_styler->setStyle($this->_contextName, 'color:#f00;'); +$this->_contextStyleType = GESHI_STYLE_STRINGS; + +// String only stuff +$this->_escapeCharacters = array('\\'); +// Escapes can be defined by regular expressions. +$this->_charsToEscape = array('n', 'r', 't', 'REGEX#[0-7]{1,3}#', 'REGEX#x[0-9a-f]{1,2}#i', '\\', '"', '$'); +$this->_styler->setStyle($CONTEXT . '/esc', 'color:#006;font-weight:bold;'); + +// GeSHiPHPDoubleStringContext stuff +$this->_styler->setStyle($CONTEXT . '/var', 'color:#22f;'); +$this->_styler->setStyle($CONTEXT . '/sym0', 'color:#008000;'); +$this->_styler->setStyle($CONTEXT . '/oodynamic', 'color:#933;'); + +?> diff --git a/paste/include/geshi/contexts/php/doxygen.php b/paste/include/geshi/contexts/php/doxygen.php new file mode 100644 index 0000000..b0f7181 --- /dev/null +++ b/paste/include/geshi/contexts/php/doxygen.php @@ -0,0 +1,45 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('/**'), + 1 => array('*/'), + 2 => false + ) +); + +$this->_overridingChildContext = new GeSHiContext('doxygen'); + +?> diff --git a/paste/include/geshi/contexts/php/heredoc.php b/paste/include/geshi/contexts/php/heredoc.php new file mode 100644 index 0000000..f87aac5 --- /dev/null +++ b/paste/include/geshi/contexts/php/heredoc.php @@ -0,0 +1,60 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array("REGEX#<<<\s*([a-z][a-z0-9]*)\n#i"), + 1 => array("REGEX#\n!!!1;?\n#i"), + 2 => false + ) +); + +$this->_styler->setStyle($CONTEXT, 'color:#f00;'); +$this->_styler->setStyle($CONTEXT_START, 'color:#006;font-weight:bold;'); +$this->_styler->setStyle($CONTEXT_END, 'color:#006;font-weight:bold;'); +$this->_contextStyleType = GESHI_STYLE_STRINGS; + +//HEREDOC doesn't seem to have anything to escape - just the variable interpolation +// String only stuff +$this->_escapeCharacters = array('\\'); +// Escapes can be defined by regular expressions. +$this->_charsToEscape = array('n', 'r', 't', 'REGEX#[0-7]{1,3}#', 'REGEX#x[0-9a-f]{1,2}#i', '\\', '"'); +$this->_styler->setStyle($CONTEXT . '/esc', 'color:#006;font-weight:bold;'); + +// GeSHiPHPDoubleStringContext stuff +$this->_styler->setStyle($CONTEXT . '/var', 'color:#22f;'); +$this->_styler->setStyle($CONTEXT . '/sym0', 'color:#008000;'); +$this->_styler->setStyle($CONTEXT . '/oodynamic', 'color:#933;'); + +?> diff --git a/paste/include/geshi/contexts/php/php.php b/paste/include/geshi/contexts/php/php.php new file mode 100644 index 0000000..b0b0bd4 --- /dev/null +++ b/paste/include/geshi/contexts/php/php.php @@ -0,0 +1,910 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** Get the GeSHiStringContext class */ +require_once GESHI_CLASSES_ROOT . 'class.geshistringcontext.php'; +/** Get the GeSHiPHPDoubleStringContext class */ +require_once GESHI_CLASSES_ROOT . 'php' . GESHI_DIR_SEPARATOR . 'class.geshiphpdoublestringcontext.php'; + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('<?php', '<?'), + 1 => array('?>'), + 2 => true + ), + 1 => array( + 0 => array('<%'), + 1 => array('%>'), + 2 => false + ) +); + +$this->_childContexts = array( + new GeSHiStringContext('php', $DIALECT, 'common/single_string'), + new GeSHiPHPDoubleStringContext('php', $DIALECT, 'double_string'), + new GeSHiPHPDoubleStringContext('php', $DIALECT, 'heredoc'), + // PHP single comment, with # starter and end-php-context ender + new GeSHiContext('php', $DIALECT, 'single_comment'), + // Use common multi comment since it is a PHP comment... + new GeSHiContext('php', $DIALECT, 'common/multi_comment'), + // doxygen comments + new GeSHiContext('php', $DIALECT, 'doxygen') +); + +$this->_styler->setStyle($CONTEXT_START, 'font-weight:bold;color:#000;'); +$this->_styler->setStyle($CONTEXT_END, 'font-weight:bold;color:#000;'); + +$this->_contextKeywords = array( + 0 => array( + // keywords + 0 => array( + 'as', 'break', 'case', 'continue', 'do', 'declare', 'else', 'elseif', + 'endforeach', 'endif', 'endswitch', 'endwhile', 'for', 'foreach', 'if', + 'include', 'include_once', 'require', 'require_once', 'return', 'switch', + 'while' + ), + // name + 1 => $CONTEXT . '/cstructures', + // style + 2 => 'color:#b1b100;', + // case sensitive + 3 => false, + // url + 4 => '' + ), + 1 => array( + 0 => array( + 'DEFAULT_INCLUDE_PATH', 'E_ALL', 'E_COMPILE_ERROR', 'E_COMPILE_WARNING', + 'E_CORE_ERROR', 'E_CORE_WARNING', 'E_ERROR', 'E_NOTICE', 'E_PARSE', + 'E_STRICT', 'E_USER_ERROR', 'E_USER_NOTICE', 'E_USER_WARNING', + 'E_WARNING', 'FALSE', 'NULL', 'PEAR_EXTENSION_DIR', 'PEAR_INSTALL_DIR', + 'PHP_BINDIR', 'PHP_CONFIG_FILE_PATH', 'PHP_DATADIR', 'PHP_EXTENSION_DIR', + 'PHP_LIBDIR', 'PHP_LOCALSTATEDIR', 'PHP_OS', 'PHP_OUTPUT_HANDLER_CONT', + 'PHP_OUTPUT_HANDLER_END', 'PHP_OUTPUT_HANDLER_START', 'PHP_SYSCONFDIR', + 'PHP_VERSION', 'TRUE', '__CLASS__', '__FILE__', '__FUNCTION__', + '__LINE__', '__METHOD__', 'abstract', 'catch', 'class', 'default', + 'extends', 'final', 'function', 'implements', 'interface', 'new', + 'parent', 'private', 'protected', 'public', 'self', 'static', 'throw', + 'try', 'var' + ), + 1 => $CONTEXT . '/keywords', + 2 => 'font-weight:bold;color:#000;', + 3 => false, + 4 => '' + ), + 2 => array( + 0 => array( + 'abs', 'acos', 'acosh', 'addcslashes', 'addslashes', + 'apache_child_terminate', 'apache_lookup_uri', 'apache_note', + 'apache_setenv', 'array', 'array_change_key_case', 'array_chunk', + 'array_count_values', 'array_diff', 'array_fill', 'array_filter', + 'array_flip', 'array_intersect', 'array_key_exists', 'array_keys', + 'array_map', 'array_merge', 'array_merge_recursive', 'array_multisort', + 'array_pad', 'array_pop', 'array_push', 'array_rand', 'array_reduce', + 'array_reverse', 'array_search', 'array_shift', 'array_slice', + 'array_splice', 'array_sum', 'array_unique', 'array_unshift', + 'array_values', 'array_walk', 'arsort', 'ascii2ebcdic', 'asin', 'asinh', + 'asort', 'aspell_check', 'aspell_check_raw', 'aspell_new', + 'aspell_suggest', 'assert', 'assert_options', 'atan', 'atan2', 'atanh', + 'base64_decode', 'base64_encode', 'base_convert', 'basename', 'bcadd', + 'bccomp', 'bcdiv', 'bcmod', 'bcmul', 'bcpow', 'bcscale', 'bcsqrt', + 'bcsub', 'bin2hex', 'bind_textdomain_codeset', 'bindec', 'bindtextdomain', + 'bz', 'bzclose', 'bzdecompress', 'bzerrno', 'bzerror', 'bzerrstr', + 'bzflush', 'bzopen', 'bzread', 'bzwrite', 'c', 'cal_days_in_month', + 'cal_from_jd', 'cal_info', 'cal_to_jd', 'call_user_func', + 'call_user_func_array', 'call_user_method', 'call_user_method_array', + 'ccvs_add', 'ccvs_auth', 'ccvs_command', 'ccvs_count', 'ccvs_delete', + 'ccvs_done', 'ccvs_init', 'ccvs_lookup', 'ccvs_new', 'ccvs_report', + 'ccvs_return', 'ccvs_reverse', 'ccvs_sale', 'ccvs_status', + 'ccvs_textvalue', 'ccvs_void', 'ceil', 'chdir', 'checkdate', 'checkdnsrr', + 'chgrp', 'chmod', 'chop', 'chown', 'chr', 'chroot', 'chunk_split', + 'class_exists', 'clearstatcache', 'closedir', 'closelog', 'com', + 'com_addref', 'com_get', 'com_invoke', 'com_isenum', 'com_load', + 'com_load_typelib', 'com_propget', 'com_propput', 'com_propset', + 'com_release', 'com_set', 'compact', 'connection_aborted', + 'connection_status', 'connection_timeout', 'constant', + 'convert_cyr_string', 'copy', 'cos', 'cosh', 'count', 'count_chars', + 'cpdf_add_annotation', 'cpdf_add_outline', 'cpdf_arc', 'cpdf_begin_text', + 'cpdf_circle', 'cpdf_clip', 'cpdf_close', 'cpdf_closepath', + 'cpdf_closepath_fill_stroke', 'cpdf_closepath_stroke', + 'cpdf_continue_text', 'cpdf_curveto', 'cpdf_end_text', 'cpdf_fill', + 'cpdf_fill_stroke', 'cpdf_finalize', 'cpdf_finalize_page', + 'cpdf_global_set_document_limits', 'cpdf_import_jpeg', 'cpdf_lineto', + 'cpdf_moveto', 'cpdf_newpath', 'cpdf_open', 'cpdf_output_buffer', + 'cpdf_page_init', 'cpdf_place_inline_image', 'cpdf_rect', 'cpdf_restore', + 'cpdf_rlineto', 'cpdf_rmoveto', 'cpdf_rotate', 'cpdf_rotate_text', + 'cpdf_save', 'cpdf_save_to_file', 'cpdf_scale', 'cpdf_set_action_url', + 'cpdf_set_char_spacing', 'cpdf_set_creator', 'cpdf_set_current_page', + 'cpdf_set_font', 'cpdf_set_font_directories', 'cpdf_set_font_map_file', + 'cpdf_set_horiz_scaling', 'cpdf_set_keywords', 'cpdf_set_leading', + 'cpdf_set_page_animation', 'cpdf_set_subject', 'cpdf_set_text_matrix', + 'cpdf_set_text_pos', 'cpdf_set_text_rise', 'cpdf_set_title', + 'cpdf_set_viewer_preferences', 'cpdf_set_word_spacing', 'cpdf_setdash', + 'cpdf_setflat', 'cpdf_setgray', 'cpdf_setgray_fill', + 'cpdf_setgray_stroke', 'cpdf_setlinecap', 'cpdf_setlinejoin', + 'cpdf_setlinewidth', 'cpdf_setmiterlimit', 'cpdf_setrgbcolor', + 'cpdf_setrgbcolor_fill', 'cpdf_setrgbcolor_stroke', 'cpdf_show', + 'cpdf_show_xy', 'cpdf_stringwidth', 'cpdf_stroke', 'cpdf_text', + 'cpdf_translate', 'crack_check', 'crack_closedict', + 'crack_getlastmessage', 'crack_opendict', 'crc32', 'create_function', + 'crypt', 'ctype_alnum', 'ctype_alpha', 'ctype_cntrl', 'ctype_digit', + 'ctype_graph', 'ctype_lower', 'ctype_print', 'ctype_punct', 'ctype_space', + 'ctype_upper', 'ctype_xdigit', 'curl_close', 'curl_errno', 'curl_error', + 'curl_exec', 'curl_getinfo', 'curl_init', 'curl_setopt', 'curl_version', + 'current', 'cybercash_base64_decode', 'cybercash_base64_encode', + 'cybercash_decr', 'cybercash_encr', 'cybermut_creerformulairecm', + 'cybermut_creerreponsecm', 'cybermut_testmac', 'cyrus_authenticate', + 'cyrus_bind', 'cyrus_close', 'cyrus_connect', 'cyrus_query', + 'cyrus_unbind', 'date', 'dba_close', 'dba_delete', 'dba_exists', + 'dba_fetch', 'dba_firstkey', 'dba_insert', 'dba_nextkey', 'dba_open', + 'dba_optimize', 'dba_popen', 'dba_replace', 'dba_sync', + 'dbase_add_record', 'dbase_close', 'dbase_create', 'dbase_delete_record', + 'dbase_get_record', 'dbase_get_record_with_names', 'dbase_numfields', + 'dbase_numrecords', 'dbase_open', 'dbase_pack', 'dbase_replace_record', + 'dblist', 'dbmclose', 'dbmdelete', 'dbmexists', 'dbmfetch', 'dbmfirstkey', + 'dbminsert', 'dbmnextkey', 'dbmopen', 'dbmreplace', 'dbp', 'dbplus_add', + 'dbplus_aql', 'dbplus_chdir', 'dbplus_close', 'dbplus_curr', + 'dbplus_errcode', 'dbplus_errno', 'dbplus_find', 'dbplus_first', + 'dbplus_flush', 'dbplus_freealllocks', 'dbplus_freelock', + 'dbplus_freerlocks', 'dbplus_getlock', 'dbplus_getunique', 'dbplus_info', + 'dbplus_last', 'dbplus_lockrel', 'dbplus_next', 'dbplus_open', + 'dbplus_rchperm', 'dbplus_rcreate', 'dbplus_rcrtexact', 'dbplus_rcrtlike', + 'dbplus_resolve', 'dbplus_restorepos', 'dbplus_rkeys', 'dbplus_ropen', + 'dbplus_rquery', 'dbplus_rrename', 'dbplus_rsecindex', 'dbplus_runlink', + 'dbplus_rzap', 'dbplus_savepos', 'dbplus_setindex', + 'dbplus_setindexbynumber', 'dbplus_sql', 'dbplus_tcl', 'dbplus_tremove', + 'dbplus_undo', 'dbplus_undoprepare', 'dbplus_unlockrel', + 'dbplus_unselect', 'dbplus_update', 'dbplus_xlockrel', + 'dbplus_xunlockrel', 'dbx_close', 'dbx_compare', 'dbx_connect', + 'dbx_error', 'dbx_query', 'dbx_sort', 'dcgettext', 'dcngettext', + 'debugger_off', 'debugger_on', 'decbin', 'dechex', 'decoct', 'define', + 'define_syslog_variables', 'defined', 'deg2rad', 'delete', 'dgettext', + 'die', 'dio_close', 'dio_fcntl', 'dio_open', 'dio_read', 'dio_seek', + 'dio_stat', 'dio_truncate', 'dio_write', 'dir', 'dirname', + 'disk_free_space', 'disk_total_space', 'diskfreespace', 'dl', 'dngettext', + 'domxml_add_root', 'domxml_attributes', 'domxml_children', + 'domxml_dumpmem', 'domxml_get_attribute', 'domxml_new_child', + 'domxml_new_xmldoc', 'domxml_node', 'domxml_node_set_content', + 'domxml_node_unlink_node', 'domxml_root', 'domxml_set_attribute', + 'domxml_version', 'dotnet_load', 'doubleval', 'each', 'easter_date', + 'easter_days', 'ebcdic2ascii', 'echo', 'empty', 'end', 'ereg', + 'ereg_replace', 'eregi', 'eregi_replace', 'error_log', 'error_reporting', + 'escapeshellarg', 'escapeshellcmd', 'eval', 'exec', 'exif_imagetype', + 'exif_read_data', 'exif_thumbnail', 'exit', 'exp', 'explode', 'expm1', + 'extension_loaded', 'extract', 'ezmlm_hash', 'fbsql_affected_rows', + 'fbsql_autocommit', 'fbsql_change_user', 'fbsql_close', 'fbsql_commit', + 'fbsql_connect', 'fbsql_create_blob', 'fbsql_create_clob', + 'fbsql_create_db', 'fbsql_data_seek', 'fbsql_database', + 'fbsql_database_password', 'fbsql_db_query', 'fbsql_db_status', + 'fbsql_drop_db', 'fbsql_errno', 'fbsql_error', 'fbsql_fetch_a', + 'fbsql_fetch_assoc', 'fbsql_fetch_field', 'fbsql_fetch_lengths', + 'fbsql_fetch_object', 'fbsql_fetch_row', 'fbsql_field_flags', + 'fbsql_field_len', 'fbsql_field_name', 'fbsql_field_seek', + 'fbsql_field_table', 'fbsql_field_type', 'fbsql_free_result', + 'fbsql_get_autostart_info', 'fbsql_hostname', 'fbsql_insert_id', + 'fbsql_list_dbs', 'fbsql_list_fields', 'fbsql_list_tables', + 'fbsql_next_result', 'fbsql_num_fields', 'fbsql_num_rows', + 'fbsql_password', 'fbsql_pconnect', 'fbsql_query', 'fbsql_read_blob', + 'fbsql_read_clob', 'fbsql_result', 'fbsql_rollback', 'fbsql_select_db', + 'fbsql_set_lob_mode', 'fbsql_set_transaction', 'fbsql_start_db', + 'fbsql_stop_db', 'fbsql_tablename', 'fbsql_username', 'fbsql_warnings', + 'fclose', 'fdf_add_template', 'fdf_close', 'fdf_create', 'fdf_get_file', + 'fdf_get_status', 'fdf_get_value', 'fdf_next_field_name', 'fdf_open', + 'fdf_save', 'fdf_set_ap', 'fdf_set_encoding', 'fdf_set_file', + 'fdf_set_flags', 'fdf_set_javascript_action', 'fdf_set_opt', + 'fdf_set_status', 'fdf_set_submit_form_action', 'fdf_set_value', 'feof', + 'fflush', 'fgetc', 'fgetcsv', 'fgets', 'fgetss', 'fgetwrapperdata', + 'file', 'file_exists', 'file_get_contents', 'fileatime', 'filectime', + 'filegroup', 'fileinode', 'filemtime', 'fileowner', 'fileperms', + 'filepro', 'filepro_fieldcount', 'filepro_fieldname', 'filepro_fieldtype', + 'filepro_fieldwidth', 'filepro_retrieve', 'filepro_rowcount', 'filesize', + 'filetype', 'floatval', 'flock', 'floor', 'flush', 'fopen', 'fpassthru', + 'fputs', 'fread', 'frenchtojd', 'fribidi_log2vis', 'fscanf', 'fseek', + 'fsockopen', 'fstat', 'ftell', 'ftok', 'ftp_cdup', 'ftp_chdir', + 'ftp_close', 'ftp_connect', 'ftp_delete', 'ftp_exec', 'ftp_fget', + 'ftp_fput', 'ftp_get', 'ftp_get_option', 'ftp_login', 'ftp_mdtm', + 'ftp_mkdir', 'ftp_nlist', 'ftp_pasv', 'ftp_put', 'ftp_pwd', 'ftp_quit', + 'ftp_rawlist', 'ftp_rename', 'ftp_rmdir', 'ftp_set_option', 'ftp_site', + 'ftp_size', 'ftp_systype', 'ftruncate', 'func_get_arg', 'func_get_args', + 'func_num_args', 'function_exists', 'fwrite', 'get_browser', + 'get_cfg_var', 'get_class', 'get_class_methods', 'get_class_vars', + 'get_current_user', 'get_declared_classes', 'get_defined_constants', + 'get_defined_functions', 'get_defined_vars', 'get_extension_funcs', + 'get_html_translation_table', 'get_include_p', 'get_included_files', + 'get_loaded_extensions', 'get_magic_quotes_gpc', + 'get_magic_quotes_runtime', 'get_meta_tags', 'get_object_vars', + 'get_parent_class', 'get_required_files', 'get_resource_type', + 'getallheaders', 'getcwd', 'getdate', 'getenv', 'gethostbyaddr', + 'gethostbyname', 'gethostbynamel', 'getimagesize', 'getlastmod', + 'getmxrr', 'getmygid', 'getmyinode', 'getmypid', 'getmyuid', + 'getprotobyname', 'getprotobynumber', 'getrandmax', 'getrusage', + 'getservbyname', 'getservbyport', 'gettext', 'gettimeofday', 'gettype', + 'global', 'gmdate', 'gmmktime', 'gmp_abs', 'gmp_add', 'gmp_and', + 'gmp_clrbit', 'gmp_cmp', 'gmp_com', 'gmp_div', 'gmp_div_q', 'gmp_div_qr', + 'gmp_div_r', 'gmp_divexact', 'gmp_fact', 'gmp_gcd', 'gmp_gcdext', + 'gmp_hamdist', 'gmp_init', 'gmp_intval', 'gmp_invert', 'gmp_jacobi', + 'gmp_legendre', 'gmp_mod', 'gmp_mul', 'gmp_neg', 'gmp_or', + 'gmp_perfect_square', 'gmp_popcount', 'gmp_pow', 'gmp_powm', + 'gmp_prob_prime', 'gmp_random', 'gmp_scan0', 'gmp_scan1', 'gmp_setbit', + 'gmp_sign', 'gmp_sqrt', 'gmp_sqrtrem', 'gmp_strval', 'gmp_sub', 'gmp_xor', + 'gmstrftime', 'gregoriantojd', 'gzclose', 'gzcompress', 'gzdeflate', + 'gzencode', 'gzeof', 'gzfile', 'gzgetc', 'gzgets', 'gzgetss', 'gzinflate', + 'gzopen', 'gzpassthru', 'gzputs', 'gzread', 'gzrewind', 'gzseek', 'gztell', + 'gzuncompress', 'gzwrite', 'header', 'headers_sent', 'hebrev', 'hebrevc', + 'hexdec', 'highlight_file', 'highlight_string', 'htmlentities', + 'htmlspecialchars', 'hw_array2objrec', 'hw_c', 'hw_children', + 'hw_childrenobj', 'hw_close', 'hw_connect', 'hw_connection_info', 'hw_cp', + 'hw_deleteobject', 'hw_docbyanchor', 'hw_docbyanchorobj', + 'hw_document_attributes', 'hw_document_bodytag', 'hw_document_content', + 'hw_document_setcontent', 'hw_document_size', 'hw_dummy', 'hw_edittext', + 'hw_error', 'hw_errormsg', 'hw_free_document', 'hw_getanchors', + 'hw_getanchorsobj', 'hw_getandlock', 'hw_getchildcoll', + 'hw_getchildcollobj', 'hw_getchilddoccoll', 'hw_getchilddoccollobj', + 'hw_getobject', 'hw_getobjectbyquery', 'hw_getobjectbyquerycoll', + 'hw_getobjectbyquerycollobj', 'hw_getobjectbyqueryobj', 'hw_getparents', + 'hw_getparentsobj', 'hw_getrellink', 'hw_getremote', + 'hw_getremotechildren', 'hw_getsrcbydestobj', 'hw_gettext', + 'hw_getusername', 'hw_identify', 'hw_incollections', 'hw_info', + 'hw_inscoll', 'hw_insdoc', 'hw_insertanchors', 'hw_insertdocument', + 'hw_insertobject', 'hw_mapid', 'hw_modifyobject', 'hw_mv', + 'hw_new_document', 'hw_objrec2array', 'hw_output_document', 'hw_pconnect', + 'hw_pipedocument', 'hw_root', 'hw_setlinkroot', 'hw_stat', 'hw_unlock', + 'hw_who', 'hypot', 'i', 'ibase_blob_add', 'ibase_blob_cancel', + 'ibase_blob_close', 'ibase_blob_create', 'ibase_blob_echo', + 'ibase_blob_get', 'ibase_blob_import', 'ibase_blob_info', + 'ibase_blob_open', 'ibase_close', 'ibase_commit', 'ibase_connect', + 'ibase_errmsg', 'ibase_execute', 'ibase_fetch_object', 'ibase_fetch_row', + 'ibase_field_info', 'ibase_free_query', 'ibase_free_result', + 'ibase_num_fields', 'ibase_pconnect', 'ibase_prepare', 'ibase_query', + 'ibase_rollback', 'ibase_timefmt', 'ibase_trans', 'icap_close', + 'icap_create_calendar', 'icap_delete_calendar', 'icap_delete_event', + 'icap_fetch_event', 'icap_list_alarms', 'icap_list_events', 'icap_open', + 'icap_rename_calendar', 'icap_reopen', 'icap_snooze', 'icap_store_event', + 'iconv', 'iconv_get_encoding', 'iconv_set_encoding', 'ifx_affected_rows', + 'ifx_blobinfile_mode', 'ifx_byteasvarchar', 'ifx_close', 'ifx_connect', + 'ifx_copy_blob', 'ifx_create_blob', 'ifx_create_char', 'ifx_do', + 'ifx_error', 'ifx_errormsg', 'ifx_fetch_row', 'ifx_fieldproperties', + 'ifx_fieldtypes', 'ifx_free_blob', 'ifx_free_char', 'ifx_free_result', + 'ifx_get_blob', 'ifx_get_char', 'ifx_getsqlca', 'ifx_htmltbl_result', + 'ifx_nullformat', 'ifx_num_fields', 'ifx_num_rows', 'ifx_pconnect', + 'ifx_prepare', 'ifx_query', 'ifx_textasvarchar', 'ifx_update_blob', + 'ifx_update_char', 'ifxus_close_slob', 'ifxus_create_slob', + 'ifxus_free_slob', 'ifxus_open_slob', 'ifxus_read_slob', + 'ifxus_seek_slob', 'ifxus_tell_slob', 'ifxus_write_slob', + 'ignore_user_abort', 'image2wbmp', 'imagealphablending', 'imageantialias', + 'imagearc', 'imagechar', 'imagecharup', 'imagecolorallocate', + 'imagecolorat', 'imagecolorclosest', 'imagecolorclosestalpha', + 'imagecolorclosesthwb', 'imagecolordeallocate', 'imagecolorexact', + 'imagecolorexactalpha', 'imagecolorresolve', 'imagecolorresolvealpha', + 'imagecolorset', 'imagecolorsforindex', 'imagecolorstotal', + 'imagecolortransparent', 'imagecopy', 'imagecopymerge', + 'imagecopymergegray', 'imagecopyresampled', 'imagecopyresized', + 'imagecreate', 'imagecreatefromgd', 'imagecreatefromgd2', + 'imagecreatefromgd2part', 'imagecreatefromgif', 'imagecreatefromjpeg', + 'imagecreatefrompng', 'imagecreatefromstring', 'imagecreatefromwbmp', + 'imagecreatefromxbm', 'imagecreatefromxpm', 'imagecreatetruecolor', + 'imagedashedline', 'imagedestroy', 'imageellipse', 'imagefill', + 'imagefilledarc', 'imagefilledellipse', 'imagefilledpolygon', + 'imagefilledrectangle', 'imagefilltoborder', 'imagefontheight', + 'imagefontwidth', 'imageftbbox', 'imagefttext', 'imagegammacorrect', + 'imagegd', 'imagegd2', 'imagegif', 'imageinterlace', 'imagejpeg', + 'imageline', 'imageloadfont', 'imagepalettecopy', 'imagepng', + 'imagepolygon', 'imagepsbbox', 'imagepsencodefont', 'imagepsextendfont', + 'imagepsfreefont', 'imagepsloadfont', 'imagepsslantfont', 'imagepstext', + 'imagerectangle', 'imagesetbrush', 'imagesetpixel', 'imagesetstyle', + 'imagesetthickness', 'imagesettile', 'imagestring', 'imagestringup', + 'imagesx', 'imagesy', 'imagetruecolortopalette', 'imagettfbbox', + 'imagettftext', 'imagetypes', 'imagewbmp', 'imap_8bit', 'imap_append', + 'imap_base64', 'imap_binary', 'imap_body', 'imap_bodystruct', + 'imap_check', 'imap_clearflag_full', 'imap_close', 'imap_createmailbox', + 'imap_delete', 'imap_deletemailbox', 'imap_errors', 'imap_expunge', + 'imap_fetch_overview', 'imap_fetchbody', 'imap_fetchheader', + 'imap_fetchstructure', 'imap_get_quota', 'imap_getmailboxes', + 'imap_getsubscribed', 'imap_header', 'imap_headerinfo', 'imap_headers', + 'imap_last_error', 'imap_listmailbox', 'imap_listsubscribed', 'imap_mail', + 'imap_mail_compose', 'imap_mail_copy', 'imap_mail_move', + 'imap_mailboxmsginfo', 'imap_mime_header_decode', 'imap_msgno', + 'imap_num_msg', 'imap_num_recent', 'imap_open', 'imap_ping', 'imap_popen', + 'imap_qprint', 'imap_renamemailbox', 'imap_reopen', + 'imap_rfc822_parse_adrlist', 'imap_rfc822_parse_headers', + 'imap_rfc822_write_address', 'imap_scanmailbox', 'imap_search', + 'imap_set_quota', 'imap_setacl', 'imap_setflag_full', 'imap_sort', + 'imap_status', 'imap_subscribe', 'imap_thread', 'imap_uid', + 'imap_undelete', 'imap_unsubscribe', 'imap_utf7_decode', + 'imap_utf7_encode', 'imap_utf8', 'implode', 'import_request_variables', + 'in_array', 'include', 'include_once', 'ingres_autocommit', + 'ingres_close', 'ingres_commit', 'ingres_connect', 'ingres_fetch_array', + 'ingres_fetch_object', 'ingres_fetch_row', 'ingres_field_length', + 'ingres_field_name', 'ingres_field_nullable', 'ingres_field_precision', + 'ingres_field_scale', 'ingres_field_type', 'ingres_num_fields', + 'ingres_num_rows', 'ingres_pconnect', 'ingres_query', 'ingres_rollback', + 'ini_alter', 'ini_get', 'ini_get_all', 'ini_restore', 'ini_set', 'intval', + 'ip2long', 'iptcembed', 'iptcparse', 'ircg_channel_mode', + 'ircg_disconnect', 'ircg_fetch_error_msg', 'ircg_get_username', + 'ircg_html_encode', 'ircg_ignore_add', 'ircg_ignore_del', + 'ircg_is_conn_alive', 'ircg_join', 'ircg_kick', + 'ircg_lookup_format_messages', 'ircg_msg', 'ircg_nick', + 'ircg_nickname_escape', 'ircg_nickname_unescape', 'ircg_notice', + 'ircg_part', 'ircg_pconnect', 'ircg_register_format_messages', + 'ircg_set_current', 'ircg_set_file', 'ircg_topic', 'ircg_whois', 'is_a', + 'is_array', 'is_bool', 'is_callable', 'is_dir', 'is_double', + 'is_executable', 'is_file', 'is_finite', 'is_float', 'is_infinite', + 'is_int', 'is_integer', 'is_link', 'is_long', 'is_nan', 'is_null', + 'is_numeric', 'is_object', 'is_readable', 'is_real', 'is_resource', + 'is_scalar', 'is_string', 'is_subclass_of', 'is_uploaded_file', + 'is_writable', 'is_writeable', 'isset', 'java_last_exception_clear', + 'java_last_exception_get', 'jddayofweek', 'jdmonthname', 'jdtofrench', + 'jdtogregorian', 'jdtojewish', 'jdtojulian', 'jdtounix', 'jewishtojd', + 'join', 'jpeg2wbmp', 'juliantojd', 'key', 'krsort', 'ksort', 'lcg_value', + 'ldap_8859_to_t61', 'ldap_add', 'ldap_bind', 'ldap_close', 'ldap_compare', + 'ldap_connect', 'ldap_count_entries', 'ldap_delete', 'ldap_dn2ufn', + 'ldap_err2str', 'ldap_errno', 'ldap_error', 'ldap_explode_dn', + 'ldap_first_attribute', 'ldap_first_entry', 'ldap_first_reference', + 'ldap_free_result', 'ldap_get_attributes', 'ldap_get_dn', + 'ldap_get_entries', 'ldap_get_option', 'ldap_get_values', + 'ldap_get_values_len', 'ldap_list', 'ldap_mod_add', 'ldap_mod_del', + 'ldap_mod_replace', 'ldap_modify', 'ldap_next_attribute', + 'ldap_next_entry', 'ldap_next_reference', 'ldap_parse_reference', + 'ldap_parse_result', 'ldap_read', 'ldap_rename', 'ldap_search', + 'ldap_set_option', 'ldap_set_rebind_proc', 'ldap_sort', 'ldap_start_tls', + 'ldap_t61_to_8859', 'ldap_unbind', 'leak', 'levenshtein', 'link', + 'linkinfo', 'list', 'localeconv', 'localtime', 'log', 'log10', 'log1p', + 'long2ip', 'lstat', 'ltrim', 'mail', + 'mailparse_determine_best_xfer_encoding', 'mailparse_msg_create', + 'mailparse_msg_extract_part', 'mailparse_msg_extract_part_file', + 'mailparse_msg_free', 'mailparse_msg_get_part', + 'mailparse_msg_get_part_data', 'mailparse_msg_get_structure', + 'mailparse_msg_parse', 'mailparse_msg_parse_file', + 'mailparse_rfc822_parse_addresses', 'mailparse_stream_encode', + 'mailparse_uudecode_all', 'max', 'mb_c', 'mb_convert_kana', + 'mb_convert_variables', 'mb_decode_mimeheader', 'mb_decode_numericentity', + 'mb_detect_encoding', 'mb_detect_order', 'mb_encode_mimeheader', + 'mb_encode_numericentity', 'mb_ereg', 'mb_ereg_match', 'mb_ereg_replace', + 'mb_ereg_search', 'mb_ereg_search_getpos', 'mb_ereg_search_getregs', + 'mb_ereg_search_init', 'mb_ereg_search_pos', 'mb_ereg_search_regs', + 'mb_ereg_search_setpos', 'mb_eregi', 'mb_eregi_replace', 'mb_get_info', + 'mb_http_input', 'mb_http_output', 'mb_internal_encoding', 'mb_language', + 'mb_output_handler', 'mb_parse_str', 'mb_preferred_mime_name', + 'mb_regex_encoding', 'mb_send_mail', 'mb_split', 'mb_strcut', + 'mb_strimwidth', 'mb_strlen', 'mb_strpos', 'mb_strrpos', 'mb_strwidth', + 'mb_substitute_character', 'mb_substr', 'mcal_append_event', 'mcal_close', + 'mcal_create_calendar', 'mcal_date_compare', 'mcal_date_valid', + 'mcal_day_of_week', 'mcal_day_of_year', 'mcal_days_in_month', + 'mcal_delete_calendar', 'mcal_delete_event', 'mcal_event_add_attribute', + 'mcal_event_init', 'mcal_event_set_alarm', 'mcal_event_set_category', + 'mcal_event_set_class', 'mcal_event_set_description', + 'mcal_event_set_end', 'mcal_event_set_recur_daily', + 'mcal_event_set_recur_monthly_mday', 'mcal_event_set_recur_monthly_wday', + 'mcal_event_set_recur_none', 'mcal_event_set_recur_weekly', + 'mcal_event_set_recur_yearly', 'mcal_event_set_start', + 'mcal_event_set_title', 'mcal_expunge', 'mcal_fetch_current_stream_event', + 'mcal_fetch_event', 'mcal_is_leap_year', 'mcal_list_alarms', + 'mcal_list_events', 'mcal_next_recurrence', 'mcal_open', 'mcal_popen', + 'mcal_rename_calendar', 'mcal_reopen', 'mcal_snooze', 'mcal_store_event', + 'mcal_time_valid', 'mcal_week_of_year', 'mcrypt_cbc', 'mcrypt_cfb', + 'mcrypt_create_iv', 'mcrypt_decrypt', 'mcrypt_ecb', + 'mcrypt_enc_get_algorithms_name', 'mcrypt_enc_get_block_size', + 'mcrypt_enc_get_iv_size', 'mcrypt_enc_get_key_size', + 'mcrypt_enc_get_modes_name', 'mcrypt_enc_get_supported_key_sizes', + 'mcrypt_enc_is_block_algorithm', 'mcrypt_enc_is_block_algorithm_mode', + 'mcrypt_enc_is_block_mode', 'mcrypt_enc_self_test', 'mcrypt_encrypt', + 'mcrypt_generic', 'mcrypt_generic_deinit', 'mcrypt_generic_end', + 'mcrypt_generic_init', 'mcrypt_get_block_size', 'mcrypt_get_cipher_name', + 'mcrypt_get_iv_size', 'mcrypt_get_key_size', 'mcrypt_list_algorithms', + 'mcrypt_list_modes', 'mcrypt_module_close', + 'mcrypt_module_get_algo_block_size', 'mcrypt_module_get_algo_key_size', + 'mcrypt_module_get_supported_key_sizes', + 'mcrypt_module_is_block_algorithm', + 'mcrypt_module_is_block_algorithm_mode', 'mcrypt_module_is_block_mode', + 'mcrypt_module_open', 'mcrypt_module_self_test', 'mcrypt_ofb', 'md5', + 'md5_file', 'mdecrypt_generic', 'metaphone', 'method_exists', 'mhash', + 'mhash_count', 'mhash_get_block_size', 'mhash_get_hash_name', + 'mhash_keygen_s2k', 'microtime', 'min', 'ming_setcubicthreshold', + 'ming_setscale', 'ming_useswfversion', 'mkdir', 'mktime', + 'move_uploaded_file', 'msession_connect', 'msession_count', + 'msession_create', 'msession_destroy', 'msession_disconnect', + 'msession_find', 'msession_get', 'msession_get_array', 'msession_getdata', + 'msession_inc', 'msession_list', 'msession_listvar', 'msession_lock', + 'msession_plugin', 'msession_randstr', 'msession_set', + 'msession_set_array', 'msession_setdata', 'msession_timeout', + 'msession_uniq', 'msession_unlock', 'msql', 'msql_affected_rows', + 'msql_close', 'msql_connect', 'msql_create_db', 'msql_createdb', + 'msql_data_seek', 'msql_dbname', 'msql_drop_db', 'msql_dropdb', + 'msql_error', 'msql_fetch_array', 'msql_fetch_field', 'msql_fetch_object', + 'msql_fetch_row', 'msql_field_seek', 'msql_fieldflags', 'msql_fieldlen', + 'msql_fieldname', 'msql_fieldtable', 'msql_fieldtype', 'msql_free_result', + 'msql_freeresult', 'msql_list_dbs', 'msql_list_fields', 'msql_list_tables', + 'msql_listdbs', 'msql_listfields', 'msql_listtables', 'msql_num_fields', + 'msql_num_rows', 'msql_numfields', 'msql_numrows', 'msql_pconnect', + 'msql_query', 'msql_regcase', 'msql_result', 'msql_select_db', + 'msql_selectdb', 'msql_tablename', 'mssql_bind', 'mssql_close', + 'mssql_connect', 'mssql_data_seek', 'mssql_execute', 'mssql_fetch_array', + 'mssql_fetch_assoc', 'mssql_fetch_batch', 'mssql_fetch_field', + 'mssql_fetch_object', 'mssql_fetch_row', 'mssql_field_length', + 'mssql_field_name', 'mssql_field_seek', 'mssql_field_type', + 'mssql_free_result', 'mssql_get_last_message', 'mssql_guid_string', + 'mssql_init', 'mssql_min_error_severity', 'mssql_min_message_severity', + 'mssql_next_result', 'mssql_num_fields', 'mssql_num_rows', + 'mssql_pconnect', 'mssql_query', 'mssql_result', 'mssql_rows_affected', + 'mssql_select_db', 'mt_getrandmax', 'mt_rand', 'mt_srand', 'muscat_close', + 'muscat_get', 'muscat_give', 'muscat_setup', 'muscat_setup_net', + 'mysql_affected_rows', 'mysql_change_user', 'mysql_character_set_name', + 'mysql_close', 'mysql_connect', 'mysql_create_db', 'mysql_data_seek', + 'mysql_db_name', 'mysql_db_query', 'mysql_drop_db', 'mysql_errno', + 'mysql_error', 'mysql_escape_string', 'mysql_fetch_array', + 'mysql_fetch_assoc', 'mysql_fetch_field', 'mysql_fetch_lengths', + 'mysql_fetch_object', 'mysql_fetch_row', 'mysql_field_flags', + 'mysql_field_len', 'mysql_field_name', 'mysql_field_seek', + 'mysql_field_table', 'mysql_field_type', 'mysql_free_result', + 'mysql_get_client_info', 'mysql_get_host_info', 'mysql_get_proto_info', + 'mysql_get_server_info', 'mysql_info', 'mysql_insert_id', + 'mysql_list_dbs', 'mysql_list_fields', 'mysql_list_processes', + 'mysql_list_tables', 'mysql_num_fields', 'mysql_num_rows', + 'mysql_pconnect', 'mysql_ping', 'mysql_query', 'mysql_real_escape_string', + 'mysql_result', 'mysql_select_db', 'mysql_stat', 'mysql_tablename', + 'mysql_thread_id', 'mysql_unbuffered_query', 'natcasesort', 'natsort', + 'ncur', 'ncurses_addch', 'ncurses_addchnstr', 'ncurses_addchstr', + 'ncurses_addnstr', 'ncurses_addstr', 'ncurses_assume_default_colors', + 'ncurses_attroff', 'ncurses_attron', 'ncurses_attrset', + 'ncurses_baudrate', 'ncurses_beep', 'ncurses_bkgd', 'ncurses_bkgdset', + 'ncurses_border', 'ncurses_can_change_color', 'ncurses_cbreak', + 'ncurses_clear', 'ncurses_clrtobot', 'ncurses_clrtoeol', + 'ncurses_color_set', 'ncurses_curs_set', 'ncurses_def_prog_mode', + 'ncurses_def_shell_mode', 'ncurses_define_key', 'ncurses_delay_output', + 'ncurses_delch', 'ncurses_deleteln', 'ncurses_delwin', 'ncurses_doupdate', + 'ncurses_echo', 'ncurses_echochar', 'ncurses_end', 'ncurses_erase', + 'ncurses_erasechar', 'ncurses_filter', 'ncurses_flash', + 'ncurses_flushinp', 'ncurses_getch', 'ncurses_getmouse', + 'ncurses_halfdelay', 'ncurses_has_ic', 'ncurses_has_il', + 'ncurses_has_key', 'ncurses_hline', 'ncurses_inch', 'ncurses_init', + 'ncurses_init_color', 'ncurses_init_pair', 'ncurses_insch', + 'ncurses_insdelln', 'ncurses_insertln', 'ncurses_insstr', 'ncurses_instr', + 'ncurses_isendwin', 'ncurses_keyok', 'ncurses_killchar', + 'ncurses_longname', 'ncurses_mouseinterval', 'ncurses_mousemask', + 'ncurses_move', 'ncurses_mvaddch', 'ncurses_mvaddchnstr', + 'ncurses_mvaddchstr', 'ncurses_mvaddnstr', 'ncurses_mvaddstr', + 'ncurses_mvcur', 'ncurses_mvdelch', 'ncurses_mvgetch', 'ncurses_mvhline', + 'ncurses_mvinch', 'ncurses_mvvline', 'ncurses_mvwaddstr', 'ncurses_napms', + 'ncurses_newwin', 'ncurses_nl', 'ncurses_nocbreak', 'ncurses_noecho', + 'ncurses_nonl', 'ncurses_noqiflush', 'ncurses_noraw', 'ncurses_putp', + 'ncurses_qiflush', 'ncurses_raw', 'ncurses_refresh', 'ncurses_resetty', + 'ncurses_savetty', 'ncurses_scr_dump', 'ncurses_scr_init', + 'ncurses_scr_restore', 'ncurses_scr_set', 'ncurses_scrl', + 'ncurses_slk_attr', 'ncurses_slk_attroff', 'ncurses_slk_attron', + 'ncurses_slk_attrset', 'ncurses_slk_clear', 'ncurses_slk_color', + 'ncurses_slk_init', 'ncurses_slk_noutrefresh', 'ncurses_slk_refresh', + 'ncurses_slk_restore', 'ncurses_slk_touch', 'ncurses_standend', + 'ncurses_standout', 'ncurses_start_color', 'ncurses_termattrs', + 'ncurses_termname', 'ncurses_timeout', 'ncurses_typeahead', + 'ncurses_ungetch', 'ncurses_ungetmouse', 'ncurses_use_default_colors', + 'ncurses_use_env', 'ncurses_use_extended_names', 'ncurses_vidattr', + 'ncurses_vline', 'ncurses_wrefresh', 'next', 'ngettext', 'nl2br', + 'nl_langinfo', 'notes_body', 'notes_copy_db', 'notes_create_db', + 'notes_create_note', 'notes_drop_db', 'notes_find_note', + 'notes_header_info', 'notes_list_msgs', 'notes_mark_read', + 'notes_mark_unread', 'notes_nav_create', 'notes_search', 'notes_unread', + 'notes_version', 'number_format', 'ob_clean', 'ob_end_clean', + 'ob_end_flush', 'ob_flush', 'ob_get_contents', 'ob_get_length', + 'ob_get_level', 'ob_gzhandler', 'ob_iconv_handler', 'ob_implicit_flush', + 'ob_start', 'ocibindbyname', 'ocicancel', 'ocicollappend', + 'ocicollassign', 'ocicollassignelem', 'ocicollgetelem', 'ocicollmax', + 'ocicollsize', 'ocicolltrim', 'ocicolumnisnull', 'ocicolumnname', + 'ocicolumnprecision', 'ocicolumnscale', 'ocicolumnsize', 'ocicolumntype', + 'ocicolumntyperaw', 'ocicommit', 'ocidefinebyname', 'ocierror', + 'ociexecute', 'ocifetch', 'ocifetchinto', 'ocifetchstatement', + 'ocifreecollection', 'ocifreecursor', 'ocifreedesc', 'ocifreestatement', + 'ociinternaldebug', 'ociloadlob', 'ocilogoff', 'ocilogon', + 'ocinewcollection', 'ocinewcursor', 'ocinewdescriptor', 'ocinlogon', + 'ocinumcols', 'ociparse', 'ociplogon', 'ociresult', 'ocirollback', + 'ocirowcount', 'ocisavelob', 'ocisavelobfile', 'ociserverversion', + 'ocisetprefetch', 'ocistatementtype', 'ociwritelobtofile', 'octdec', + 'odbc_autocommit', 'odbc_binmode', 'odbc_close', 'odbc_close_all', + 'odbc_columnprivileges', 'odbc_columns', 'odbc_commit', 'odbc_connect', + 'odbc_cursor', 'odbc_do', 'odbc_error', 'odbc_errormsg', 'odbc_exec', + 'odbc_execute', 'odbc_fetch_array', 'odbc_fetch_into', + 'odbc_fetch_object', 'odbc_fetch_row', 'odbc_field_len', + 'odbc_field_name', 'odbc_field_num', 'odbc_field_precision', + 'odbc_field_scale', 'odbc_field_type', 'odbc_foreignkeys', + 'odbc_free_result', 'odbc_gettypeinfo', 'odbc_longreadlen', + 'odbc_next_result', 'odbc_num_fields', 'odbc_num_rows', 'odbc_pconnect', + 'odbc_prepare', 'odbc_primarykeys', 'odbc_procedurecolumns', + 'odbc_procedures', 'odbc_result', 'odbc_result_all', 'odbc_rollback', + 'odbc_setoption', 'odbc_specialcolumns', 'odbc_statistics', + 'odbc_tableprivileges', 'odbc_tables', 'opendir', 'openlog', + 'openssl_csr_export', 'openssl_csr_export_to_file', 'openssl_csr_new', + 'openssl_csr_sign', 'openssl_error_string', 'openssl_free_key', + 'openssl_get_privatekey', 'openssl_get_publickey', 'openssl_open', + 'openssl_pkcs7_decrypt', 'openssl_pkcs7_encrypt', 'openssl_pkcs7_sign', + 'openssl_pkcs7_verify', 'openssl_pkey_export', + 'openssl_pkey_export_to_file', 'openssl_pkey_new', + 'openssl_private_decrypt', 'openssl_private_encrypt', + 'openssl_public_decrypt', 'openssl_public_encrypt', 'openssl_seal', + 'openssl_sign', 'openssl_verify', 'openssl_x509_check_private_key', + 'openssl_x509_checkpurpose', 'openssl_x509_export', + 'openssl_x509_export_to_file', 'openssl_x509_free', 'openssl_x509_parse', + 'openssl_x509_read', 'ora_bind', 'ora_close', 'ora_columnname', + 'ora_columnsize', 'ora_columntype', 'ora_commit', 'ora_commitoff', + 'ora_commiton', 'ora_do', 'ora_error', 'ora_errorcode', 'ora_exec', + 'ora_fetch', 'ora_fetch_into', 'ora_getcolumn', 'ora_logoff', 'ora_logon', + 'ora_numcols', 'ora_numrows', 'ora_open', 'ora_parse', 'ora_plogon', + 'ora_rollback', 'ord', 'overload', 'ovrimos_close', 'ovrimos_commit', + 'ovrimos_connect', 'ovrimos_cursor', 'ovrimos_exec', 'ovrimos_execute', + 'ovrimos_fetch_into', 'ovrimos_fetch_row', 'ovrimos_field_len', + 'ovrimos_field_name', 'ovrimos_field_num', 'ovrimos_field_type', + 'ovrimos_free_result', 'ovrimos_longreadlen', 'ovrimos_num_fields', + 'ovrimos_num_rows', 'ovrimos_prepare', 'ovrimos_result', + 'ovrimos_result_all', 'ovrimos_rollback', 'pack', 'parse_ini_file', + 'parse_str', 'parse_url', 'passthru', 'pathinfo', 'pclose', 'pcntl_exec', + 'pcntl_fork', 'pcntl_signal', 'pcntl_waitpid', 'pcntl_wexitstatus', + 'pcntl_wifexited', 'pcntl_wifsignaled', 'pcntl_wifstopped', + 'pcntl_wstopsig', 'pcntl_wtermsig', 'pdf_add_annotation', + 'pdf_add_bookmark', 'pdf_add_launchlink', 'pdf_add_locallink', + 'pdf_add_note', 'pdf_add_outline', 'pdf_add_pdflink', 'pdf_add_thumbnail', + 'pdf_add_weblink', 'pdf_arc', 'pdf_arcn', 'pdf_attach_file', + 'pdf_begin_page', 'pdf_begin_pattern', 'pdf_begin_template', 'pdf_circle', + 'pdf_clip', 'pdf_close', 'pdf_close_image', 'pdf_close_pdi', + 'pdf_close_pdi_page', 'pdf_closepath', 'pdf_closepath_fill_stroke', + 'pdf_closepath_stroke', 'pdf_concat', 'pdf_continue_text', 'pdf_curveto', + 'pdf_delete', 'pdf_end_page', 'pdf_end_pattern', 'pdf_end_template', + 'pdf_endpath', 'pdf_fill', 'pdf_fill_stroke', 'pdf_findfont', + 'pdf_get_buffer', 'pdf_get_font', 'pdf_get_fontname', 'pdf_get_fontsize', + 'pdf_get_image_height', 'pdf_get_image_width', 'pdf_get_majorversion', + 'pdf_get_minorversion', 'pdf_get_parameter', 'pdf_get_pdi_value', + 'pdf_get_value', 'pdf_initgraphics', 'pdf_lineto', 'pdf_makespotcolor', + 'pdf_moveto', 'pdf_new', 'pdf_open', 'pdf_open_ccitt', 'pdf_open_file', + 'pdf_open_gif', 'pdf_open_image', 'pdf_open_image_file', 'pdf_open_jpeg', + 'pdf_open_memory_image', 'pdf_open_pdi', 'pdf_open_pdi_page', + 'pdf_open_png', 'pdf_open_tiff', 'pdf_place_image', 'pdf_place_pdi_page', + 'pdf_rect', 'pdf_restore', 'pdf_rotate', 'pdf_save', 'pdf_scale', + 'pdf_set_border_color', 'pdf_set_border_dash', 'pdf_set_border_style', + 'pdf_set_char_spacing', 'pdf_set_duration', 'pdf_set_font', + 'pdf_set_horiz_scaling', 'pdf_set_info', 'pdf_set_info_author', + 'pdf_set_info_creator', 'pdf_set_info_keywords', 'pdf_set_info_subject', + 'pdf_set_info_title', 'pdf_set_leading', 'pdf_set_parameter', + 'pdf_set_text_pos', 'pdf_set_text_rendering', 'pdf_set_text_rise', + 'pdf_set_transition', 'pdf_set_value', 'pdf_set_word_spacing', + 'pdf_setcolor', 'pdf_setdash', 'pdf_setflat', 'pdf_setfont', + 'pdf_setgray', 'pdf_setgray_fill', 'pdf_setgray_stroke', 'pdf_setlinecap', + 'pdf_setlinejoin', 'pdf_setlinewidth', 'pdf_setmatrix', + 'pdf_setmiterlimit', 'pdf_setpolydash', 'pdf_setrgbcolor', + 'pdf_setrgbcolor_fill', 'pdf_setrgbcolor_stroke', 'pdf_show', + 'pdf_show_boxed', 'pdf_show_xy', 'pdf_skew', 'pdf_stringwidth', + 'pdf_stroke', 'pdf_translate', 'pfpro_cleanup', 'pfpro_init', + 'pfpro_process', 'pfpro_process_raw', 'pfpro_version', 'pfsockopen', + 'pg_affected_rows', 'pg_cancel_query', 'pg_client_encoding', 'pg_close', + 'pg_connect', 'pg_connection_busy', 'pg_connection_reset', + 'pg_connection_status', 'pg_copy_from', 'pg_copy_to', 'pg_dbname', + 'pg_end_copy', 'pg_escape_bytea', 'pg_escape_string', 'pg_fetch_array', + 'pg_fetch_object', 'pg_fetch_result', 'pg_fetch_row', 'pg_field_is_null', + 'pg_field_name', 'pg_field_num', 'pg_field_prtlen', 'pg_field_size', + 'pg_field_type', 'pg_free_result', 'pg_get_result', 'pg_host', + 'pg_last_error', 'pg_last_notice', 'pg_last_oid', 'pg_lo_close', + 'pg_lo_create', 'pg_lo_export', 'pg_lo_import', 'pg_lo_open', + 'pg_lo_read', 'pg_lo_seek', 'pg_lo_tell', 'pg_lo_unlink', 'pg_lo_write', + 'pg_num_fields', 'pg_num_rows', 'pg_options', 'pg_pconnect', 'pg_port', + 'pg_put_line', 'pg_query', 'pg_result_error', 'pg_result_status', + 'pg_send_query', 'pg_set_client_encoding', 'pg_trace', 'pg_tty', + 'pg_untrace', 'php_logo_guid', 'php_sapi_name', 'php_uname', 'phpcredits', + 'phpinfo', 'phpversion', 'pi', 'png2wbmp', 'popen', 'pos', 'posix_ctermid', + 'posix_getcwd', 'posix_getegid', 'posix_geteuid', 'posix_getgid', + 'posix_getgrgid', 'posix_getgrnam', 'posix_getgroups', 'posix_getlogin', + 'posix_getpgid', 'posix_getpgrp', 'posix_getpid', 'posix_getppid', + 'posix_getpwnam', 'posix_getpwuid', 'posix_getrlimit', 'posix_getsid', + 'posix_getuid', 'posix_isatty', 'posix_kill', 'posix_mkfifo', + 'posix_setegid', 'posix_seteuid', 'posix_setgid', 'posix_setpgid', + 'posix_setsid', 'posix_setuid', 'posix_times', 'posix_ttyname', + 'posix_uname', 'pow', 'preg_grep', 'preg_match', 'preg_match_all', + 'preg_quote', 'preg_replace', 'preg_replace_callback', 'preg_split', + 'prev', 'print', 'print_r', 'printer_abort', 'printer_close', + 'printer_create_brush', 'printer_create_dc', 'printer_create_font', + 'printer_create_pen', 'printer_delete_brush', 'printer_delete_dc', + 'printer_delete_font', 'printer_delete_pen', 'printer_draw_bmp', + 'printer_draw_chord', 'printer_draw_elipse', 'printer_draw_line', + 'printer_draw_pie', 'printer_draw_rectangle', 'printer_draw_roundrect', + 'printer_draw_text', 'printer_end_doc', 'printer_end_page', + 'printer_get_option', 'printer_list', 'printer_logical_fontheight', + 'printer_open', 'printer_select_brush', 'printer_select_font', + 'printer_select_pen', 'printer_set_option', 'printer_start_doc', + 'printer_start_page', 'printer_write', 'printf', 'pspell_add_to_personal', + 'pspell_add_to_session', 'pspell_check', 'pspell_clear_session', + 'pspell_config_create', 'pspell_config_ignore', 'pspell_config_mode', + 'pspell_config_personal', 'pspell_config_repl', + 'pspell_config_runtogether', 'pspell_config_save_repl', 'pspell_new', + 'pspell_new_config', 'pspell_new_personal', 'pspell_save_wordlist', + 'pspell_store_replacement', 'pspell_suggest', 'putenv', 'qdom_error', + 'qdom_tree', 'quoted_printable_decode', 'quotemeta', 'rad2deg', 'rand', + 'range', 'rawurldecode', 'rawurlencode', 'read_exif_data', 'readdir', + 'readfile', 'readgzfile', 'readline', 'readline_add_history', + 'readline_clear_history', 'readline_completion_function', 'readline_info', + 'readline_list_history', 'readline_read_history', 'readline_write_history', + 'readlink', 'realpath', 'recode', 'recode_file', 'recode_string', + 'register_shutdown_function', 'register_tick_function', 'rename', + 'require', 'require_once', 'reset', 'restore_error_handler', + 'restore_include_path', 'rewind', 'rewinddir', 'rmdir', 'round', 'rsort', + 'rtrim', 'sem_acquire', 'sem_get', 'sem_release', 'sem_remove', + 'serialize', 'sesam_affected_rows', 'sesam_commit', 'sesam_connect', + 'sesam_diagnostic', 'sesam_disconnect', 'sesam_errormsg', 'sesam_execimm', + 'sesam_fetch_array', 'sesam_fetch_result', 'sesam_fetch_row', + 'sesam_field_array', 'sesam_field_name', 'sesam_free_result', + 'sesam_num_fields', 'sesam_query', 'sesam_rollback', 'sesam_seek_row', + 'sesam_settransaction', 'session_cache_expire', 'session_cache_limiter', + 'session_decode', 'session_destroy', 'session_encode', + 'session_get_cookie_params', 'session_id', 'session_is_registered', + 'session_module_name', 'session_name', 'session_register', + 'session_save_path', 'session_set_cookie_params', + 'session_set_save_handler', 'session_start', 'session_unregister', + 'session_unset', 'session_write_close', 'set_error_handler', + 'set_file_buffer', 'set_include_path', 'set_magic_quotes_runtime', + 'set_time_limit', 'setcookie', 'setlocale', 'settype', 'shell_exec', + 'shm_attach', 'shm_detach', 'shm_get_var', 'shm_put_var', 'shm_remove', + 'shm_remove_var', 'shmop_close', 'shmop_delete', 'shmop_open', + 'shmop_read', 'shmop_size', 'shmop_write', 'show_source', 'shuffle', + 'similar_text', 'sin', 'sinh', 'sizeof', 'sleep', 'snmp_get_quick_print', + 'snmp_set_quick_print', 'snmpget', 'snmprealwalk', 'snmpset', 'snmpwalk', + 'snmpwalkoid', 'socket_accept', 'socket_bind', 'socket_close', + 'socket_connect', 'socket_create', 'socket_create_listen', + 'socket_create_pair', 'socket_fd_alloc', 'socket_fd_clear', + 'socket_fd_free', 'socket_fd_isset', 'socket_fd_set', 'socket_fd_zero', + 'socket_get_status', 'socket_getopt', 'socket_getpeername', + 'socket_getsockname', 'socket_iovec_add', 'socket_iovec_alloc', + 'socket_iovec_delete', 'socket_iovec_fetch', 'socket_iovec_free', + 'socket_iovec_set', 'socket_last_error', 'socket_listen', 'socket_read', + 'socket_readv', 'socket_recv', 'socket_recvfrom', 'socket_recvmsg', + 'socket_select', 'socket_send', 'socket_sendmsg', 'socket_sendto', + 'socket_set_blocking', 'socket_set_nonblock', 'socket_set_timeout', + 'socket_setopt', 'socket_shutdown', 'socket_strerror', 'socket_write', + 'socket_writev', 'sort', 'soundex', 'split', 'spliti', 'sprintf', + 'sql_regcase', 'sqrt', 'srand', 'sscanf', 'stat', 'str_pad', 'str_repeat', + 'str_replace', 'str_rot13', 'strcasecmp', 'strchr', 'strcmp', 'strcoll', + 'strcspn', 'strftime', 'strip_tags', 'stripcslashes', 'stripslashes', + 'stristr', 'strlen', 'strnatcasecmp', 'strnatcmp', 'strncasecmp', + 'strncmp', 'strpos', 'strrchr', 'strrev', 'strrpos', 'strspn', 'strstr', + 'strtok', 'strtolower', 'strtotime', 'strtoupper', 'strtr', 'strval', + 'substr', 'substr_count', 'substr_replace', 'swf_actiongeturl', + 'swf_actiongotoframe', 'swf_actiongotolabel', 'swf_actionnextframe', + 'swf_actionplay', 'swf_actionprevframe', 'swf_actionsettarget', + 'swf_actionstop', 'swf_actiontogglequality', 'swf_actionwaitforframe', + 'swf_addbuttonrecord', 'swf_addcolor', 'swf_closefile', + 'swf_definebitmap', 'swf_definefont', 'swf_defineline', 'swf_definepoly', + 'swf_definerect', 'swf_definetext', 'swf_endbutton', 'swf_enddoaction', + 'swf_endshape', 'swf_endsymbol', 'swf_fontsize', 'swf_fontslant', + 'swf_fonttracking', 'swf_getbitmapinfo', 'swf_getfontinfo', + 'swf_getframe', 'swf_labelframe', 'swf_lookat', 'swf_modifyobject', + 'swf_mulcolor', 'swf_nextid', 'swf_oncondition', 'swf_openfile', + 'swf_ortho', 'swf_ortho2', 'swf_perspective', 'swf_placeobject', + 'swf_polarview', 'swf_popmatrix', 'swf_posround', 'swf_pushmatrix', + 'swf_removeobject', 'swf_rotate', 'swf_scale', 'swf_setfont', + 'swf_setframe', 'swf_shapearc', 'swf_shapecurveto', 'swf_shapecurveto3', + 'swf_shapefillbitmapclip', 'swf_shapefillbitmaptile', 'swf_shapefilloff', + 'swf_shapefillsolid', 'swf_shapelinesolid', 'swf_shapelineto', + 'swf_shapemoveto', 'swf_showframe', 'swf_startbutton', + 'swf_startdoaction', 'swf_startshape', 'swf_startsymbol', 'swf_textwidth', + 'swf_translate', 'swf_viewport', 'swfaction', 'swfbitmap', + 'swfbitmap.getheight', 'swfbitmap.getwidth', 'swfbutton', + 'swfbutton.addaction', 'swfbutton.addshape', 'swfbutton.setaction', + 'swfbutton.setdown', 'swfbutton.sethit', 'swfbutton.setover', + 'swfbutton.setup', 'swfbutton_keypress', 'swfdisplayitem', + 'swfdisplayitem.addcolor', 'swfdisplayitem.move', 'swfdisplayitem.moveto', + 'swfdisplayitem.multcolor', 'swfdisplayitem.remove', + 'swfdisplayitem.rotate', 'swfdisplayitem.rotateto', + 'swfdisplayitem.scale', 'swfdisplayitem.scaleto', + 'swfdisplayitem.setdepth', 'swfdisplayitem.setname', + 'swfdisplayitem.setratio', 'swfdisplayitem.skewx', + 'swfdisplayitem.skewxto', 'swfdisplayitem.skewy', + 'swfdisplayitem.skewyto', 'swffill', 'swffill.moveto', 'swffill.rotateto', + 'swffill.scaleto', 'swffill.skewxto', 'swffill.skewyto', 'swffont', + 'swffont.getwidth', 'swfgradient', 'swfgradient.addentry', 'swfmorph', + 'swfmorph.getshape1', 'swfmorph.getshape2', 'swfmovie', 'swfmovie.add', + 'swfmovie.nextframe', 'swfmovie.output', 'swfmovie.remove', + 'swfmovie.save', 'swfmovie.setbackground', 'swfmovie.setdimension', + 'swfmovie.setframes', 'swfmovie.setrate', 'swfmovie.streammp3', + 'swfshape', 'swfshape.addfill', 'swfshape.drawcurve', + 'swfshape.drawcurveto', 'swfshape.drawline', 'swfshape.drawlineto', + 'swfshape.movepen', 'swfshape.movepento', 'swfshape.setleftfill', + 'swfshape.setline', 'swfshape.setrightfill', 'swfsprite', 'swfsprite.add', + 'swfsprite.nextframe', 'swfsprite.remove', 'swfsprite.setframes', + 'swftext', 'swftext.addstring', 'swftext.getwidth', 'swftext.moveto', + 'swftext.setcolor', 'swftext.setfont', 'swftext.setheight', + 'swftext.setspacing', 'swftextfield', 'swftextfield.addstring', + 'swftextfield.align', 'swftextfield.setbounds', 'swftextfield.setcolor', + 'swftextfield.setfont', 'swftextfield.setheight', + 'swftextfield.setindentation', 'swftextfield.setleftmargin', + 'swftextfield.setlinespacing', 'swftextfield.setmargins', + 'swftextfield.setname', 'swftextfield.setrightmargin', + 'sybase_affected_rows', 'sybase_close', 'sybase_connect', + 'sybase_data_seek', 'sybase_fetch_array', 'sybase_fetch_field', + 'sybase_fetch_object', 'sybase_fetch_row', 'sybase_field_seek', + 'sybase_free_result', 'sybase_get_last_message', + 'sybase_min_client_severity', 'sybase_min_error_severity', + 'sybase_min_message_severity', 'sybase_min_server_severity', + 'sybase_num_fields', 'sybase_num_rows', 'sybase_pconnect', 'sybase_query', + 'sybase_result', 'sybase_select_db', 'symlink', 'syslog', 'system', 'tan', + 'tanh', 'tempnam', 'textdomain', 'time', 'tmpfile', 'touch', + 'trigger_error', 'trim', 'uasort', 'ucfirst', 'ucwords', + 'udm_add_search_limit', 'udm_alloc_agent', 'udm_api_version', + 'udm_cat_list', 'udm_cat_path', 'udm_check_charset', 'udm_check_stored', + 'udm_clear_search_limits', 'udm_close_stored', 'udm_crc32', 'udm_errno', + 'udm_error', 'udm_find', 'udm_free_agent', 'udm_free_ispell_data', + 'udm_free_res', 'udm_get_doc_count', 'udm_get_res_field', + 'udm_get_res_param', 'udm_load_ispell_data', 'udm_open_stored', + 'udm_set_agent_param', 'uksort', 'umask', 'uniqid', 'unixtojd', 'unlink', + 'unpack', 'unregister_tick_function', 'unserialize', 'unset', 'urldecode', + 'urlencode', 'user_error', 'usleep', 'usort', 'utf8_decode', 'utf8_encode', + 'var_dump', 'var_export', 'variant', 'version_compare', 'virtual', 'vpo', + 'vpopmail_add_alias_domain', 'vpopmail_add_alias_domain_ex', + 'vpopmail_add_domain', 'vpopmail_add_domain_ex', 'vpopmail_add_user', + 'vpopmail_alias_add', 'vpopmail_alias_del', 'vpopmail_alias_del_domain', + 'vpopmail_alias_get', 'vpopmail_alias_get_all', 'vpopmail_auth_user', + 'vpopmail_del_domain_ex', 'vpopmail_del_user', 'vpopmail_error', + 'vpopmail_passwd', 'vpopmail_set_user_quota', 'vprintf', 'vsprintf', + 'w32api_deftype', 'w32api_init_dtype', 'w32api_invoke_function', + 'w32api_register_function', 'w32api_set_call_method', 'wddx_add_vars', + 'wddx_deserialize', 'wddx_packet_end', 'wddx_packet_start', + 'wddx_serialize_value', 'wddx_serialize_vars', 'wordwrap', + 'xml_error_string', 'xml_get_current_byte_index', + 'xml_get_current_column_number', 'xml_get_current_line_number', + 'xml_get_error_code', 'xml_parse', 'xml_parse_into_struct', + 'xml_parser_create', 'xml_parser_create_ns', 'xml_parser_free', + 'xml_parser_get_option', 'xml_parser_set_option', + 'xml_set_character_data_handler', 'xml_set_default_handler', + 'xml_set_element_handler', 'xml_set_end_namespace_decl_handler', + 'xml_set_external_entity_ref_handler', 'xml_set_notation_decl_handler', + 'xml_set_object', 'xml_set_processing_instruction_handler', + 'xml_set_start_namespace_decl_handler', + 'xml_set_unparsed_entity_decl_handler', 'xmldoc', 'xmldocfile', + 'xmlrpc_decode', 'xmlrpc_decode_request', 'xmlrpc_encode', + 'xmlrpc_encode_request', 'xmlrpc_get_type', + 'xmlrpc_parse_method_descriptions', + 'xmlrpc_server_add_introspection_data', 'xmlrpc_server_call_method', + 'xmlrpc_server_create', 'xmlrpc_server_destroy', + 'xmlrpc_server_register_introspection_callback', + 'xmlrpc_server_register_method', 'xmlrpc_set_type', 'xmltree', + 'xpath_eval', 'xpath_eval_expression', 'xpath_new_context', 'xptr_eval', + 'xptr_new_context', 'xslt_create', 'xslt_errno', 'xslt_error', + 'xslt_free', 'xslt_process', 'xslt_set_base', 'xslt_set_encoding', + 'xslt_set_error_handler', 'xslt_set_log', 'xslt_set_sax_handler', + 'xslt_set_sax_handlers', 'xslt_set_scheme_handler', + 'xslt_set_scheme_handlers', 'yaz_addinfo', 'yaz_ccl_conf', + 'yaz_ccl_parse', 'yaz_close', 'yaz_connect', 'yaz_database', + 'yaz_element', 'yaz_errno', 'yaz_error', 'yaz_hits', 'yaz_itemorder', + 'yaz_present', 'yaz_range', 'yaz_record', 'yaz_scan', 'yaz_scan_result', + 'yaz_search', 'yaz_sort', 'yaz_syntax', 'yaz_wait', 'yp_all', 'yp_cat', + 'yp_err_string', 'yp_errno', 'yp_first', 'yp_get_default_domain', + 'yp_master', 'yp_match', 'yp_next', 'yp_order', 'zend_logo_guid', + 'zend_version', 'zip_close', 'zip_entry_close', + 'zip_entry_compressedsize', 'zip_entry_compressionmethod', + 'zip_entry_filesize', 'zip_entry_name', 'zip_entry_open', + 'zip_entry_read', 'zip_open', 'zip_read' + ), + 1 => $CONTEXT . '/functions', + 2 => 'color:#006;', + 3 => false, + // urls (the name of a function, with brackets at the end, or a string with {FNAME} in it like GeSHi 1.0.X) + // e.g. geshi_php_convert_url(), or http://www.php.net/{FNAME} + 4 => 'geshi_php_convert_url()' + ) +); + +$this->_contextCharactersDisallowedBeforeKeywords = array('$', '_'); +$this->_contextCharactersDisallowedAfterKeywords = array("'", '_'); +$this->_contextSymbols = array( + 0 => array( + 0 => array( + '(', ')', ',', ';', ':', '[', ']', + '+', '-', '*', '/', '&', '|', '!', '<', '>', + '{', '}', '=', '@' + ), + // name + 1 => $CONTEXT . '/sym0', + // style + 2 => 'color:#008000;' + ) +); +$this->_contextRegexps = array( + 0 => array( + // The regexps + // each regex in this array will be tested and styled the same + 0 => array( + '#(\$\$?[a-zA-Z_][a-zA-Z0-9_]*)#', // This is a variable in PHP + ), + // index 1 is a string that strpos can use + // @todo [blocking 1.1.1] maybe later let this string be a regex or something + 1 => '$', + // This is the special bit ;) + // For each bracket pair in the regex above, you can specify a name and style for it + 2 => array( + // index 1 is for the first bracket pair + // so for PHP it's everything within the (...) + // of course we could have specified the regex + // as #$([a-zA-Z_][a-zA-Z0-9_]*)# (note the change + // in place for the first open bracket), then the + // name and style for this part would not include + // the beginning $ + // Note:NEW AFTER 1.1.0a5: if third index of this array is true, + // then you are saying: "Try to highlight as code first, if + // it isn't code then use the styles in the second index". + // This is really aimed at the OO support. For example, this + // is some javascript code: + // foo.bar.toLowerCase(); + // The "bar" will be highlighted as an oo method, while the + // "toLowerCase" will be highlighted as a keyword even though + // it matches the oo method. + 1 => array($CONTEXT . '/var', 'color:#33f;', false), + ) + ), + // These are prebuild functions that can be called to add number + // support to a context. Call exactly as below + 1 => geshi_use_doubles($CONTEXT), + 2 => geshi_use_integers($CONTEXT) +); +$this->_objectSplitters = array( + 0 => array( + 0 => array('->'), + 1 => $CONTEXT . '/oodynamic', + 2 => 'color:#933;', + 3 => false + ), + 1 => array( + 0 => array('::'), + 1 => $CONTEXT . '/oostatic', + 2 => 'color:#933;font-weight:bold;', + 3 => false + ) +); + +/** + * This just demonstrates the concept... + * You can use a function like this, called + * by the URL entry of the keywords array, + * to do whatever you like with the URL. + * These functions that convert urls take one + * mandatory parameter - the keyword the URL + * is being built for. + * + * You can then have some kind of logic in this + * function to return a URL based on the + * keyword... saves on those nasty hacks that + * were used in 1.0.X to do this. + * + * Make sure you do the function_exists check! These + * context files will be included multiple times + */ + if (!function_exists('geshi_php_convert_url')) { + function geshi_php_convert_url ($keyword) + { + return 'http://www.php.net/' . $keyword; + } +} + +?> diff --git a/paste/include/geshi/contexts/php/php4.php b/paste/include/geshi/contexts/php/php4.php new file mode 100644 index 0000000..532bb8f --- /dev/null +++ b/paste/include/geshi/contexts/php/php4.php @@ -0,0 +1,851 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** Get the GeSHiStringContext class */ +require_once GESHI_CLASSES_ROOT . 'class.geshistringcontext.php'; +/** Get the GeSHiPHPDoubleStringContext class */ +require_once GESHI_CLASSES_ROOT . 'php' . GESHI_DIR_SEPARATOR . 'class.geshiphpdoublestringcontext.php'; + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('<?php', '<?'), + 1 => array('?>'), + 2 => true + ), + 1 => array( + 0 => array('<%'), + 1 => array('%>'), + 2 => false + ) +); + +$this->_childContexts = array( + new GeSHiStringContext('php', $DIALECT, 'common/single_string'), + new GeSHiPHPDoubleStringContext('php', $DIALECT, 'double_string'), + new GeSHiPHPDoubleStringContext('php', $DIALECT, 'heredoc'), + // PHP single comment, with # starter and end-php-context ender + new GeSHiContext('php', $DIALECT, 'single_comment'), + // Use common multi comment since it is a PHP comment... + new GeSHiContext('php', $DIALECT, 'common/multi_comment'), + new GeSHiContext('php', $DIALECT, 'doxygen') +); + +$this->_styler->setStyle($CONTEXT_START, 'color:#000;font-weight:bold;'); +$this->_styler->setStyle($CONTEXT_END, 'color:#000;font-weight:bold;'); + +$this->_contextKeywords = array( + 0 => array( + 0 => array( + 'as', 'break', 'case', 'continue', 'declare', 'do', 'else', 'elseif', + 'endforeach', 'endif', 'endswitch', 'endwhile', 'for', 'foreach', 'if', + 'include', 'include_once', 'require', 'require_once', 'return', 'switch', + 'while' + ), + 1 => $CONTEXT . '/cstructures', + 2 => 'color:#b1b100;', + 3 => false, + 4 => '' + ), + 1 => array( + 0 => array( + 'DEFAULT_INCLUDE_PATH', 'E_ALL', 'E_COMPILE_ERROR', 'E_COMPILE_WARNING', + 'E_CORE_ERROR', 'E_CORE_WARNING', 'E_ERROR', 'E_NOTICE', 'E_PARSE', + 'E_USER_ERROR', 'E_USER_NOTICE', 'E_USER_WARNING', + 'E_WARNING', 'FALSE', 'NULL', 'PEAR_EXTENSION_DIR', 'PEAR_INSTALL_DIR', + 'PHP_BINDIR', 'PHP_CONFIG_FILE_PATH', 'PHP_DATADIR', 'PHP_EXTENSION_DIR', + 'PHP_LIBDIR', 'PHP_LOCALSTATEDIR', 'PHP_OS', 'PHP_OUTPUT_HANDLER_CONT', + 'PHP_OUTPUT_HANDLER_END', 'PHP_OUTPUT_HANDLER_START', 'PHP_SYSCONFDIR', + 'PHP_VERSION', 'TRUE', '__CLASS__', '__FILE__', '__FUNCTION__', + '__LINE__', '__METHOD__', 'class', 'default', + 'extends', 'function', 'new', 'parent', 'static', 'var' + ), + 1 => $CONTEXT . '/keywords', + 2 => 'color:#000;font-weight:bold;', + 3 => false, + 4 => '' + ), + 2 => array( + 0 => array( + // @todo [blocking 1.1.9] This list of functions is for php5... should get one for php4 only + 'abs', 'acos', 'acosh', 'addcslashes', 'addslashes', + 'apache_child_terminate', 'apache_lookup_uri', 'apache_note', + 'apache_setenv', 'array', 'array_change_key_case', 'array_chunk', + 'array_count_values', 'array_diff', 'array_fill', 'array_filter', + 'array_flip', 'array_intersect', 'array_key_exists', 'array_keys', + 'array_map', 'array_merge', 'array_merge_recursive', 'array_multisort', + 'array_pad', 'array_pop', 'array_push', 'array_rand', 'array_reduce', + 'array_reverse', 'array_search', 'array_shift', 'array_slice', + 'array_splice', 'array_sum', 'array_unique', 'array_unshift', + 'array_values', 'array_walk', 'arsort', 'ascii2ebcdic', 'asin', 'asinh', + 'asort', 'aspell_check', 'aspell_check_raw', 'aspell_new', + 'aspell_suggest', 'assert', 'assert_options', 'atan', 'atan2', 'atanh', + 'base64_decode', 'base64_encode', 'base_convert', 'basename', 'bcadd', + 'bccomp', 'bcdiv', 'bcmod', 'bcmul', 'bcpow', 'bcscale', 'bcsqrt', + 'bcsub', 'bin2hex', 'bind_textdomain_codeset', 'bindec', 'bindtextdomain', + 'bz', 'bzclose', 'bzdecompress', 'bzerrno', 'bzerror', 'bzerrstr', + 'bzflush', 'bzopen', 'bzread', 'bzwrite', 'c', 'cal_days_in_month', + 'cal_from_jd', 'cal_info', 'cal_to_jd', 'call_user_func', + 'call_user_func_array', 'call_user_method', 'call_user_method_array', + 'ccvs_add', 'ccvs_auth', 'ccvs_command', 'ccvs_count', 'ccvs_delete', + 'ccvs_done', 'ccvs_init', 'ccvs_lookup', 'ccvs_new', 'ccvs_report', + 'ccvs_return', 'ccvs_reverse', 'ccvs_sale', 'ccvs_status', + 'ccvs_textvalue', 'ccvs_void', 'ceil', 'chdir', 'checkdate', 'checkdnsrr', + 'chgrp', 'chmod', 'chop', 'chown', 'chr', 'chroot', 'chunk_split', + 'class_exists', 'clearstatcache', 'closedir', 'closelog', 'com', + 'com_addref', 'com_get', 'com_invoke', 'com_isenum', 'com_load', + 'com_load_typelib', 'com_propget', 'com_propput', 'com_propset', + 'com_release', 'com_set', 'compact', 'connection_aborted', + 'connection_status', 'connection_timeout', 'constant', + 'convert_cyr_string', 'copy', 'cos', 'cosh', 'count', 'count_chars', + 'cpdf_add_annotation', 'cpdf_add_outline', 'cpdf_arc', 'cpdf_begin_text', + 'cpdf_circle', 'cpdf_clip', 'cpdf_close', 'cpdf_closepath', + 'cpdf_closepath_fill_stroke', 'cpdf_closepath_stroke', + 'cpdf_continue_text', 'cpdf_curveto', 'cpdf_end_text', 'cpdf_fill', + 'cpdf_fill_stroke', 'cpdf_finalize', 'cpdf_finalize_page', + 'cpdf_global_set_document_limits', 'cpdf_import_jpeg', 'cpdf_lineto', + 'cpdf_moveto', 'cpdf_newpath', 'cpdf_open', 'cpdf_output_buffer', + 'cpdf_page_init', 'cpdf_place_inline_image', 'cpdf_rect', 'cpdf_restore', + 'cpdf_rlineto', 'cpdf_rmoveto', 'cpdf_rotate', 'cpdf_rotate_text', + 'cpdf_save', 'cpdf_save_to_file', 'cpdf_scale', 'cpdf_set_action_url', + 'cpdf_set_char_spacing', 'cpdf_set_creator', 'cpdf_set_current_page', + 'cpdf_set_font', 'cpdf_set_font_directories', 'cpdf_set_font_map_file', + 'cpdf_set_horiz_scaling', 'cpdf_set_keywords', 'cpdf_set_leading', + 'cpdf_set_page_animation', 'cpdf_set_subject', 'cpdf_set_text_matrix', + 'cpdf_set_text_pos', 'cpdf_set_text_rise', 'cpdf_set_title', + 'cpdf_set_viewer_preferences', 'cpdf_set_word_spacing', 'cpdf_setdash', + 'cpdf_setflat', 'cpdf_setgray', 'cpdf_setgray_fill', + 'cpdf_setgray_stroke', 'cpdf_setlinecap', 'cpdf_setlinejoin', + 'cpdf_setlinewidth', 'cpdf_setmiterlimit', 'cpdf_setrgbcolor', + 'cpdf_setrgbcolor_fill', 'cpdf_setrgbcolor_stroke', 'cpdf_show', + 'cpdf_show_xy', 'cpdf_stringwidth', 'cpdf_stroke', 'cpdf_text', + 'cpdf_translate', 'crack_check', 'crack_closedict', + 'crack_getlastmessage', 'crack_opendict', 'crc32', 'create_function', + 'crypt', 'ctype_alnum', 'ctype_alpha', 'ctype_cntrl', 'ctype_digit', + 'ctype_graph', 'ctype_lower', 'ctype_print', 'ctype_punct', 'ctype_space', + 'ctype_upper', 'ctype_xdigit', 'curl_close', 'curl_errno', 'curl_error', + 'curl_exec', 'curl_getinfo', 'curl_init', 'curl_setopt', 'curl_version', + 'current', 'cybercash_base64_decode', 'cybercash_base64_encode', + 'cybercash_decr', 'cybercash_encr', 'cybermut_creerformulairecm', + 'cybermut_creerreponsecm', 'cybermut_testmac', 'cyrus_authenticate', + 'cyrus_bind', 'cyrus_close', 'cyrus_connect', 'cyrus_query', + 'cyrus_unbind', 'date', 'dba_close', 'dba_delete', 'dba_exists', + 'dba_fetch', 'dba_firstkey', 'dba_insert', 'dba_nextkey', 'dba_open', + 'dba_optimize', 'dba_popen', 'dba_replace', 'dba_sync', + 'dbase_add_record', 'dbase_close', 'dbase_create', 'dbase_delete_record', + 'dbase_get_record', 'dbase_get_record_with_names', 'dbase_numfields', + 'dbase_numrecords', 'dbase_open', 'dbase_pack', 'dbase_replace_record', + 'dblist', 'dbmclose', 'dbmdelete', 'dbmexists', 'dbmfetch', 'dbmfirstkey', + 'dbminsert', 'dbmnextkey', 'dbmopen', 'dbmreplace', 'dbp', 'dbplus_add', + 'dbplus_aql', 'dbplus_chdir', 'dbplus_close', 'dbplus_curr', + 'dbplus_errcode', 'dbplus_errno', 'dbplus_find', 'dbplus_first', + 'dbplus_flush', 'dbplus_freealllocks', 'dbplus_freelock', + 'dbplus_freerlocks', 'dbplus_getlock', 'dbplus_getunique', 'dbplus_info', + 'dbplus_last', 'dbplus_lockrel', 'dbplus_next', 'dbplus_open', + 'dbplus_rchperm', 'dbplus_rcreate', 'dbplus_rcrtexact', 'dbplus_rcrtlike', + 'dbplus_resolve', 'dbplus_restorepos', 'dbplus_rkeys', 'dbplus_ropen', + 'dbplus_rquery', 'dbplus_rrename', 'dbplus_rsecindex', 'dbplus_runlink', + 'dbplus_rzap', 'dbplus_savepos', 'dbplus_setindex', + 'dbplus_setindexbynumber', 'dbplus_sql', 'dbplus_tcl', 'dbplus_tremove', + 'dbplus_undo', 'dbplus_undoprepare', 'dbplus_unlockrel', + 'dbplus_unselect', 'dbplus_update', 'dbplus_xlockrel', + 'dbplus_xunlockrel', 'dbx_close', 'dbx_compare', 'dbx_connect', + 'dbx_error', 'dbx_query', 'dbx_sort', 'dcgettext', 'dcngettext', + 'debugger_off', 'debugger_on', 'decbin', 'dechex', 'decoct', 'define', + 'define_syslog_variables', 'defined', 'deg2rad', 'delete', 'dgettext', + 'die', 'dio_close', 'dio_fcntl', 'dio_open', 'dio_read', 'dio_seek', + 'dio_stat', 'dio_truncate', 'dio_write', 'dir', 'dirname', + 'disk_free_space', 'disk_total_space', 'diskfreespace', 'dl', 'dngettext', + 'domxml_add_root', 'domxml_attributes', 'domxml_children', + 'domxml_dumpmem', 'domxml_get_attribute', 'domxml_new_child', + 'domxml_new_xmldoc', 'domxml_node', 'domxml_node_set_content', + 'domxml_node_unlink_node', 'domxml_root', 'domxml_set_attribute', + 'domxml_version', 'dotnet_load', 'doubleval', 'each', 'easter_date', + 'easter_days', 'ebcdic2ascii', 'echo', 'empty', 'end', 'ereg', + 'ereg_replace', 'eregi', 'eregi_replace', 'error_log', 'error_reporting', + 'escapeshellarg', 'escapeshellcmd', 'eval', 'exec', 'exif_imagetype', + 'exif_read_data', 'exif_thumbnail', 'exit', 'exp', 'explode', 'expm1', + 'extension_loaded', 'extract', 'ezmlm_hash', 'fbsql_affected_rows', + 'fbsql_autocommit', 'fbsql_change_user', 'fbsql_close', 'fbsql_commit', + 'fbsql_connect', 'fbsql_create_blob', 'fbsql_create_clob', + 'fbsql_create_db', 'fbsql_data_seek', 'fbsql_database', + 'fbsql_database_password', 'fbsql_db_query', 'fbsql_db_status', + 'fbsql_drop_db', 'fbsql_errno', 'fbsql_error', 'fbsql_fetch_a', + 'fbsql_fetch_assoc', 'fbsql_fetch_field', 'fbsql_fetch_lengths', + 'fbsql_fetch_object', 'fbsql_fetch_row', 'fbsql_field_flags', + 'fbsql_field_len', 'fbsql_field_name', 'fbsql_field_seek', + 'fbsql_field_table', 'fbsql_field_type', 'fbsql_free_result', + 'fbsql_get_autostart_info', 'fbsql_hostname', 'fbsql_insert_id', + 'fbsql_list_dbs', 'fbsql_list_fields', 'fbsql_list_tables', + 'fbsql_next_result', 'fbsql_num_fields', 'fbsql_num_rows', + 'fbsql_password', 'fbsql_pconnect', 'fbsql_query', 'fbsql_read_blob', + 'fbsql_read_clob', 'fbsql_result', 'fbsql_rollback', 'fbsql_select_db', + 'fbsql_set_lob_mode', 'fbsql_set_transaction', 'fbsql_start_db', + 'fbsql_stop_db', 'fbsql_tablename', 'fbsql_username', 'fbsql_warnings', + 'fclose', 'fdf_add_template', 'fdf_close', 'fdf_create', 'fdf_get_file', + 'fdf_get_status', 'fdf_get_value', 'fdf_next_field_name', 'fdf_open', + 'fdf_save', 'fdf_set_ap', 'fdf_set_encoding', 'fdf_set_file', + 'fdf_set_flags', 'fdf_set_javascript_action', 'fdf_set_opt', + 'fdf_set_status', 'fdf_set_submit_form_action', 'fdf_set_value', 'feof', + 'fflush', 'fgetc', 'fgetcsv', 'fgets', 'fgetss', 'fgetwrapperdata', + 'file', 'file_exists', 'file_get_contents', 'fileatime', 'filectime', + 'filegroup', 'fileinode', 'filemtime', 'fileowner', 'fileperms', + 'filepro', 'filepro_fieldcount', 'filepro_fieldname', 'filepro_fieldtype', + 'filepro_fieldwidth', 'filepro_retrieve', 'filepro_rowcount', 'filesize', + 'filetype', 'floatval', 'flock', 'floor', 'flush', 'fopen', 'fpassthru', + 'fputs', 'fread', 'frenchtojd', 'fribidi_log2vis', 'fscanf', 'fseek', + 'fsockopen', 'fstat', 'ftell', 'ftok', 'ftp_cdup', 'ftp_chdir', + 'ftp_close', 'ftp_connect', 'ftp_delete', 'ftp_exec', 'ftp_fget', + 'ftp_fput', 'ftp_get', 'ftp_get_option', 'ftp_login', 'ftp_mdtm', + 'ftp_mkdir', 'ftp_nlist', 'ftp_pasv', 'ftp_put', 'ftp_pwd', 'ftp_quit', + 'ftp_rawlist', 'ftp_rename', 'ftp_rmdir', 'ftp_set_option', 'ftp_site', + 'ftp_size', 'ftp_systype', 'ftruncate', 'func_get_arg', 'func_get_args', + 'func_num_args', 'function_exists', 'fwrite', 'get_browser', + 'get_cfg_var', 'get_class', 'get_class_methods', 'get_class_vars', + 'get_current_user', 'get_declared_classes', 'get_defined_constants', + 'get_defined_functions', 'get_defined_vars', 'get_extension_funcs', + 'get_html_translation_table', 'get_include_p', 'get_included_files', + 'get_loaded_extensions', 'get_magic_quotes_gpc', + 'get_magic_quotes_runtime', 'get_meta_tags', 'get_object_vars', + 'get_parent_class', 'get_required_files', 'get_resource_type', + 'getallheaders', 'getcwd', 'getdate', 'getenv', 'gethostbyaddr', + 'gethostbyname', 'gethostbynamel', 'getimagesize', 'getlastmod', + 'getmxrr', 'getmygid', 'getmyinode', 'getmypid', 'getmyuid', + 'getprotobyname', 'getprotobynumber', 'getrandmax', 'getrusage', + 'getservbyname', 'getservbyport', 'gettext', 'gettimeofday', 'gettype', + 'global', 'gmdate', 'gmmktime', 'gmp_abs', 'gmp_add', 'gmp_and', + 'gmp_clrbit', 'gmp_cmp', 'gmp_com', 'gmp_div', 'gmp_div_q', 'gmp_div_qr', + 'gmp_div_r', 'gmp_divexact', 'gmp_fact', 'gmp_gcd', 'gmp_gcdext', + 'gmp_hamdist', 'gmp_init', 'gmp_intval', 'gmp_invert', 'gmp_jacobi', + 'gmp_legendre', 'gmp_mod', 'gmp_mul', 'gmp_neg', 'gmp_or', + 'gmp_perfect_square', 'gmp_popcount', 'gmp_pow', 'gmp_powm', + 'gmp_prob_prime', 'gmp_random', 'gmp_scan0', 'gmp_scan1', 'gmp_setbit', + 'gmp_sign', 'gmp_sqrt', 'gmp_sqrtrem', 'gmp_strval', 'gmp_sub', 'gmp_xor', + 'gmstrftime', 'gregoriantojd', 'gzclose', 'gzcompress', 'gzdeflate', + 'gzencode', 'gzeof', 'gzfile', 'gzgetc', 'gzgets', 'gzgetss', 'gzinflate', + 'gzopen', 'gzpassthru', 'gzputs', 'gzread', 'gzrewind', 'gzseek', 'gztell', + 'gzuncompress', 'gzwrite', 'header', 'headers_sent', 'hebrev', 'hebrevc', + 'hexdec', 'highlight_file', 'highlight_string', 'htmlentities', + 'htmlspecialchars', 'hw_array2objrec', 'hw_c', 'hw_children', + 'hw_childrenobj', 'hw_close', 'hw_connect', 'hw_connection_info', 'hw_cp', + 'hw_deleteobject', 'hw_docbyanchor', 'hw_docbyanchorobj', + 'hw_document_attributes', 'hw_document_bodytag', 'hw_document_content', + 'hw_document_setcontent', 'hw_document_size', 'hw_dummy', 'hw_edittext', + 'hw_error', 'hw_errormsg', 'hw_free_document', 'hw_getanchors', + 'hw_getanchorsobj', 'hw_getandlock', 'hw_getchildcoll', + 'hw_getchildcollobj', 'hw_getchilddoccoll', 'hw_getchilddoccollobj', + 'hw_getobject', 'hw_getobjectbyquery', 'hw_getobjectbyquerycoll', + 'hw_getobjectbyquerycollobj', 'hw_getobjectbyqueryobj', 'hw_getparents', + 'hw_getparentsobj', 'hw_getrellink', 'hw_getremote', + 'hw_getremotechildren', 'hw_getsrcbydestobj', 'hw_gettext', + 'hw_getusername', 'hw_identify', 'hw_incollections', 'hw_info', + 'hw_inscoll', 'hw_insdoc', 'hw_insertanchors', 'hw_insertdocument', + 'hw_insertobject', 'hw_mapid', 'hw_modifyobject', 'hw_mv', + 'hw_new_document', 'hw_objrec2array', 'hw_output_document', 'hw_pconnect', + 'hw_pipedocument', 'hw_root', 'hw_setlinkroot', 'hw_stat', 'hw_unlock', + 'hw_who', 'hypot', 'i', 'ibase_blob_add', 'ibase_blob_cancel', + 'ibase_blob_close', 'ibase_blob_create', 'ibase_blob_echo', + 'ibase_blob_get', 'ibase_blob_import', 'ibase_blob_info', + 'ibase_blob_open', 'ibase_close', 'ibase_commit', 'ibase_connect', + 'ibase_errmsg', 'ibase_execute', 'ibase_fetch_object', 'ibase_fetch_row', + 'ibase_field_info', 'ibase_free_query', 'ibase_free_result', + 'ibase_num_fields', 'ibase_pconnect', 'ibase_prepare', 'ibase_query', + 'ibase_rollback', 'ibase_timefmt', 'ibase_trans', 'icap_close', + 'icap_create_calendar', 'icap_delete_calendar', 'icap_delete_event', + 'icap_fetch_event', 'icap_list_alarms', 'icap_list_events', 'icap_open', + 'icap_rename_calendar', 'icap_reopen', 'icap_snooze', 'icap_store_event', + 'iconv', 'iconv_get_encoding', 'iconv_set_encoding', 'ifx_affected_rows', + 'ifx_blobinfile_mode', 'ifx_byteasvarchar', 'ifx_close', 'ifx_connect', + 'ifx_copy_blob', 'ifx_create_blob', 'ifx_create_char', 'ifx_do', + 'ifx_error', 'ifx_errormsg', 'ifx_fetch_row', 'ifx_fieldproperties', + 'ifx_fieldtypes', 'ifx_free_blob', 'ifx_free_char', 'ifx_free_result', + 'ifx_get_blob', 'ifx_get_char', 'ifx_getsqlca', 'ifx_htmltbl_result', + 'ifx_nullformat', 'ifx_num_fields', 'ifx_num_rows', 'ifx_pconnect', + 'ifx_prepare', 'ifx_query', 'ifx_textasvarchar', 'ifx_update_blob', + 'ifx_update_char', 'ifxus_close_slob', 'ifxus_create_slob', + 'ifxus_free_slob', 'ifxus_open_slob', 'ifxus_read_slob', + 'ifxus_seek_slob', 'ifxus_tell_slob', 'ifxus_write_slob', + 'ignore_user_abort', 'image2wbmp', 'imagealphablending', 'imageantialias', + 'imagearc', 'imagechar', 'imagecharup', 'imagecolorallocate', + 'imagecolorat', 'imagecolorclosest', 'imagecolorclosestalpha', + 'imagecolorclosesthwb', 'imagecolordeallocate', 'imagecolorexact', + 'imagecolorexactalpha', 'imagecolorresolve', 'imagecolorresolvealpha', + 'imagecolorset', 'imagecolorsforindex', 'imagecolorstotal', + 'imagecolortransparent', 'imagecopy', 'imagecopymerge', + 'imagecopymergegray', 'imagecopyresampled', 'imagecopyresized', + 'imagecreate', 'imagecreatefromgd', 'imagecreatefromgd2', + 'imagecreatefromgd2part', 'imagecreatefromgif', 'imagecreatefromjpeg', + 'imagecreatefrompng', 'imagecreatefromstring', 'imagecreatefromwbmp', + 'imagecreatefromxbm', 'imagecreatefromxpm', 'imagecreatetruecolor', + 'imagedashedline', 'imagedestroy', 'imageellipse', 'imagefill', + 'imagefilledarc', 'imagefilledellipse', 'imagefilledpolygon', + 'imagefilledrectangle', 'imagefilltoborder', 'imagefontheight', + 'imagefontwidth', 'imageftbbox', 'imagefttext', 'imagegammacorrect', + 'imagegd', 'imagegd2', 'imagegif', 'imageinterlace', 'imagejpeg', + 'imageline', 'imageloadfont', 'imagepalettecopy', 'imagepng', + 'imagepolygon', 'imagepsbbox', 'imagepsencodefont', 'imagepsextendfont', + 'imagepsfreefont', 'imagepsloadfont', 'imagepsslantfont', 'imagepstext', + 'imagerectangle', 'imagesetbrush', 'imagesetpixel', 'imagesetstyle', + 'imagesetthickness', 'imagesettile', 'imagestring', 'imagestringup', + 'imagesx', 'imagesy', 'imagetruecolortopalette', 'imagettfbbox', + 'imagettftext', 'imagetypes', 'imagewbmp', 'imap_8bit', 'imap_append', + 'imap_base64', 'imap_binary', 'imap_body', 'imap_bodystruct', + 'imap_check', 'imap_clearflag_full', 'imap_close', 'imap_createmailbox', + 'imap_delete', 'imap_deletemailbox', 'imap_errors', 'imap_expunge', + 'imap_fetch_overview', 'imap_fetchbody', 'imap_fetchheader', + 'imap_fetchstructure', 'imap_get_quota', 'imap_getmailboxes', + 'imap_getsubscribed', 'imap_header', 'imap_headerinfo', 'imap_headers', + 'imap_last_error', 'imap_listmailbox', 'imap_listsubscribed', 'imap_mail', + 'imap_mail_compose', 'imap_mail_copy', 'imap_mail_move', + 'imap_mailboxmsginfo', 'imap_mime_header_decode', 'imap_msgno', + 'imap_num_msg', 'imap_num_recent', 'imap_open', 'imap_ping', 'imap_popen', + 'imap_qprint', 'imap_renamemailbox', 'imap_reopen', + 'imap_rfc822_parse_adrlist', 'imap_rfc822_parse_headers', + 'imap_rfc822_write_address', 'imap_scanmailbox', 'imap_search', + 'imap_set_quota', 'imap_setacl', 'imap_setflag_full', 'imap_sort', + 'imap_status', 'imap_subscribe', 'imap_thread', 'imap_uid', + 'imap_undelete', 'imap_unsubscribe', 'imap_utf7_decode', + 'imap_utf7_encode', 'imap_utf8', 'implode', 'import_request_variables', + 'in_array', 'include', 'include_once', 'ingres_autocommit', + 'ingres_close', 'ingres_commit', 'ingres_connect', 'ingres_fetch_array', + 'ingres_fetch_object', 'ingres_fetch_row', 'ingres_field_length', + 'ingres_field_name', 'ingres_field_nullable', 'ingres_field_precision', + 'ingres_field_scale', 'ingres_field_type', 'ingres_num_fields', + 'ingres_num_rows', 'ingres_pconnect', 'ingres_query', 'ingres_rollback', + 'ini_alter', 'ini_get', 'ini_get_all', 'ini_restore', 'ini_set', 'intval', + 'ip2long', 'iptcembed', 'iptcparse', 'ircg_channel_mode', + 'ircg_disconnect', 'ircg_fetch_error_msg', 'ircg_get_username', + 'ircg_html_encode', 'ircg_ignore_add', 'ircg_ignore_del', + 'ircg_is_conn_alive', 'ircg_join', 'ircg_kick', + 'ircg_lookup_format_messages', 'ircg_msg', 'ircg_nick', + 'ircg_nickname_escape', 'ircg_nickname_unescape', 'ircg_notice', + 'ircg_part', 'ircg_pconnect', 'ircg_register_format_messages', + 'ircg_set_current', 'ircg_set_file', 'ircg_topic', 'ircg_whois', 'is_a', + 'is_array', 'is_bool', 'is_callable', 'is_dir', 'is_double', + 'is_executable', 'is_file', 'is_finite', 'is_float', 'is_infinite', + 'is_int', 'is_integer', 'is_link', 'is_long', 'is_nan', 'is_null', + 'is_numeric', 'is_object', 'is_readable', 'is_real', 'is_resource', + 'is_scalar', 'is_string', 'is_subclass_of', 'is_uploaded_file', + 'is_writable', 'is_writeable', 'isset', 'java_last_exception_clear', + 'java_last_exception_get', 'jddayofweek', 'jdmonthname', 'jdtofrench', + 'jdtogregorian', 'jdtojewish', 'jdtojulian', 'jdtounix', 'jewishtojd', + 'join', 'jpeg2wbmp', 'juliantojd', 'key', 'krsort', 'ksort', 'lcg_value', + 'ldap_8859_to_t61', 'ldap_add', 'ldap_bind', 'ldap_close', 'ldap_compare', + 'ldap_connect', 'ldap_count_entries', 'ldap_delete', 'ldap_dn2ufn', + 'ldap_err2str', 'ldap_errno', 'ldap_error', 'ldap_explode_dn', + 'ldap_first_attribute', 'ldap_first_entry', 'ldap_first_reference', + 'ldap_free_result', 'ldap_get_attributes', 'ldap_get_dn', + 'ldap_get_entries', 'ldap_get_option', 'ldap_get_values', + 'ldap_get_values_len', 'ldap_list', 'ldap_mod_add', 'ldap_mod_del', + 'ldap_mod_replace', 'ldap_modify', 'ldap_next_attribute', + 'ldap_next_entry', 'ldap_next_reference', 'ldap_parse_reference', + 'ldap_parse_result', 'ldap_read', 'ldap_rename', 'ldap_search', + 'ldap_set_option', 'ldap_set_rebind_proc', 'ldap_sort', 'ldap_start_tls', + 'ldap_t61_to_8859', 'ldap_unbind', 'leak', 'levenshtein', 'link', + 'linkinfo', 'list', 'localeconv', 'localtime', 'log', 'log10', 'log1p', + 'long2ip', 'lstat', 'ltrim', 'mail', + 'mailparse_determine_best_xfer_encoding', 'mailparse_msg_create', + 'mailparse_msg_extract_part', 'mailparse_msg_extract_part_file', + 'mailparse_msg_free', 'mailparse_msg_get_part', + 'mailparse_msg_get_part_data', 'mailparse_msg_get_structure', + 'mailparse_msg_parse', 'mailparse_msg_parse_file', + 'mailparse_rfc822_parse_addresses', 'mailparse_stream_encode', + 'mailparse_uudecode_all', 'max', 'mb_c', 'mb_convert_kana', + 'mb_convert_variables', 'mb_decode_mimeheader', 'mb_decode_numericentity', + 'mb_detect_encoding', 'mb_detect_order', 'mb_encode_mimeheader', + 'mb_encode_numericentity', 'mb_ereg', 'mb_ereg_match', 'mb_ereg_replace', + 'mb_ereg_search', 'mb_ereg_search_getpos', 'mb_ereg_search_getregs', + 'mb_ereg_search_init', 'mb_ereg_search_pos', 'mb_ereg_search_regs', + 'mb_ereg_search_setpos', 'mb_eregi', 'mb_eregi_replace', 'mb_get_info', + 'mb_http_input', 'mb_http_output', 'mb_internal_encoding', 'mb_language', + 'mb_output_handler', 'mb_parse_str', 'mb_preferred_mime_name', + 'mb_regex_encoding', 'mb_send_mail', 'mb_split', 'mb_strcut', + 'mb_strimwidth', 'mb_strlen', 'mb_strpos', 'mb_strrpos', 'mb_strwidth', + 'mb_substitute_character', 'mb_substr', 'mcal_append_event', 'mcal_close', + 'mcal_create_calendar', 'mcal_date_compare', 'mcal_date_valid', + 'mcal_day_of_week', 'mcal_day_of_year', 'mcal_days_in_month', + 'mcal_delete_calendar', 'mcal_delete_event', 'mcal_event_add_attribute', + 'mcal_event_init', 'mcal_event_set_alarm', 'mcal_event_set_category', + 'mcal_event_set_class', 'mcal_event_set_description', + 'mcal_event_set_end', 'mcal_event_set_recur_daily', + 'mcal_event_set_recur_monthly_mday', 'mcal_event_set_recur_monthly_wday', + 'mcal_event_set_recur_none', 'mcal_event_set_recur_weekly', + 'mcal_event_set_recur_yearly', 'mcal_event_set_start', + 'mcal_event_set_title', 'mcal_expunge', 'mcal_fetch_current_stream_event', + 'mcal_fetch_event', 'mcal_is_leap_year', 'mcal_list_alarms', + 'mcal_list_events', 'mcal_next_recurrence', 'mcal_open', 'mcal_popen', + 'mcal_rename_calendar', 'mcal_reopen', 'mcal_snooze', 'mcal_store_event', + 'mcal_time_valid', 'mcal_week_of_year', 'mcrypt_cbc', 'mcrypt_cfb', + 'mcrypt_create_iv', 'mcrypt_decrypt', 'mcrypt_ecb', + 'mcrypt_enc_get_algorithms_name', 'mcrypt_enc_get_block_size', + 'mcrypt_enc_get_iv_size', 'mcrypt_enc_get_key_size', + 'mcrypt_enc_get_modes_name', 'mcrypt_enc_get_supported_key_sizes', + 'mcrypt_enc_is_block_algorithm', 'mcrypt_enc_is_block_algorithm_mode', + 'mcrypt_enc_is_block_mode', 'mcrypt_enc_self_test', 'mcrypt_encrypt', + 'mcrypt_generic', 'mcrypt_generic_deinit', 'mcrypt_generic_end', + 'mcrypt_generic_init', 'mcrypt_get_block_size', 'mcrypt_get_cipher_name', + 'mcrypt_get_iv_size', 'mcrypt_get_key_size', 'mcrypt_list_algorithms', + 'mcrypt_list_modes', 'mcrypt_module_close', + 'mcrypt_module_get_algo_block_size', 'mcrypt_module_get_algo_key_size', + 'mcrypt_module_get_supported_key_sizes', + 'mcrypt_module_is_block_algorithm', + 'mcrypt_module_is_block_algorithm_mode', 'mcrypt_module_is_block_mode', + 'mcrypt_module_open', 'mcrypt_module_self_test', 'mcrypt_ofb', 'md5', + 'md5_file', 'mdecrypt_generic', 'metaphone', 'method_exists', 'mhash', + 'mhash_count', 'mhash_get_block_size', 'mhash_get_hash_name', + 'mhash_keygen_s2k', 'microtime', 'min', 'ming_setcubicthreshold', + 'ming_setscale', 'ming_useswfversion', 'mkdir', 'mktime', + 'move_uploaded_file', 'msession_connect', 'msession_count', + 'msession_create', 'msession_destroy', 'msession_disconnect', + 'msession_find', 'msession_get', 'msession_get_array', 'msession_getdata', + 'msession_inc', 'msession_list', 'msession_listvar', 'msession_lock', + 'msession_plugin', 'msession_randstr', 'msession_set', + 'msession_set_array', 'msession_setdata', 'msession_timeout', + 'msession_uniq', 'msession_unlock', 'msql', 'msql_affected_rows', + 'msql_close', 'msql_connect', 'msql_create_db', 'msql_createdb', + 'msql_data_seek', 'msql_dbname', 'msql_drop_db', 'msql_dropdb', + 'msql_error', 'msql_fetch_array', 'msql_fetch_field', 'msql_fetch_object', + 'msql_fetch_row', 'msql_field_seek', 'msql_fieldflags', 'msql_fieldlen', + 'msql_fieldname', 'msql_fieldtable', 'msql_fieldtype', 'msql_free_result', + 'msql_freeresult', 'msql_list_dbs', 'msql_list_fields', 'msql_list_tables', + 'msql_listdbs', 'msql_listfields', 'msql_listtables', 'msql_num_fields', + 'msql_num_rows', 'msql_numfields', 'msql_numrows', 'msql_pconnect', + 'msql_query', 'msql_regcase', 'msql_result', 'msql_select_db', + 'msql_selectdb', 'msql_tablename', 'mssql_bind', 'mssql_close', + 'mssql_connect', 'mssql_data_seek', 'mssql_execute', 'mssql_fetch_array', + 'mssql_fetch_assoc', 'mssql_fetch_batch', 'mssql_fetch_field', + 'mssql_fetch_object', 'mssql_fetch_row', 'mssql_field_length', + 'mssql_field_name', 'mssql_field_seek', 'mssql_field_type', + 'mssql_free_result', 'mssql_get_last_message', 'mssql_guid_string', + 'mssql_init', 'mssql_min_error_severity', 'mssql_min_message_severity', + 'mssql_next_result', 'mssql_num_fields', 'mssql_num_rows', + 'mssql_pconnect', 'mssql_query', 'mssql_result', 'mssql_rows_affected', + 'mssql_select_db', 'mt_getrandmax', 'mt_rand', 'mt_srand', 'muscat_close', + 'muscat_get', 'muscat_give', 'muscat_setup', 'muscat_setup_net', + 'mysql_affected_rows', 'mysql_change_user', 'mysql_character_set_name', + 'mysql_close', 'mysql_connect', 'mysql_create_db', 'mysql_data_seek', + 'mysql_db_name', 'mysql_db_query', 'mysql_drop_db', 'mysql_errno', + 'mysql_error', 'mysql_escape_string', 'mysql_fetch_array', + 'mysql_fetch_assoc', 'mysql_fetch_field', 'mysql_fetch_lengths', + 'mysql_fetch_object', 'mysql_fetch_row', 'mysql_field_flags', + 'mysql_field_len', 'mysql_field_name', 'mysql_field_seek', + 'mysql_field_table', 'mysql_field_type', 'mysql_free_result', + 'mysql_get_client_info', 'mysql_get_host_info', 'mysql_get_proto_info', + 'mysql_get_server_info', 'mysql_info', 'mysql_insert_id', + 'mysql_list_dbs', 'mysql_list_fields', 'mysql_list_processes', + 'mysql_list_tables', 'mysql_num_fields', 'mysql_num_rows', + 'mysql_pconnect', 'mysql_ping', 'mysql_query', 'mysql_real_escape_string', + 'mysql_result', 'mysql_select_db', 'mysql_stat', 'mysql_tablename', + 'mysql_thread_id', 'mysql_unbuffered_query', 'natcasesort', 'natsort', + 'ncur', 'ncurses_addch', 'ncurses_addchnstr', 'ncurses_addchstr', + 'ncurses_addnstr', 'ncurses_addstr', 'ncurses_assume_default_colors', + 'ncurses_attroff', 'ncurses_attron', 'ncurses_attrset', + 'ncurses_baudrate', 'ncurses_beep', 'ncurses_bkgd', 'ncurses_bkgdset', + 'ncurses_border', 'ncurses_can_change_color', 'ncurses_cbreak', + 'ncurses_clear', 'ncurses_clrtobot', 'ncurses_clrtoeol', + 'ncurses_color_set', 'ncurses_curs_set', 'ncurses_def_prog_mode', + 'ncurses_def_shell_mode', 'ncurses_define_key', 'ncurses_delay_output', + 'ncurses_delch', 'ncurses_deleteln', 'ncurses_delwin', 'ncurses_doupdate', + 'ncurses_echo', 'ncurses_echochar', 'ncurses_end', 'ncurses_erase', + 'ncurses_erasechar', 'ncurses_filter', 'ncurses_flash', + 'ncurses_flushinp', 'ncurses_getch', 'ncurses_getmouse', + 'ncurses_halfdelay', 'ncurses_has_ic', 'ncurses_has_il', + 'ncurses_has_key', 'ncurses_hline', 'ncurses_inch', 'ncurses_init', + 'ncurses_init_color', 'ncurses_init_pair', 'ncurses_insch', + 'ncurses_insdelln', 'ncurses_insertln', 'ncurses_insstr', 'ncurses_instr', + 'ncurses_isendwin', 'ncurses_keyok', 'ncurses_killchar', + 'ncurses_longname', 'ncurses_mouseinterval', 'ncurses_mousemask', + 'ncurses_move', 'ncurses_mvaddch', 'ncurses_mvaddchnstr', + 'ncurses_mvaddchstr', 'ncurses_mvaddnstr', 'ncurses_mvaddstr', + 'ncurses_mvcur', 'ncurses_mvdelch', 'ncurses_mvgetch', 'ncurses_mvhline', + 'ncurses_mvinch', 'ncurses_mvvline', 'ncurses_mvwaddstr', 'ncurses_napms', + 'ncurses_newwin', 'ncurses_nl', 'ncurses_nocbreak', 'ncurses_noecho', + 'ncurses_nonl', 'ncurses_noqiflush', 'ncurses_noraw', 'ncurses_putp', + 'ncurses_qiflush', 'ncurses_raw', 'ncurses_refresh', 'ncurses_resetty', + 'ncurses_savetty', 'ncurses_scr_dump', 'ncurses_scr_init', + 'ncurses_scr_restore', 'ncurses_scr_set', 'ncurses_scrl', + 'ncurses_slk_attr', 'ncurses_slk_attroff', 'ncurses_slk_attron', + 'ncurses_slk_attrset', 'ncurses_slk_clear', 'ncurses_slk_color', + 'ncurses_slk_init', 'ncurses_slk_noutrefresh', 'ncurses_slk_refresh', + 'ncurses_slk_restore', 'ncurses_slk_touch', 'ncurses_standend', + 'ncurses_standout', 'ncurses_start_color', 'ncurses_termattrs', + 'ncurses_termname', 'ncurses_timeout', 'ncurses_typeahead', + 'ncurses_ungetch', 'ncurses_ungetmouse', 'ncurses_use_default_colors', + 'ncurses_use_env', 'ncurses_use_extended_names', 'ncurses_vidattr', + 'ncurses_vline', 'ncurses_wrefresh', 'next', 'ngettext', 'nl2br', + 'nl_langinfo', 'notes_body', 'notes_copy_db', 'notes_create_db', + 'notes_create_note', 'notes_drop_db', 'notes_find_note', + 'notes_header_info', 'notes_list_msgs', 'notes_mark_read', + 'notes_mark_unread', 'notes_nav_create', 'notes_search', 'notes_unread', + 'notes_version', 'number_format', 'ob_clean', 'ob_end_clean', + 'ob_end_flush', 'ob_flush', 'ob_get_contents', 'ob_get_length', + 'ob_get_level', 'ob_gzhandler', 'ob_iconv_handler', 'ob_implicit_flush', + 'ob_start', 'ocibindbyname', 'ocicancel', 'ocicollappend', + 'ocicollassign', 'ocicollassignelem', 'ocicollgetelem', 'ocicollmax', + 'ocicollsize', 'ocicolltrim', 'ocicolumnisnull', 'ocicolumnname', + 'ocicolumnprecision', 'ocicolumnscale', 'ocicolumnsize', 'ocicolumntype', + 'ocicolumntyperaw', 'ocicommit', 'ocidefinebyname', 'ocierror', + 'ociexecute', 'ocifetch', 'ocifetchinto', 'ocifetchstatement', + 'ocifreecollection', 'ocifreecursor', 'ocifreedesc', 'ocifreestatement', + 'ociinternaldebug', 'ociloadlob', 'ocilogoff', 'ocilogon', + 'ocinewcollection', 'ocinewcursor', 'ocinewdescriptor', 'ocinlogon', + 'ocinumcols', 'ociparse', 'ociplogon', 'ociresult', 'ocirollback', + 'ocirowcount', 'ocisavelob', 'ocisavelobfile', 'ociserverversion', + 'ocisetprefetch', 'ocistatementtype', 'ociwritelobtofile', 'octdec', + 'odbc_autocommit', 'odbc_binmode', 'odbc_close', 'odbc_close_all', + 'odbc_columnprivileges', 'odbc_columns', 'odbc_commit', 'odbc_connect', + 'odbc_cursor', 'odbc_do', 'odbc_error', 'odbc_errormsg', 'odbc_exec', + 'odbc_execute', 'odbc_fetch_array', 'odbc_fetch_into', + 'odbc_fetch_object', 'odbc_fetch_row', 'odbc_field_len', + 'odbc_field_name', 'odbc_field_num', 'odbc_field_precision', + 'odbc_field_scale', 'odbc_field_type', 'odbc_foreignkeys', + 'odbc_free_result', 'odbc_gettypeinfo', 'odbc_longreadlen', + 'odbc_next_result', 'odbc_num_fields', 'odbc_num_rows', 'odbc_pconnect', + 'odbc_prepare', 'odbc_primarykeys', 'odbc_procedurecolumns', + 'odbc_procedures', 'odbc_result', 'odbc_result_all', 'odbc_rollback', + 'odbc_setoption', 'odbc_specialcolumns', 'odbc_statistics', + 'odbc_tableprivileges', 'odbc_tables', 'opendir', 'openlog', + 'openssl_csr_export', 'openssl_csr_export_to_file', 'openssl_csr_new', + 'openssl_csr_sign', 'openssl_error_string', 'openssl_free_key', + 'openssl_get_privatekey', 'openssl_get_publickey', 'openssl_open', + 'openssl_pkcs7_decrypt', 'openssl_pkcs7_encrypt', 'openssl_pkcs7_sign', + 'openssl_pkcs7_verify', 'openssl_pkey_export', + 'openssl_pkey_export_to_file', 'openssl_pkey_new', + 'openssl_private_decrypt', 'openssl_private_encrypt', + 'openssl_public_decrypt', 'openssl_public_encrypt', 'openssl_seal', + 'openssl_sign', 'openssl_verify', 'openssl_x509_check_private_key', + 'openssl_x509_checkpurpose', 'openssl_x509_export', + 'openssl_x509_export_to_file', 'openssl_x509_free', 'openssl_x509_parse', + 'openssl_x509_read', 'ora_bind', 'ora_close', 'ora_columnname', + 'ora_columnsize', 'ora_columntype', 'ora_commit', 'ora_commitoff', + 'ora_commiton', 'ora_do', 'ora_error', 'ora_errorcode', 'ora_exec', + 'ora_fetch', 'ora_fetch_into', 'ora_getcolumn', 'ora_logoff', 'ora_logon', + 'ora_numcols', 'ora_numrows', 'ora_open', 'ora_parse', 'ora_plogon', + 'ora_rollback', 'ord', 'overload', 'ovrimos_close', 'ovrimos_commit', + 'ovrimos_connect', 'ovrimos_cursor', 'ovrimos_exec', 'ovrimos_execute', + 'ovrimos_fetch_into', 'ovrimos_fetch_row', 'ovrimos_field_len', + 'ovrimos_field_name', 'ovrimos_field_num', 'ovrimos_field_type', + 'ovrimos_free_result', 'ovrimos_longreadlen', 'ovrimos_num_fields', + 'ovrimos_num_rows', 'ovrimos_prepare', 'ovrimos_result', + 'ovrimos_result_all', 'ovrimos_rollback', 'pack', 'parse_ini_file', + 'parse_str', 'parse_url', 'passthru', 'pathinfo', 'pclose', 'pcntl_exec', + 'pcntl_fork', 'pcntl_signal', 'pcntl_waitpid', 'pcntl_wexitstatus', + 'pcntl_wifexited', 'pcntl_wifsignaled', 'pcntl_wifstopped', + 'pcntl_wstopsig', 'pcntl_wtermsig', 'pdf_add_annotation', + 'pdf_add_bookmark', 'pdf_add_launchlink', 'pdf_add_locallink', + 'pdf_add_note', 'pdf_add_outline', 'pdf_add_pdflink', 'pdf_add_thumbnail', + 'pdf_add_weblink', 'pdf_arc', 'pdf_arcn', 'pdf_attach_file', + 'pdf_begin_page', 'pdf_begin_pattern', 'pdf_begin_template', 'pdf_circle', + 'pdf_clip', 'pdf_close', 'pdf_close_image', 'pdf_close_pdi', + 'pdf_close_pdi_page', 'pdf_closepath', 'pdf_closepath_fill_stroke', + 'pdf_closepath_stroke', 'pdf_concat', 'pdf_continue_text', 'pdf_curveto', + 'pdf_delete', 'pdf_end_page', 'pdf_end_pattern', 'pdf_end_template', + 'pdf_endpath', 'pdf_fill', 'pdf_fill_stroke', 'pdf_findfont', + 'pdf_get_buffer', 'pdf_get_font', 'pdf_get_fontname', 'pdf_get_fontsize', + 'pdf_get_image_height', 'pdf_get_image_width', 'pdf_get_majorversion', + 'pdf_get_minorversion', 'pdf_get_parameter', 'pdf_get_pdi_value', + 'pdf_get_value', 'pdf_initgraphics', 'pdf_lineto', 'pdf_makespotcolor', + 'pdf_moveto', 'pdf_new', 'pdf_open', 'pdf_open_ccitt', 'pdf_open_file', + 'pdf_open_gif', 'pdf_open_image', 'pdf_open_image_file', 'pdf_open_jpeg', + 'pdf_open_memory_image', 'pdf_open_pdi', 'pdf_open_pdi_page', + 'pdf_open_png', 'pdf_open_tiff', 'pdf_place_image', 'pdf_place_pdi_page', + 'pdf_rect', 'pdf_restore', 'pdf_rotate', 'pdf_save', 'pdf_scale', + 'pdf_set_border_color', 'pdf_set_border_dash', 'pdf_set_border_style', + 'pdf_set_char_spacing', 'pdf_set_duration', 'pdf_set_font', + 'pdf_set_horiz_scaling', 'pdf_set_info', 'pdf_set_info_author', + 'pdf_set_info_creator', 'pdf_set_info_keywords', 'pdf_set_info_subject', + 'pdf_set_info_title', 'pdf_set_leading', 'pdf_set_parameter', + 'pdf_set_text_pos', 'pdf_set_text_rendering', 'pdf_set_text_rise', + 'pdf_set_transition', 'pdf_set_value', 'pdf_set_word_spacing', + 'pdf_setcolor', 'pdf_setdash', 'pdf_setflat', 'pdf_setfont', + 'pdf_setgray', 'pdf_setgray_fill', 'pdf_setgray_stroke', 'pdf_setlinecap', + 'pdf_setlinejoin', 'pdf_setlinewidth', 'pdf_setmatrix', + 'pdf_setmiterlimit', 'pdf_setpolydash', 'pdf_setrgbcolor', + 'pdf_setrgbcolor_fill', 'pdf_setrgbcolor_stroke', 'pdf_show', + 'pdf_show_boxed', 'pdf_show_xy', 'pdf_skew', 'pdf_stringwidth', + 'pdf_stroke', 'pdf_translate', 'pfpro_cleanup', 'pfpro_init', + 'pfpro_process', 'pfpro_process_raw', 'pfpro_version', 'pfsockopen', + 'pg_affected_rows', 'pg_cancel_query', 'pg_client_encoding', 'pg_close', + 'pg_connect', 'pg_connection_busy', 'pg_connection_reset', + 'pg_connection_status', 'pg_copy_from', 'pg_copy_to', 'pg_dbname', + 'pg_end_copy', 'pg_escape_bytea', 'pg_escape_string', 'pg_fetch_array', + 'pg_fetch_object', 'pg_fetch_result', 'pg_fetch_row', 'pg_field_is_null', + 'pg_field_name', 'pg_field_num', 'pg_field_prtlen', 'pg_field_size', + 'pg_field_type', 'pg_free_result', 'pg_get_result', 'pg_host', + 'pg_last_error', 'pg_last_notice', 'pg_last_oid', 'pg_lo_close', + 'pg_lo_create', 'pg_lo_export', 'pg_lo_import', 'pg_lo_open', + 'pg_lo_read', 'pg_lo_seek', 'pg_lo_tell', 'pg_lo_unlink', 'pg_lo_write', + 'pg_num_fields', 'pg_num_rows', 'pg_options', 'pg_pconnect', 'pg_port', + 'pg_put_line', 'pg_query', 'pg_result_error', 'pg_result_status', + 'pg_send_query', 'pg_set_client_encoding', 'pg_trace', 'pg_tty', + 'pg_untrace', 'php_logo_guid', 'php_sapi_name', 'php_uname', 'phpcredits', + 'phpinfo', 'phpversion', 'pi', 'png2wbmp', 'popen', 'pos', 'posix_ctermid', + 'posix_getcwd', 'posix_getegid', 'posix_geteuid', 'posix_getgid', + 'posix_getgrgid', 'posix_getgrnam', 'posix_getgroups', 'posix_getlogin', + 'posix_getpgid', 'posix_getpgrp', 'posix_getpid', 'posix_getppid', + 'posix_getpwnam', 'posix_getpwuid', 'posix_getrlimit', 'posix_getsid', + 'posix_getuid', 'posix_isatty', 'posix_kill', 'posix_mkfifo', + 'posix_setegid', 'posix_seteuid', 'posix_setgid', 'posix_setpgid', + 'posix_setsid', 'posix_setuid', 'posix_times', 'posix_ttyname', + 'posix_uname', 'pow', 'preg_grep', 'preg_match', 'preg_match_all', + 'preg_quote', 'preg_replace', 'preg_replace_callback', 'preg_split', + 'prev', 'print', 'print_r', 'printer_abort', 'printer_close', + 'printer_create_brush', 'printer_create_dc', 'printer_create_font', + 'printer_create_pen', 'printer_delete_brush', 'printer_delete_dc', + 'printer_delete_font', 'printer_delete_pen', 'printer_draw_bmp', + 'printer_draw_chord', 'printer_draw_elipse', 'printer_draw_line', + 'printer_draw_pie', 'printer_draw_rectangle', 'printer_draw_roundrect', + 'printer_draw_text', 'printer_end_doc', 'printer_end_page', + 'printer_get_option', 'printer_list', 'printer_logical_fontheight', + 'printer_open', 'printer_select_brush', 'printer_select_font', + 'printer_select_pen', 'printer_set_option', 'printer_start_doc', + 'printer_start_page', 'printer_write', 'printf', 'pspell_add_to_personal', + 'pspell_add_to_session', 'pspell_check', 'pspell_clear_session', + 'pspell_config_create', 'pspell_config_ignore', 'pspell_config_mode', + 'pspell_config_personal', 'pspell_config_repl', + 'pspell_config_runtogether', 'pspell_config_save_repl', 'pspell_new', + 'pspell_new_config', 'pspell_new_personal', 'pspell_save_wordlist', + 'pspell_store_replacement', 'pspell_suggest', 'putenv', 'qdom_error', + 'qdom_tree', 'quoted_printable_decode', 'quotemeta', 'rad2deg', 'rand', + 'range', 'rawurldecode', 'rawurlencode', 'read_exif_data', 'readdir', + 'readfile', 'readgzfile', 'readline', 'readline_add_history', + 'readline_clear_history', 'readline_completion_function', 'readline_info', + 'readline_list_history', 'readline_read_history', 'readline_write_history', + 'readlink', 'realpath', 'recode', 'recode_file', 'recode_string', + 'register_shutdown_function', 'register_tick_function', 'rename', + 'require', 'require_once', 'reset', 'restore_error_handler', + 'restore_include_path', 'rewind', 'rewinddir', 'rmdir', 'round', 'rsort', + 'rtrim', 'sem_acquire', 'sem_get', 'sem_release', 'sem_remove', + 'serialize', 'sesam_affected_rows', 'sesam_commit', 'sesam_connect', + 'sesam_diagnostic', 'sesam_disconnect', 'sesam_errormsg', 'sesam_execimm', + 'sesam_fetch_array', 'sesam_fetch_result', 'sesam_fetch_row', + 'sesam_field_array', 'sesam_field_name', 'sesam_free_result', + 'sesam_num_fields', 'sesam_query', 'sesam_rollback', 'sesam_seek_row', + 'sesam_settransaction', 'session_cache_expire', 'session_cache_limiter', + 'session_decode', 'session_destroy', 'session_encode', + 'session_get_cookie_params', 'session_id', 'session_is_registered', + 'session_module_name', 'session_name', 'session_register', + 'session_save_path', 'session_set_cookie_params', + 'session_set_save_handler', 'session_start', 'session_unregister', + 'session_unset', 'session_write_close', 'set_error_handler', + 'set_file_buffer', 'set_include_path', 'set_magic_quotes_runtime', + 'set_time_limit', 'setcookie', 'setlocale', 'settype', 'shell_exec', + 'shm_attach', 'shm_detach', 'shm_get_var', 'shm_put_var', 'shm_remove', + 'shm_remove_var', 'shmop_close', 'shmop_delete', 'shmop_open', + 'shmop_read', 'shmop_size', 'shmop_write', 'show_source', 'shuffle', + 'similar_text', 'sin', 'sinh', 'sizeof', 'sleep', 'snmp_get_quick_print', + 'snmp_set_quick_print', 'snmpget', 'snmprealwalk', 'snmpset', 'snmpwalk', + 'snmpwalkoid', 'socket_accept', 'socket_bind', 'socket_close', + 'socket_connect', 'socket_create', 'socket_create_listen', + 'socket_create_pair', 'socket_fd_alloc', 'socket_fd_clear', + 'socket_fd_free', 'socket_fd_isset', 'socket_fd_set', 'socket_fd_zero', + 'socket_get_status', 'socket_getopt', 'socket_getpeername', + 'socket_getsockname', 'socket_iovec_add', 'socket_iovec_alloc', + 'socket_iovec_delete', 'socket_iovec_fetch', 'socket_iovec_free', + 'socket_iovec_set', 'socket_last_error', 'socket_listen', 'socket_read', + 'socket_readv', 'socket_recv', 'socket_recvfrom', 'socket_recvmsg', + 'socket_select', 'socket_send', 'socket_sendmsg', 'socket_sendto', + 'socket_set_blocking', 'socket_set_nonblock', 'socket_set_timeout', + 'socket_setopt', 'socket_shutdown', 'socket_strerror', 'socket_write', + 'socket_writev', 'sort', 'soundex', 'split', 'spliti', 'sprintf', + 'sql_regcase', 'sqrt', 'srand', 'sscanf', 'stat', 'str_pad', 'str_repeat', + 'str_replace', 'str_rot13', 'strcasecmp', 'strchr', 'strcmp', 'strcoll', + 'strcspn', 'strftime', 'strip_tags', 'stripcslashes', 'stripslashes', + 'stristr', 'strlen', 'strnatcasecmp', 'strnatcmp', 'strncasecmp', + 'strncmp', 'strpos', 'strrchr', 'strrev', 'strrpos', 'strspn', 'strstr', + 'strtok', 'strtolower', 'strtotime', 'strtoupper', 'strtr', 'strval', + 'substr', 'substr_count', 'substr_replace', 'swf_actiongeturl', + 'swf_actiongotoframe', 'swf_actiongotolabel', 'swf_actionnextframe', + 'swf_actionplay', 'swf_actionprevframe', 'swf_actionsettarget', + 'swf_actionstop', 'swf_actiontogglequality', 'swf_actionwaitforframe', + 'swf_addbuttonrecord', 'swf_addcolor', 'swf_closefile', + 'swf_definebitmap', 'swf_definefont', 'swf_defineline', 'swf_definepoly', + 'swf_definerect', 'swf_definetext', 'swf_endbutton', 'swf_enddoaction', + 'swf_endshape', 'swf_endsymbol', 'swf_fontsize', 'swf_fontslant', + 'swf_fonttracking', 'swf_getbitmapinfo', 'swf_getfontinfo', + 'swf_getframe', 'swf_labelframe', 'swf_lookat', 'swf_modifyobject', + 'swf_mulcolor', 'swf_nextid', 'swf_oncondition', 'swf_openfile', + 'swf_ortho', 'swf_ortho2', 'swf_perspective', 'swf_placeobject', + 'swf_polarview', 'swf_popmatrix', 'swf_posround', 'swf_pushmatrix', + 'swf_removeobject', 'swf_rotate', 'swf_scale', 'swf_setfont', + 'swf_setframe', 'swf_shapearc', 'swf_shapecurveto', 'swf_shapecurveto3', + 'swf_shapefillbitmapclip', 'swf_shapefillbitmaptile', 'swf_shapefilloff', + 'swf_shapefillsolid', 'swf_shapelinesolid', 'swf_shapelineto', + 'swf_shapemoveto', 'swf_showframe', 'swf_startbutton', + 'swf_startdoaction', 'swf_startshape', 'swf_startsymbol', 'swf_textwidth', + 'swf_translate', 'swf_viewport', 'swfaction', 'swfbitmap', + 'swfbitmap.getheight', 'swfbitmap.getwidth', 'swfbutton', + 'swfbutton.addaction', 'swfbutton.addshape', 'swfbutton.setaction', + 'swfbutton.setdown', 'swfbutton.sethit', 'swfbutton.setover', + 'swfbutton.setup', 'swfbutton_keypress', 'swfdisplayitem', + 'swfdisplayitem.addcolor', 'swfdisplayitem.move', 'swfdisplayitem.moveto', + 'swfdisplayitem.multcolor', 'swfdisplayitem.remove', + 'swfdisplayitem.rotate', 'swfdisplayitem.rotateto', + 'swfdisplayitem.scale', 'swfdisplayitem.scaleto', + 'swfdisplayitem.setdepth', 'swfdisplayitem.setname', + 'swfdisplayitem.setratio', 'swfdisplayitem.skewx', + 'swfdisplayitem.skewxto', 'swfdisplayitem.skewy', + 'swfdisplayitem.skewyto', 'swffill', 'swffill.moveto', 'swffill.rotateto', + 'swffill.scaleto', 'swffill.skewxto', 'swffill.skewyto', 'swffont', + 'swffont.getwidth', 'swfgradient', 'swfgradient.addentry', 'swfmorph', + 'swfmorph.getshape1', 'swfmorph.getshape2', 'swfmovie', 'swfmovie.add', + 'swfmovie.nextframe', 'swfmovie.output', 'swfmovie.remove', + 'swfmovie.save', 'swfmovie.setbackground', 'swfmovie.setdimension', + 'swfmovie.setframes', 'swfmovie.setrate', 'swfmovie.streammp3', + 'swfshape', 'swfshape.addfill', 'swfshape.drawcurve', + 'swfshape.drawcurveto', 'swfshape.drawline', 'swfshape.drawlineto', + 'swfshape.movepen', 'swfshape.movepento', 'swfshape.setleftfill', + 'swfshape.setline', 'swfshape.setrightfill', 'swfsprite', 'swfsprite.add', + 'swfsprite.nextframe', 'swfsprite.remove', 'swfsprite.setframes', + 'swftext', 'swftext.addstring', 'swftext.getwidth', 'swftext.moveto', + 'swftext.setcolor', 'swftext.setfont', 'swftext.setheight', + 'swftext.setspacing', 'swftextfield', 'swftextfield.addstring', + 'swftextfield.align', 'swftextfield.setbounds', 'swftextfield.setcolor', + 'swftextfield.setfont', 'swftextfield.setheight', + 'swftextfield.setindentation', 'swftextfield.setleftmargin', + 'swftextfield.setlinespacing', 'swftextfield.setmargins', + 'swftextfield.setname', 'swftextfield.setrightmargin', + 'sybase_affected_rows', 'sybase_close', 'sybase_connect', + 'sybase_data_seek', 'sybase_fetch_array', 'sybase_fetch_field', + 'sybase_fetch_object', 'sybase_fetch_row', 'sybase_field_seek', + 'sybase_free_result', 'sybase_get_last_message', + 'sybase_min_client_severity', 'sybase_min_error_severity', + 'sybase_min_message_severity', 'sybase_min_server_severity', + 'sybase_num_fields', 'sybase_num_rows', 'sybase_pconnect', 'sybase_query', + 'sybase_result', 'sybase_select_db', 'symlink', 'syslog', 'system', 'tan', + 'tanh', 'tempnam', 'textdomain', 'time', 'tmpfile', 'touch', + 'trigger_error', 'trim', 'uasort', 'ucfirst', 'ucwords', + 'udm_add_search_limit', 'udm_alloc_agent', 'udm_api_version', + 'udm_cat_list', 'udm_cat_path', 'udm_check_charset', 'udm_check_stored', + 'udm_clear_search_limits', 'udm_close_stored', 'udm_crc32', 'udm_errno', + 'udm_error', 'udm_find', 'udm_free_agent', 'udm_free_ispell_data', + 'udm_free_res', 'udm_get_doc_count', 'udm_get_res_field', + 'udm_get_res_param', 'udm_load_ispell_data', 'udm_open_stored', + 'udm_set_agent_param', 'uksort', 'umask', 'uniqid', 'unixtojd', 'unlink', + 'unpack', 'unregister_tick_function', 'unserialize', 'unset', 'urldecode', + 'urlencode', 'user_error', 'usleep', 'usort', 'utf8_decode', 'utf8_encode', + 'var_dump', 'var_export', 'variant', 'version_compare', 'virtual', 'vpo', + 'vpopmail_add_alias_domain', 'vpopmail_add_alias_domain_ex', + 'vpopmail_add_domain', 'vpopmail_add_domain_ex', 'vpopmail_add_user', + 'vpopmail_alias_add', 'vpopmail_alias_del', 'vpopmail_alias_del_domain', + 'vpopmail_alias_get', 'vpopmail_alias_get_all', 'vpopmail_auth_user', + 'vpopmail_del_domain_ex', 'vpopmail_del_user', 'vpopmail_error', + 'vpopmail_passwd', 'vpopmail_set_user_quota', 'vprintf', 'vsprintf', + 'w32api_deftype', 'w32api_init_dtype', 'w32api_invoke_function', + 'w32api_register_function', 'w32api_set_call_method', 'wddx_add_vars', + 'wddx_deserialize', 'wddx_packet_end', 'wddx_packet_start', + 'wddx_serialize_value', 'wddx_serialize_vars', 'wordwrap', + 'xml_error_string', 'xml_get_current_byte_index', + 'xml_get_current_column_number', 'xml_get_current_line_number', + 'xml_get_error_code', 'xml_parse', 'xml_parse_into_struct', + 'xml_parser_create', 'xml_parser_create_ns', 'xml_parser_free', + 'xml_parser_get_option', 'xml_parser_set_option', + 'xml_set_character_data_handler', 'xml_set_default_handler', + 'xml_set_element_handler', 'xml_set_end_namespace_decl_handler', + 'xml_set_external_entity_ref_handler', 'xml_set_notation_decl_handler', + 'xml_set_object', 'xml_set_processing_instruction_handler', + 'xml_set_start_namespace_decl_handler', + 'xml_set_unparsed_entity_decl_handler', 'xmldoc', 'xmldocfile', + 'xmlrpc_decode', 'xmlrpc_decode_request', 'xmlrpc_encode', + 'xmlrpc_encode_request', 'xmlrpc_get_type', + 'xmlrpc_parse_method_descriptions', + 'xmlrpc_server_add_introspection_data', 'xmlrpc_server_call_method', + 'xmlrpc_server_create', 'xmlrpc_server_destroy', + 'xmlrpc_server_register_introspection_callback', + 'xmlrpc_server_register_method', 'xmlrpc_set_type', 'xmltree', + 'xpath_eval', 'xpath_eval_expression', 'xpath_new_context', 'xptr_eval', + 'xptr_new_context', 'xslt_create', 'xslt_errno', 'xslt_error', + 'xslt_free', 'xslt_process', 'xslt_set_base', 'xslt_set_encoding', + 'xslt_set_error_handler', 'xslt_set_log', 'xslt_set_sax_handler', + 'xslt_set_sax_handlers', 'xslt_set_scheme_handler', + 'xslt_set_scheme_handlers', 'yaz_addinfo', 'yaz_ccl_conf', + 'yaz_ccl_parse', 'yaz_close', 'yaz_connect', 'yaz_database', + 'yaz_element', 'yaz_errno', 'yaz_error', 'yaz_hits', 'yaz_itemorder', + 'yaz_present', 'yaz_range', 'yaz_record', 'yaz_scan', 'yaz_scan_result', + 'yaz_search', 'yaz_sort', 'yaz_syntax', 'yaz_wait', 'yp_all', 'yp_cat', + 'yp_err_string', 'yp_errno', 'yp_first', 'yp_get_default_domain', + 'yp_master', 'yp_match', 'yp_next', 'yp_order', 'zend_logo_guid', + 'zend_version', 'zip_close', 'zip_entry_close', + 'zip_entry_compressedsize', 'zip_entry_compressionmethod', + 'zip_entry_filesize', 'zip_entry_name', 'zip_entry_open', + 'zip_entry_read', 'zip_open', 'zip_read' + ), + 1 => $CONTEXT . '/functions', + 2 => 'color:#006;', + 3 => false, + 4 => 'http://www.php.net/{FNAME}' + ) +); + +$this->_contextCharactersDisallowedBeforeKeywords = array('$', '_'); +$this->_contextCharactersDisallowedAfterKeywords = array("'", '_'); +$this->_contextSymbols = array( + 0 => array( + 0 => array( + '(', ')', ',', ';', ':', '[', ']', + '+', '-', '*', '/', '&', '|', '!', '<', '>', + '{', '}', '=', '@' + ), + 1 => $CONTEXT . '/sym0', + 2 => 'color:#008000;' + ) +); +$this->_contextRegexps = array( + 0 => array( + 0 => array( + '#(\$\$?[a-zA-Z_][a-zA-Z0-9_]*)#' + ), + 1 => '$', + 2 => array( + 1 => array($CONTEXT . '/var', 'color:#33f;', false), + ) + ), + 1 => geshi_use_doubles($CONTEXT), + 2 => geshi_use_integers($CONTEXT) +); +$this->_objectSplitters = array( + 0 => array( + 0 => array('->'), + 1 => $CONTEXT . '/oodynamic', + 2 => 'color:#933;', + 3 => false + ), + 1 => array( + 0 => array('::'), + 1 => $CONTEXT . '/oostatic', + 2 => 'color:#933;font-weight:bold;', + 3 => false + ) +); + +?> diff --git a/paste/include/geshi/contexts/php/php5.php b/paste/include/geshi/contexts/php/php5.php new file mode 100644 index 0000000..a1aa93b --- /dev/null +++ b/paste/include/geshi/contexts/php/php5.php @@ -0,0 +1,900 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** Get the GeSHiStringContext class */ +require_once GESHI_CLASSES_ROOT . 'class.geshistringcontext.php'; +/** Get the GeSHiPHPDoubleStringContext class */ +require_once GESHI_CLASSES_ROOT . 'php' . GESHI_DIR_SEPARATOR . 'class.geshiphpdoublestringcontext.php'; + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('<?php', '<?'), + 1 => array('?>'), + 2 => true + ), + 1 => array( + 0 => array('<%'), + 1 => array('%>'), + 2 => false + ) +); + +$this->_childContexts = array( + new GeSHiStringContext('php', $DIALECT, 'common/single_string'), + new GeSHiPHPDoubleStringContext('php', $DIALECT, 'double_string'), + new GeSHiPHPDoubleStringContext('php', $DIALECT, 'heredoc'), + // PHP single comment, with # starter and end-php-context ender + new GeSHiContext('php', $DIALECT, 'single_comment'), + // Use common multi comment since it is a PHP comment... + new GeSHiContext('php', $DIALECT, 'common/multi_comment'), + // doxygen comments + new GeSHiContext('php', $DIALECT, 'doxygen') +); + +$this->_styler->setStyle($CONTEXT_START, 'font-weight:bold;color:#000;'); +$this->_styler->setStyle($CONTEXT_END, 'font-weight:bold;color:#000;'); + +$this->_contextKeywords = array( + 0 => array( + // keywords + 0 => array( + 'as', 'break', 'case', 'continue', 'do', 'declare', 'else', 'elseif', + 'endforeach', 'endif', 'endswitch', 'endwhile', 'for', 'foreach', 'if', + 'include', 'include_once', 'require', 'require_once', 'return', 'switch', + 'while' + ), + // name + 1 => $CONTEXT . '/cstructures', + // style + 2 => 'color:#b1b100;', + // case sensitive + 3 => false, + // url + 4 => '' + ), + 1 => array( + 0 => array( + 'DEFAULT_INCLUDE_PATH', 'E_ALL', 'E_COMPILE_ERROR', 'E_COMPILE_WARNING', + 'E_CORE_ERROR', 'E_CORE_WARNING', 'E_ERROR', 'E_NOTICE', 'E_PARSE', + 'E_STRICT', 'E_USER_ERROR', 'E_USER_NOTICE', 'E_USER_WARNING', + 'E_WARNING', 'FALSE', 'NULL', 'PEAR_EXTENSION_DIR', 'PEAR_INSTALL_DIR', + 'PHP_BINDIR', 'PHP_CONFIG_FILE_PATH', 'PHP_DATADIR', 'PHP_EXTENSION_DIR', + 'PHP_LIBDIR', 'PHP_LOCALSTATEDIR', 'PHP_OS', 'PHP_OUTPUT_HANDLER_CONT', + 'PHP_OUTPUT_HANDLER_END', 'PHP_OUTPUT_HANDLER_START', 'PHP_SYSCONFDIR', + 'PHP_VERSION', 'TRUE', '__CLASS__', '__FILE__', '__FUNCTION__', + '__LINE__', '__METHOD__', 'abstract', 'catch', 'class', 'default', + 'extends', 'final', 'function', 'implements', 'interface', 'new', + 'parent', 'private', 'protected', 'public', 'self', 'static', 'throw', + 'try', 'var' + ), + 1 => $CONTEXT . '/keywords', + 2 => 'font-weight:bold;color:#000;', + 3 => false, + 4 => '' + ), + 2 => array( + 0 => array( + 'abs', 'acos', 'acosh', 'addcslashes', 'addslashes', + 'apache_child_terminate', 'apache_lookup_uri', 'apache_note', + 'apache_setenv', 'array', 'array_change_key_case', 'array_chunk', + 'array_count_values', 'array_diff', 'array_fill', 'array_filter', + 'array_flip', 'array_intersect', 'array_key_exists', 'array_keys', + 'array_map', 'array_merge', 'array_merge_recursive', 'array_multisort', + 'array_pad', 'array_pop', 'array_push', 'array_rand', 'array_reduce', + 'array_reverse', 'array_search', 'array_shift', 'array_slice', + 'array_splice', 'array_sum', 'array_unique', 'array_unshift', + 'array_values', 'array_walk', 'arsort', 'ascii2ebcdic', 'asin', 'asinh', + 'asort', 'aspell_check', 'aspell_check_raw', 'aspell_new', + 'aspell_suggest', 'assert', 'assert_options', 'atan', 'atan2', 'atanh', + 'base64_decode', 'base64_encode', 'base_convert', 'basename', 'bcadd', + 'bccomp', 'bcdiv', 'bcmod', 'bcmul', 'bcpow', 'bcscale', 'bcsqrt', + 'bcsub', 'bin2hex', 'bind_textdomain_codeset', 'bindec', 'bindtextdomain', + 'bz', 'bzclose', 'bzdecompress', 'bzerrno', 'bzerror', 'bzerrstr', + 'bzflush', 'bzopen', 'bzread', 'bzwrite', 'c', 'cal_days_in_month', + 'cal_from_jd', 'cal_info', 'cal_to_jd', 'call_user_func', + 'call_user_func_array', 'call_user_method', 'call_user_method_array', + 'ccvs_add', 'ccvs_auth', 'ccvs_command', 'ccvs_count', 'ccvs_delete', + 'ccvs_done', 'ccvs_init', 'ccvs_lookup', 'ccvs_new', 'ccvs_report', + 'ccvs_return', 'ccvs_reverse', 'ccvs_sale', 'ccvs_status', + 'ccvs_textvalue', 'ccvs_void', 'ceil', 'chdir', 'checkdate', 'checkdnsrr', + 'chgrp', 'chmod', 'chop', 'chown', 'chr', 'chroot', 'chunk_split', + 'class_exists', 'clearstatcache', 'closedir', 'closelog', 'com', + 'com_addref', 'com_get', 'com_invoke', 'com_isenum', 'com_load', + 'com_load_typelib', 'com_propget', 'com_propput', 'com_propset', + 'com_release', 'com_set', 'compact', 'connection_aborted', + 'connection_status', 'connection_timeout', 'constant', + 'convert_cyr_string', 'copy', 'cos', 'cosh', 'count', 'count_chars', + 'cpdf_add_annotation', 'cpdf_add_outline', 'cpdf_arc', 'cpdf_begin_text', + 'cpdf_circle', 'cpdf_clip', 'cpdf_close', 'cpdf_closepath', + 'cpdf_closepath_fill_stroke', 'cpdf_closepath_stroke', + 'cpdf_continue_text', 'cpdf_curveto', 'cpdf_end_text', 'cpdf_fill', + 'cpdf_fill_stroke', 'cpdf_finalize', 'cpdf_finalize_page', + 'cpdf_global_set_document_limits', 'cpdf_import_jpeg', 'cpdf_lineto', + 'cpdf_moveto', 'cpdf_newpath', 'cpdf_open', 'cpdf_output_buffer', + 'cpdf_page_init', 'cpdf_place_inline_image', 'cpdf_rect', 'cpdf_restore', + 'cpdf_rlineto', 'cpdf_rmoveto', 'cpdf_rotate', 'cpdf_rotate_text', + 'cpdf_save', 'cpdf_save_to_file', 'cpdf_scale', 'cpdf_set_action_url', + 'cpdf_set_char_spacing', 'cpdf_set_creator', 'cpdf_set_current_page', + 'cpdf_set_font', 'cpdf_set_font_directories', 'cpdf_set_font_map_file', + 'cpdf_set_horiz_scaling', 'cpdf_set_keywords', 'cpdf_set_leading', + 'cpdf_set_page_animation', 'cpdf_set_subject', 'cpdf_set_text_matrix', + 'cpdf_set_text_pos', 'cpdf_set_text_rise', 'cpdf_set_title', + 'cpdf_set_viewer_preferences', 'cpdf_set_word_spacing', 'cpdf_setdash', + 'cpdf_setflat', 'cpdf_setgray', 'cpdf_setgray_fill', + 'cpdf_setgray_stroke', 'cpdf_setlinecap', 'cpdf_setlinejoin', + 'cpdf_setlinewidth', 'cpdf_setmiterlimit', 'cpdf_setrgbcolor', + 'cpdf_setrgbcolor_fill', 'cpdf_setrgbcolor_stroke', 'cpdf_show', + 'cpdf_show_xy', 'cpdf_stringwidth', 'cpdf_stroke', 'cpdf_text', + 'cpdf_translate', 'crack_check', 'crack_closedict', + 'crack_getlastmessage', 'crack_opendict', 'crc32', 'create_function', + 'crypt', 'ctype_alnum', 'ctype_alpha', 'ctype_cntrl', 'ctype_digit', + 'ctype_graph', 'ctype_lower', 'ctype_print', 'ctype_punct', 'ctype_space', + 'ctype_upper', 'ctype_xdigit', 'curl_close', 'curl_errno', 'curl_error', + 'curl_exec', 'curl_getinfo', 'curl_init', 'curl_setopt', 'curl_version', + 'current', 'cybercash_base64_decode', 'cybercash_base64_encode', + 'cybercash_decr', 'cybercash_encr', 'cybermut_creerformulairecm', + 'cybermut_creerreponsecm', 'cybermut_testmac', 'cyrus_authenticate', + 'cyrus_bind', 'cyrus_close', 'cyrus_connect', 'cyrus_query', + 'cyrus_unbind', 'date', 'dba_close', 'dba_delete', 'dba_exists', + 'dba_fetch', 'dba_firstkey', 'dba_insert', 'dba_nextkey', 'dba_open', + 'dba_optimize', 'dba_popen', 'dba_replace', 'dba_sync', + 'dbase_add_record', 'dbase_close', 'dbase_create', 'dbase_delete_record', + 'dbase_get_record', 'dbase_get_record_with_names', 'dbase_numfields', + 'dbase_numrecords', 'dbase_open', 'dbase_pack', 'dbase_replace_record', + 'dblist', 'dbmclose', 'dbmdelete', 'dbmexists', 'dbmfetch', 'dbmfirstkey', + 'dbminsert', 'dbmnextkey', 'dbmopen', 'dbmreplace', 'dbp', 'dbplus_add', + 'dbplus_aql', 'dbplus_chdir', 'dbplus_close', 'dbplus_curr', + 'dbplus_errcode', 'dbplus_errno', 'dbplus_find', 'dbplus_first', + 'dbplus_flush', 'dbplus_freealllocks', 'dbplus_freelock', + 'dbplus_freerlocks', 'dbplus_getlock', 'dbplus_getunique', 'dbplus_info', + 'dbplus_last', 'dbplus_lockrel', 'dbplus_next', 'dbplus_open', + 'dbplus_rchperm', 'dbplus_rcreate', 'dbplus_rcrtexact', 'dbplus_rcrtlike', + 'dbplus_resolve', 'dbplus_restorepos', 'dbplus_rkeys', 'dbplus_ropen', + 'dbplus_rquery', 'dbplus_rrename', 'dbplus_rsecindex', 'dbplus_runlink', + 'dbplus_rzap', 'dbplus_savepos', 'dbplus_setindex', + 'dbplus_setindexbynumber', 'dbplus_sql', 'dbplus_tcl', 'dbplus_tremove', + 'dbplus_undo', 'dbplus_undoprepare', 'dbplus_unlockrel', + 'dbplus_unselect', 'dbplus_update', 'dbplus_xlockrel', + 'dbplus_xunlockrel', 'dbx_close', 'dbx_compare', 'dbx_connect', + 'dbx_error', 'dbx_query', 'dbx_sort', 'dcgettext', 'dcngettext', + 'debugger_off', 'debugger_on', 'decbin', 'dechex', 'decoct', 'define', + 'define_syslog_variables', 'defined', 'deg2rad', 'delete', 'dgettext', + 'die', 'dio_close', 'dio_fcntl', 'dio_open', 'dio_read', 'dio_seek', + 'dio_stat', 'dio_truncate', 'dio_write', 'dir', 'dirname', + 'disk_free_space', 'disk_total_space', 'diskfreespace', 'dl', 'dngettext', + 'domxml_add_root', 'domxml_attributes', 'domxml_children', + 'domxml_dumpmem', 'domxml_get_attribute', 'domxml_new_child', + 'domxml_new_xmldoc', 'domxml_node', 'domxml_node_set_content', + 'domxml_node_unlink_node', 'domxml_root', 'domxml_set_attribute', + 'domxml_version', 'dotnet_load', 'doubleval', 'each', 'easter_date', + 'easter_days', 'ebcdic2ascii', 'echo', 'empty', 'end', 'ereg', + 'ereg_replace', 'eregi', 'eregi_replace', 'error_log', 'error_reporting', + 'escapeshellarg', 'escapeshellcmd', 'eval', 'exec', 'exif_imagetype', + 'exif_read_data', 'exif_thumbnail', 'exit', 'exp', 'explode', 'expm1', + 'extension_loaded', 'extract', 'ezmlm_hash', 'fbsql_affected_rows', + 'fbsql_autocommit', 'fbsql_change_user', 'fbsql_close', 'fbsql_commit', + 'fbsql_connect', 'fbsql_create_blob', 'fbsql_create_clob', + 'fbsql_create_db', 'fbsql_data_seek', 'fbsql_database', + 'fbsql_database_password', 'fbsql_db_query', 'fbsql_db_status', + 'fbsql_drop_db', 'fbsql_errno', 'fbsql_error', 'fbsql_fetch_a', + 'fbsql_fetch_assoc', 'fbsql_fetch_field', 'fbsql_fetch_lengths', + 'fbsql_fetch_object', 'fbsql_fetch_row', 'fbsql_field_flags', + 'fbsql_field_len', 'fbsql_field_name', 'fbsql_field_seek', + 'fbsql_field_table', 'fbsql_field_type', 'fbsql_free_result', + 'fbsql_get_autostart_info', 'fbsql_hostname', 'fbsql_insert_id', + 'fbsql_list_dbs', 'fbsql_list_fields', 'fbsql_list_tables', + 'fbsql_next_result', 'fbsql_num_fields', 'fbsql_num_rows', + 'fbsql_password', 'fbsql_pconnect', 'fbsql_query', 'fbsql_read_blob', + 'fbsql_read_clob', 'fbsql_result', 'fbsql_rollback', 'fbsql_select_db', + 'fbsql_set_lob_mode', 'fbsql_set_transaction', 'fbsql_start_db', + 'fbsql_stop_db', 'fbsql_tablename', 'fbsql_username', 'fbsql_warnings', + 'fclose', 'fdf_add_template', 'fdf_close', 'fdf_create', 'fdf_get_file', + 'fdf_get_status', 'fdf_get_value', 'fdf_next_field_name', 'fdf_open', + 'fdf_save', 'fdf_set_ap', 'fdf_set_encoding', 'fdf_set_file', + 'fdf_set_flags', 'fdf_set_javascript_action', 'fdf_set_opt', + 'fdf_set_status', 'fdf_set_submit_form_action', 'fdf_set_value', 'feof', + 'fflush', 'fgetc', 'fgetcsv', 'fgets', 'fgetss', 'fgetwrapperdata', + 'file', 'file_exists', 'file_get_contents', 'fileatime', 'filectime', + 'filegroup', 'fileinode', 'filemtime', 'fileowner', 'fileperms', + 'filepro', 'filepro_fieldcount', 'filepro_fieldname', 'filepro_fieldtype', + 'filepro_fieldwidth', 'filepro_retrieve', 'filepro_rowcount', 'filesize', + 'filetype', 'floatval', 'flock', 'floor', 'flush', 'fopen', 'fpassthru', + 'fputs', 'fread', 'frenchtojd', 'fribidi_log2vis', 'fscanf', 'fseek', + 'fsockopen', 'fstat', 'ftell', 'ftok', 'ftp_cdup', 'ftp_chdir', + 'ftp_close', 'ftp_connect', 'ftp_delete', 'ftp_exec', 'ftp_fget', + 'ftp_fput', 'ftp_get', 'ftp_get_option', 'ftp_login', 'ftp_mdtm', + 'ftp_mkdir', 'ftp_nlist', 'ftp_pasv', 'ftp_put', 'ftp_pwd', 'ftp_quit', + 'ftp_rawlist', 'ftp_rename', 'ftp_rmdir', 'ftp_set_option', 'ftp_site', + 'ftp_size', 'ftp_systype', 'ftruncate', 'func_get_arg', 'func_get_args', + 'func_num_args', 'function_exists', 'fwrite', 'get_browser', + 'get_cfg_var', 'get_class', 'get_class_methods', 'get_class_vars', + 'get_current_user', 'get_declared_classes', 'get_defined_constants', + 'get_defined_functions', 'get_defined_vars', 'get_extension_funcs', + 'get_html_translation_table', 'get_include_p', 'get_included_files', + 'get_loaded_extensions', 'get_magic_quotes_gpc', + 'get_magic_quotes_runtime', 'get_meta_tags', 'get_object_vars', + 'get_parent_class', 'get_required_files', 'get_resource_type', + 'getallheaders', 'getcwd', 'getdate', 'getenv', 'gethostbyaddr', + 'gethostbyname', 'gethostbynamel', 'getimagesize', 'getlastmod', + 'getmxrr', 'getmygid', 'getmyinode', 'getmypid', 'getmyuid', + 'getprotobyname', 'getprotobynumber', 'getrandmax', 'getrusage', + 'getservbyname', 'getservbyport', 'gettext', 'gettimeofday', 'gettype', + 'global', 'gmdate', 'gmmktime', 'gmp_abs', 'gmp_add', 'gmp_and', + 'gmp_clrbit', 'gmp_cmp', 'gmp_com', 'gmp_div', 'gmp_div_q', 'gmp_div_qr', + 'gmp_div_r', 'gmp_divexact', 'gmp_fact', 'gmp_gcd', 'gmp_gcdext', + 'gmp_hamdist', 'gmp_init', 'gmp_intval', 'gmp_invert', 'gmp_jacobi', + 'gmp_legendre', 'gmp_mod', 'gmp_mul', 'gmp_neg', 'gmp_or', + 'gmp_perfect_square', 'gmp_popcount', 'gmp_pow', 'gmp_powm', + 'gmp_prob_prime', 'gmp_random', 'gmp_scan0', 'gmp_scan1', 'gmp_setbit', + 'gmp_sign', 'gmp_sqrt', 'gmp_sqrtrem', 'gmp_strval', 'gmp_sub', 'gmp_xor', + 'gmstrftime', 'gregoriantojd', 'gzclose', 'gzcompress', 'gzdeflate', + 'gzencode', 'gzeof', 'gzfile', 'gzgetc', 'gzgets', 'gzgetss', 'gzinflate', + 'gzopen', 'gzpassthru', 'gzputs', 'gzread', 'gzrewind', 'gzseek', 'gztell', + 'gzuncompress', 'gzwrite', 'header', 'headers_sent', 'hebrev', 'hebrevc', + 'hexdec', 'highlight_file', 'highlight_string', 'htmlentities', + 'htmlspecialchars', 'hw_array2objrec', 'hw_c', 'hw_children', + 'hw_childrenobj', 'hw_close', 'hw_connect', 'hw_connection_info', 'hw_cp', + 'hw_deleteobject', 'hw_docbyanchor', 'hw_docbyanchorobj', + 'hw_document_attributes', 'hw_document_bodytag', 'hw_document_content', + 'hw_document_setcontent', 'hw_document_size', 'hw_dummy', 'hw_edittext', + 'hw_error', 'hw_errormsg', 'hw_free_document', 'hw_getanchors', + 'hw_getanchorsobj', 'hw_getandlock', 'hw_getchildcoll', + 'hw_getchildcollobj', 'hw_getchilddoccoll', 'hw_getchilddoccollobj', + 'hw_getobject', 'hw_getobjectbyquery', 'hw_getobjectbyquerycoll', + 'hw_getobjectbyquerycollobj', 'hw_getobjectbyqueryobj', 'hw_getparents', + 'hw_getparentsobj', 'hw_getrellink', 'hw_getremote', + 'hw_getremotechildren', 'hw_getsrcbydestobj', 'hw_gettext', + 'hw_getusername', 'hw_identify', 'hw_incollections', 'hw_info', + 'hw_inscoll', 'hw_insdoc', 'hw_insertanchors', 'hw_insertdocument', + 'hw_insertobject', 'hw_mapid', 'hw_modifyobject', 'hw_mv', + 'hw_new_document', 'hw_objrec2array', 'hw_output_document', 'hw_pconnect', + 'hw_pipedocument', 'hw_root', 'hw_setlinkroot', 'hw_stat', 'hw_unlock', + 'hw_who', 'hypot', 'i', 'ibase_blob_add', 'ibase_blob_cancel', + 'ibase_blob_close', 'ibase_blob_create', 'ibase_blob_echo', + 'ibase_blob_get', 'ibase_blob_import', 'ibase_blob_info', + 'ibase_blob_open', 'ibase_close', 'ibase_commit', 'ibase_connect', + 'ibase_errmsg', 'ibase_execute', 'ibase_fetch_object', 'ibase_fetch_row', + 'ibase_field_info', 'ibase_free_query', 'ibase_free_result', + 'ibase_num_fields', 'ibase_pconnect', 'ibase_prepare', 'ibase_query', + 'ibase_rollback', 'ibase_timefmt', 'ibase_trans', 'icap_close', + 'icap_create_calendar', 'icap_delete_calendar', 'icap_delete_event', + 'icap_fetch_event', 'icap_list_alarms', 'icap_list_events', 'icap_open', + 'icap_rename_calendar', 'icap_reopen', 'icap_snooze', 'icap_store_event', + 'iconv', 'iconv_get_encoding', 'iconv_set_encoding', 'ifx_affected_rows', + 'ifx_blobinfile_mode', 'ifx_byteasvarchar', 'ifx_close', 'ifx_connect', + 'ifx_copy_blob', 'ifx_create_blob', 'ifx_create_char', 'ifx_do', + 'ifx_error', 'ifx_errormsg', 'ifx_fetch_row', 'ifx_fieldproperties', + 'ifx_fieldtypes', 'ifx_free_blob', 'ifx_free_char', 'ifx_free_result', + 'ifx_get_blob', 'ifx_get_char', 'ifx_getsqlca', 'ifx_htmltbl_result', + 'ifx_nullformat', 'ifx_num_fields', 'ifx_num_rows', 'ifx_pconnect', + 'ifx_prepare', 'ifx_query', 'ifx_textasvarchar', 'ifx_update_blob', + 'ifx_update_char', 'ifxus_close_slob', 'ifxus_create_slob', + 'ifxus_free_slob', 'ifxus_open_slob', 'ifxus_read_slob', + 'ifxus_seek_slob', 'ifxus_tell_slob', 'ifxus_write_slob', + 'ignore_user_abort', 'image2wbmp', 'imagealphablending', 'imageantialias', + 'imagearc', 'imagechar', 'imagecharup', 'imagecolorallocate', + 'imagecolorat', 'imagecolorclosest', 'imagecolorclosestalpha', + 'imagecolorclosesthwb', 'imagecolordeallocate', 'imagecolorexact', + 'imagecolorexactalpha', 'imagecolorresolve', 'imagecolorresolvealpha', + 'imagecolorset', 'imagecolorsforindex', 'imagecolorstotal', + 'imagecolortransparent', 'imagecopy', 'imagecopymerge', + 'imagecopymergegray', 'imagecopyresampled', 'imagecopyresized', + 'imagecreate', 'imagecreatefromgd', 'imagecreatefromgd2', + 'imagecreatefromgd2part', 'imagecreatefromgif', 'imagecreatefromjpeg', + 'imagecreatefrompng', 'imagecreatefromstring', 'imagecreatefromwbmp', + 'imagecreatefromxbm', 'imagecreatefromxpm', 'imagecreatetruecolor', + 'imagedashedline', 'imagedestroy', 'imageellipse', 'imagefill', + 'imagefilledarc', 'imagefilledellipse', 'imagefilledpolygon', + 'imagefilledrectangle', 'imagefilltoborder', 'imagefontheight', + 'imagefontwidth', 'imageftbbox', 'imagefttext', 'imagegammacorrect', + 'imagegd', 'imagegd2', 'imagegif', 'imageinterlace', 'imagejpeg', + 'imageline', 'imageloadfont', 'imagepalettecopy', 'imagepng', + 'imagepolygon', 'imagepsbbox', 'imagepsencodefont', 'imagepsextendfont', + 'imagepsfreefont', 'imagepsloadfont', 'imagepsslantfont', 'imagepstext', + 'imagerectangle', 'imagesetbrush', 'imagesetpixel', 'imagesetstyle', + 'imagesetthickness', 'imagesettile', 'imagestring', 'imagestringup', + 'imagesx', 'imagesy', 'imagetruecolortopalette', 'imagettfbbox', + 'imagettftext', 'imagetypes', 'imagewbmp', 'imap_8bit', 'imap_append', + 'imap_base64', 'imap_binary', 'imap_body', 'imap_bodystruct', + 'imap_check', 'imap_clearflag_full', 'imap_close', 'imap_createmailbox', + 'imap_delete', 'imap_deletemailbox', 'imap_errors', 'imap_expunge', + 'imap_fetch_overview', 'imap_fetchbody', 'imap_fetchheader', + 'imap_fetchstructure', 'imap_get_quota', 'imap_getmailboxes', + 'imap_getsubscribed', 'imap_header', 'imap_headerinfo', 'imap_headers', + 'imap_last_error', 'imap_listmailbox', 'imap_listsubscribed', 'imap_mail', + 'imap_mail_compose', 'imap_mail_copy', 'imap_mail_move', + 'imap_mailboxmsginfo', 'imap_mime_header_decode', 'imap_msgno', + 'imap_num_msg', 'imap_num_recent', 'imap_open', 'imap_ping', 'imap_popen', + 'imap_qprint', 'imap_renamemailbox', 'imap_reopen', + 'imap_rfc822_parse_adrlist', 'imap_rfc822_parse_headers', + 'imap_rfc822_write_address', 'imap_scanmailbox', 'imap_search', + 'imap_set_quota', 'imap_setacl', 'imap_setflag_full', 'imap_sort', + 'imap_status', 'imap_subscribe', 'imap_thread', 'imap_uid', + 'imap_undelete', 'imap_unsubscribe', 'imap_utf7_decode', + 'imap_utf7_encode', 'imap_utf8', 'implode', 'import_request_variables', + 'in_array', 'include', 'include_once', 'ingres_autocommit', + 'ingres_close', 'ingres_commit', 'ingres_connect', 'ingres_fetch_array', + 'ingres_fetch_object', 'ingres_fetch_row', 'ingres_field_length', + 'ingres_field_name', 'ingres_field_nullable', 'ingres_field_precision', + 'ingres_field_scale', 'ingres_field_type', 'ingres_num_fields', + 'ingres_num_rows', 'ingres_pconnect', 'ingres_query', 'ingres_rollback', + 'ini_alter', 'ini_get', 'ini_get_all', 'ini_restore', 'ini_set', 'intval', + 'ip2long', 'iptcembed', 'iptcparse', 'ircg_channel_mode', + 'ircg_disconnect', 'ircg_fetch_error_msg', 'ircg_get_username', + 'ircg_html_encode', 'ircg_ignore_add', 'ircg_ignore_del', + 'ircg_is_conn_alive', 'ircg_join', 'ircg_kick', + 'ircg_lookup_format_messages', 'ircg_msg', 'ircg_nick', + 'ircg_nickname_escape', 'ircg_nickname_unescape', 'ircg_notice', + 'ircg_part', 'ircg_pconnect', 'ircg_register_format_messages', + 'ircg_set_current', 'ircg_set_file', 'ircg_topic', 'ircg_whois', 'is_a', + 'is_array', 'is_bool', 'is_callable', 'is_dir', 'is_double', + 'is_executable', 'is_file', 'is_finite', 'is_float', 'is_infinite', + 'is_int', 'is_integer', 'is_link', 'is_long', 'is_nan', 'is_null', + 'is_numeric', 'is_object', 'is_readable', 'is_real', 'is_resource', + 'is_scalar', 'is_string', 'is_subclass_of', 'is_uploaded_file', + 'is_writable', 'is_writeable', 'isset', 'java_last_exception_clear', + 'java_last_exception_get', 'jddayofweek', 'jdmonthname', 'jdtofrench', + 'jdtogregorian', 'jdtojewish', 'jdtojulian', 'jdtounix', 'jewishtojd', + 'join', 'jpeg2wbmp', 'juliantojd', 'key', 'krsort', 'ksort', 'lcg_value', + 'ldap_8859_to_t61', 'ldap_add', 'ldap_bind', 'ldap_close', 'ldap_compare', + 'ldap_connect', 'ldap_count_entries', 'ldap_delete', 'ldap_dn2ufn', + 'ldap_err2str', 'ldap_errno', 'ldap_error', 'ldap_explode_dn', + 'ldap_first_attribute', 'ldap_first_entry', 'ldap_first_reference', + 'ldap_free_result', 'ldap_get_attributes', 'ldap_get_dn', + 'ldap_get_entries', 'ldap_get_option', 'ldap_get_values', + 'ldap_get_values_len', 'ldap_list', 'ldap_mod_add', 'ldap_mod_del', + 'ldap_mod_replace', 'ldap_modify', 'ldap_next_attribute', + 'ldap_next_entry', 'ldap_next_reference', 'ldap_parse_reference', + 'ldap_parse_result', 'ldap_read', 'ldap_rename', 'ldap_search', + 'ldap_set_option', 'ldap_set_rebind_proc', 'ldap_sort', 'ldap_start_tls', + 'ldap_t61_to_8859', 'ldap_unbind', 'leak', 'levenshtein', 'link', + 'linkinfo', 'list', 'localeconv', 'localtime', 'log', 'log10', 'log1p', + 'long2ip', 'lstat', 'ltrim', 'mail', + 'mailparse_determine_best_xfer_encoding', 'mailparse_msg_create', + 'mailparse_msg_extract_part', 'mailparse_msg_extract_part_file', + 'mailparse_msg_free', 'mailparse_msg_get_part', + 'mailparse_msg_get_part_data', 'mailparse_msg_get_structure', + 'mailparse_msg_parse', 'mailparse_msg_parse_file', + 'mailparse_rfc822_parse_addresses', 'mailparse_stream_encode', + 'mailparse_uudecode_all', 'max', 'mb_c', 'mb_convert_kana', + 'mb_convert_variables', 'mb_decode_mimeheader', 'mb_decode_numericentity', + 'mb_detect_encoding', 'mb_detect_order', 'mb_encode_mimeheader', + 'mb_encode_numericentity', 'mb_ereg', 'mb_ereg_match', 'mb_ereg_replace', + 'mb_ereg_search', 'mb_ereg_search_getpos', 'mb_ereg_search_getregs', + 'mb_ereg_search_init', 'mb_ereg_search_pos', 'mb_ereg_search_regs', + 'mb_ereg_search_setpos', 'mb_eregi', 'mb_eregi_replace', 'mb_get_info', + 'mb_http_input', 'mb_http_output', 'mb_internal_encoding', 'mb_language', + 'mb_output_handler', 'mb_parse_str', 'mb_preferred_mime_name', + 'mb_regex_encoding', 'mb_send_mail', 'mb_split', 'mb_strcut', + 'mb_strimwidth', 'mb_strlen', 'mb_strpos', 'mb_strrpos', 'mb_strwidth', + 'mb_substitute_character', 'mb_substr', 'mcal_append_event', 'mcal_close', + 'mcal_create_calendar', 'mcal_date_compare', 'mcal_date_valid', + 'mcal_day_of_week', 'mcal_day_of_year', 'mcal_days_in_month', + 'mcal_delete_calendar', 'mcal_delete_event', 'mcal_event_add_attribute', + 'mcal_event_init', 'mcal_event_set_alarm', 'mcal_event_set_category', + 'mcal_event_set_class', 'mcal_event_set_description', + 'mcal_event_set_end', 'mcal_event_set_recur_daily', + 'mcal_event_set_recur_monthly_mday', 'mcal_event_set_recur_monthly_wday', + 'mcal_event_set_recur_none', 'mcal_event_set_recur_weekly', + 'mcal_event_set_recur_yearly', 'mcal_event_set_start', + 'mcal_event_set_title', 'mcal_expunge', 'mcal_fetch_current_stream_event', + 'mcal_fetch_event', 'mcal_is_leap_year', 'mcal_list_alarms', + 'mcal_list_events', 'mcal_next_recurrence', 'mcal_open', 'mcal_popen', + 'mcal_rename_calendar', 'mcal_reopen', 'mcal_snooze', 'mcal_store_event', + 'mcal_time_valid', 'mcal_week_of_year', 'mcrypt_cbc', 'mcrypt_cfb', + 'mcrypt_create_iv', 'mcrypt_decrypt', 'mcrypt_ecb', + 'mcrypt_enc_get_algorithms_name', 'mcrypt_enc_get_block_size', + 'mcrypt_enc_get_iv_size', 'mcrypt_enc_get_key_size', + 'mcrypt_enc_get_modes_name', 'mcrypt_enc_get_supported_key_sizes', + 'mcrypt_enc_is_block_algorithm', 'mcrypt_enc_is_block_algorithm_mode', + 'mcrypt_enc_is_block_mode', 'mcrypt_enc_self_test', 'mcrypt_encrypt', + 'mcrypt_generic', 'mcrypt_generic_deinit', 'mcrypt_generic_end', + 'mcrypt_generic_init', 'mcrypt_get_block_size', 'mcrypt_get_cipher_name', + 'mcrypt_get_iv_size', 'mcrypt_get_key_size', 'mcrypt_list_algorithms', + 'mcrypt_list_modes', 'mcrypt_module_close', + 'mcrypt_module_get_algo_block_size', 'mcrypt_module_get_algo_key_size', + 'mcrypt_module_get_supported_key_sizes', + 'mcrypt_module_is_block_algorithm', + 'mcrypt_module_is_block_algorithm_mode', 'mcrypt_module_is_block_mode', + 'mcrypt_module_open', 'mcrypt_module_self_test', 'mcrypt_ofb', 'md5', + 'md5_file', 'mdecrypt_generic', 'metaphone', 'method_exists', 'mhash', + 'mhash_count', 'mhash_get_block_size', 'mhash_get_hash_name', + 'mhash_keygen_s2k', 'microtime', 'min', 'ming_setcubicthreshold', + 'ming_setscale', 'ming_useswfversion', 'mkdir', 'mktime', + 'move_uploaded_file', 'msession_connect', 'msession_count', + 'msession_create', 'msession_destroy', 'msession_disconnect', + 'msession_find', 'msession_get', 'msession_get_array', 'msession_getdata', + 'msession_inc', 'msession_list', 'msession_listvar', 'msession_lock', + 'msession_plugin', 'msession_randstr', 'msession_set', + 'msession_set_array', 'msession_setdata', 'msession_timeout', + 'msession_uniq', 'msession_unlock', 'msql', 'msql_affected_rows', + 'msql_close', 'msql_connect', 'msql_create_db', 'msql_createdb', + 'msql_data_seek', 'msql_dbname', 'msql_drop_db', 'msql_dropdb', + 'msql_error', 'msql_fetch_array', 'msql_fetch_field', 'msql_fetch_object', + 'msql_fetch_row', 'msql_field_seek', 'msql_fieldflags', 'msql_fieldlen', + 'msql_fieldname', 'msql_fieldtable', 'msql_fieldtype', 'msql_free_result', + 'msql_freeresult', 'msql_list_dbs', 'msql_list_fields', 'msql_list_tables', + 'msql_listdbs', 'msql_listfields', 'msql_listtables', 'msql_num_fields', + 'msql_num_rows', 'msql_numfields', 'msql_numrows', 'msql_pconnect', + 'msql_query', 'msql_regcase', 'msql_result', 'msql_select_db', + 'msql_selectdb', 'msql_tablename', 'mssql_bind', 'mssql_close', + 'mssql_connect', 'mssql_data_seek', 'mssql_execute', 'mssql_fetch_array', + 'mssql_fetch_assoc', 'mssql_fetch_batch', 'mssql_fetch_field', + 'mssql_fetch_object', 'mssql_fetch_row', 'mssql_field_length', + 'mssql_field_name', 'mssql_field_seek', 'mssql_field_type', + 'mssql_free_result', 'mssql_get_last_message', 'mssql_guid_string', + 'mssql_init', 'mssql_min_error_severity', 'mssql_min_message_severity', + 'mssql_next_result', 'mssql_num_fields', 'mssql_num_rows', + 'mssql_pconnect', 'mssql_query', 'mssql_result', 'mssql_rows_affected', + 'mssql_select_db', 'mt_getrandmax', 'mt_rand', 'mt_srand', 'muscat_close', + 'muscat_get', 'muscat_give', 'muscat_setup', 'muscat_setup_net', + 'mysql_affected_rows', 'mysql_change_user', 'mysql_character_set_name', + 'mysql_close', 'mysql_connect', 'mysql_create_db', 'mysql_data_seek', + 'mysql_db_name', 'mysql_db_query', 'mysql_drop_db', 'mysql_errno', + 'mysql_error', 'mysql_escape_string', 'mysql_fetch_array', + 'mysql_fetch_assoc', 'mysql_fetch_field', 'mysql_fetch_lengths', + 'mysql_fetch_object', 'mysql_fetch_row', 'mysql_field_flags', + 'mysql_field_len', 'mysql_field_name', 'mysql_field_seek', + 'mysql_field_table', 'mysql_field_type', 'mysql_free_result', + 'mysql_get_client_info', 'mysql_get_host_info', 'mysql_get_proto_info', + 'mysql_get_server_info', 'mysql_info', 'mysql_insert_id', + 'mysql_list_dbs', 'mysql_list_fields', 'mysql_list_processes', + 'mysql_list_tables', 'mysql_num_fields', 'mysql_num_rows', + 'mysql_pconnect', 'mysql_ping', 'mysql_query', 'mysql_real_escape_string', + 'mysql_result', 'mysql_select_db', 'mysql_stat', 'mysql_tablename', + 'mysql_thread_id', 'mysql_unbuffered_query', 'natcasesort', 'natsort', + 'ncur', 'ncurses_addch', 'ncurses_addchnstr', 'ncurses_addchstr', + 'ncurses_addnstr', 'ncurses_addstr', 'ncurses_assume_default_colors', + 'ncurses_attroff', 'ncurses_attron', 'ncurses_attrset', + 'ncurses_baudrate', 'ncurses_beep', 'ncurses_bkgd', 'ncurses_bkgdset', + 'ncurses_border', 'ncurses_can_change_color', 'ncurses_cbreak', + 'ncurses_clear', 'ncurses_clrtobot', 'ncurses_clrtoeol', + 'ncurses_color_set', 'ncurses_curs_set', 'ncurses_def_prog_mode', + 'ncurses_def_shell_mode', 'ncurses_define_key', 'ncurses_delay_output', + 'ncurses_delch', 'ncurses_deleteln', 'ncurses_delwin', 'ncurses_doupdate', + 'ncurses_echo', 'ncurses_echochar', 'ncurses_end', 'ncurses_erase', + 'ncurses_erasechar', 'ncurses_filter', 'ncurses_flash', + 'ncurses_flushinp', 'ncurses_getch', 'ncurses_getmouse', + 'ncurses_halfdelay', 'ncurses_has_ic', 'ncurses_has_il', + 'ncurses_has_key', 'ncurses_hline', 'ncurses_inch', 'ncurses_init', + 'ncurses_init_color', 'ncurses_init_pair', 'ncurses_insch', + 'ncurses_insdelln', 'ncurses_insertln', 'ncurses_insstr', 'ncurses_instr', + 'ncurses_isendwin', 'ncurses_keyok', 'ncurses_killchar', + 'ncurses_longname', 'ncurses_mouseinterval', 'ncurses_mousemask', + 'ncurses_move', 'ncurses_mvaddch', 'ncurses_mvaddchnstr', + 'ncurses_mvaddchstr', 'ncurses_mvaddnstr', 'ncurses_mvaddstr', + 'ncurses_mvcur', 'ncurses_mvdelch', 'ncurses_mvgetch', 'ncurses_mvhline', + 'ncurses_mvinch', 'ncurses_mvvline', 'ncurses_mvwaddstr', 'ncurses_napms', + 'ncurses_newwin', 'ncurses_nl', 'ncurses_nocbreak', 'ncurses_noecho', + 'ncurses_nonl', 'ncurses_noqiflush', 'ncurses_noraw', 'ncurses_putp', + 'ncurses_qiflush', 'ncurses_raw', 'ncurses_refresh', 'ncurses_resetty', + 'ncurses_savetty', 'ncurses_scr_dump', 'ncurses_scr_init', + 'ncurses_scr_restore', 'ncurses_scr_set', 'ncurses_scrl', + 'ncurses_slk_attr', 'ncurses_slk_attroff', 'ncurses_slk_attron', + 'ncurses_slk_attrset', 'ncurses_slk_clear', 'ncurses_slk_color', + 'ncurses_slk_init', 'ncurses_slk_noutrefresh', 'ncurses_slk_refresh', + 'ncurses_slk_restore', 'ncurses_slk_touch', 'ncurses_standend', + 'ncurses_standout', 'ncurses_start_color', 'ncurses_termattrs', + 'ncurses_termname', 'ncurses_timeout', 'ncurses_typeahead', + 'ncurses_ungetch', 'ncurses_ungetmouse', 'ncurses_use_default_colors', + 'ncurses_use_env', 'ncurses_use_extended_names', 'ncurses_vidattr', + 'ncurses_vline', 'ncurses_wrefresh', 'next', 'ngettext', 'nl2br', + 'nl_langinfo', 'notes_body', 'notes_copy_db', 'notes_create_db', + 'notes_create_note', 'notes_drop_db', 'notes_find_note', + 'notes_header_info', 'notes_list_msgs', 'notes_mark_read', + 'notes_mark_unread', 'notes_nav_create', 'notes_search', 'notes_unread', + 'notes_version', 'number_format', 'ob_clean', 'ob_end_clean', + 'ob_end_flush', 'ob_flush', 'ob_get_contents', 'ob_get_length', + 'ob_get_level', 'ob_gzhandler', 'ob_iconv_handler', 'ob_implicit_flush', + 'ob_start', 'ocibindbyname', 'ocicancel', 'ocicollappend', + 'ocicollassign', 'ocicollassignelem', 'ocicollgetelem', 'ocicollmax', + 'ocicollsize', 'ocicolltrim', 'ocicolumnisnull', 'ocicolumnname', + 'ocicolumnprecision', 'ocicolumnscale', 'ocicolumnsize', 'ocicolumntype', + 'ocicolumntyperaw', 'ocicommit', 'ocidefinebyname', 'ocierror', + 'ociexecute', 'ocifetch', 'ocifetchinto', 'ocifetchstatement', + 'ocifreecollection', 'ocifreecursor', 'ocifreedesc', 'ocifreestatement', + 'ociinternaldebug', 'ociloadlob', 'ocilogoff', 'ocilogon', + 'ocinewcollection', 'ocinewcursor', 'ocinewdescriptor', 'ocinlogon', + 'ocinumcols', 'ociparse', 'ociplogon', 'ociresult', 'ocirollback', + 'ocirowcount', 'ocisavelob', 'ocisavelobfile', 'ociserverversion', + 'ocisetprefetch', 'ocistatementtype', 'ociwritelobtofile', 'octdec', + 'odbc_autocommit', 'odbc_binmode', 'odbc_close', 'odbc_close_all', + 'odbc_columnprivileges', 'odbc_columns', 'odbc_commit', 'odbc_connect', + 'odbc_cursor', 'odbc_do', 'odbc_error', 'odbc_errormsg', 'odbc_exec', + 'odbc_execute', 'odbc_fetch_array', 'odbc_fetch_into', + 'odbc_fetch_object', 'odbc_fetch_row', 'odbc_field_len', + 'odbc_field_name', 'odbc_field_num', 'odbc_field_precision', + 'odbc_field_scale', 'odbc_field_type', 'odbc_foreignkeys', + 'odbc_free_result', 'odbc_gettypeinfo', 'odbc_longreadlen', + 'odbc_next_result', 'odbc_num_fields', 'odbc_num_rows', 'odbc_pconnect', + 'odbc_prepare', 'odbc_primarykeys', 'odbc_procedurecolumns', + 'odbc_procedures', 'odbc_result', 'odbc_result_all', 'odbc_rollback', + 'odbc_setoption', 'odbc_specialcolumns', 'odbc_statistics', + 'odbc_tableprivileges', 'odbc_tables', 'opendir', 'openlog', + 'openssl_csr_export', 'openssl_csr_export_to_file', 'openssl_csr_new', + 'openssl_csr_sign', 'openssl_error_string', 'openssl_free_key', + 'openssl_get_privatekey', 'openssl_get_publickey', 'openssl_open', + 'openssl_pkcs7_decrypt', 'openssl_pkcs7_encrypt', 'openssl_pkcs7_sign', + 'openssl_pkcs7_verify', 'openssl_pkey_export', + 'openssl_pkey_export_to_file', 'openssl_pkey_new', + 'openssl_private_decrypt', 'openssl_private_encrypt', + 'openssl_public_decrypt', 'openssl_public_encrypt', 'openssl_seal', + 'openssl_sign', 'openssl_verify', 'openssl_x509_check_private_key', + 'openssl_x509_checkpurpose', 'openssl_x509_export', + 'openssl_x509_export_to_file', 'openssl_x509_free', 'openssl_x509_parse', + 'openssl_x509_read', 'ora_bind', 'ora_close', 'ora_columnname', + 'ora_columnsize', 'ora_columntype', 'ora_commit', 'ora_commitoff', + 'ora_commiton', 'ora_do', 'ora_error', 'ora_errorcode', 'ora_exec', + 'ora_fetch', 'ora_fetch_into', 'ora_getcolumn', 'ora_logoff', 'ora_logon', + 'ora_numcols', 'ora_numrows', 'ora_open', 'ora_parse', 'ora_plogon', + 'ora_rollback', 'ord', 'overload', 'ovrimos_close', 'ovrimos_commit', + 'ovrimos_connect', 'ovrimos_cursor', 'ovrimos_exec', 'ovrimos_execute', + 'ovrimos_fetch_into', 'ovrimos_fetch_row', 'ovrimos_field_len', + 'ovrimos_field_name', 'ovrimos_field_num', 'ovrimos_field_type', + 'ovrimos_free_result', 'ovrimos_longreadlen', 'ovrimos_num_fields', + 'ovrimos_num_rows', 'ovrimos_prepare', 'ovrimos_result', + 'ovrimos_result_all', 'ovrimos_rollback', 'pack', 'parse_ini_file', + 'parse_str', 'parse_url', 'passthru', 'pathinfo', 'pclose', 'pcntl_exec', + 'pcntl_fork', 'pcntl_signal', 'pcntl_waitpid', 'pcntl_wexitstatus', + 'pcntl_wifexited', 'pcntl_wifsignaled', 'pcntl_wifstopped', + 'pcntl_wstopsig', 'pcntl_wtermsig', 'pdf_add_annotation', + 'pdf_add_bookmark', 'pdf_add_launchlink', 'pdf_add_locallink', + 'pdf_add_note', 'pdf_add_outline', 'pdf_add_pdflink', 'pdf_add_thumbnail', + 'pdf_add_weblink', 'pdf_arc', 'pdf_arcn', 'pdf_attach_file', + 'pdf_begin_page', 'pdf_begin_pattern', 'pdf_begin_template', 'pdf_circle', + 'pdf_clip', 'pdf_close', 'pdf_close_image', 'pdf_close_pdi', + 'pdf_close_pdi_page', 'pdf_closepath', 'pdf_closepath_fill_stroke', + 'pdf_closepath_stroke', 'pdf_concat', 'pdf_continue_text', 'pdf_curveto', + 'pdf_delete', 'pdf_end_page', 'pdf_end_pattern', 'pdf_end_template', + 'pdf_endpath', 'pdf_fill', 'pdf_fill_stroke', 'pdf_findfont', + 'pdf_get_buffer', 'pdf_get_font', 'pdf_get_fontname', 'pdf_get_fontsize', + 'pdf_get_image_height', 'pdf_get_image_width', 'pdf_get_majorversion', + 'pdf_get_minorversion', 'pdf_get_parameter', 'pdf_get_pdi_value', + 'pdf_get_value', 'pdf_initgraphics', 'pdf_lineto', 'pdf_makespotcolor', + 'pdf_moveto', 'pdf_new', 'pdf_open', 'pdf_open_ccitt', 'pdf_open_file', + 'pdf_open_gif', 'pdf_open_image', 'pdf_open_image_file', 'pdf_open_jpeg', + 'pdf_open_memory_image', 'pdf_open_pdi', 'pdf_open_pdi_page', + 'pdf_open_png', 'pdf_open_tiff', 'pdf_place_image', 'pdf_place_pdi_page', + 'pdf_rect', 'pdf_restore', 'pdf_rotate', 'pdf_save', 'pdf_scale', + 'pdf_set_border_color', 'pdf_set_border_dash', 'pdf_set_border_style', + 'pdf_set_char_spacing', 'pdf_set_duration', 'pdf_set_font', + 'pdf_set_horiz_scaling', 'pdf_set_info', 'pdf_set_info_author', + 'pdf_set_info_creator', 'pdf_set_info_keywords', 'pdf_set_info_subject', + 'pdf_set_info_title', 'pdf_set_leading', 'pdf_set_parameter', + 'pdf_set_text_pos', 'pdf_set_text_rendering', 'pdf_set_text_rise', + 'pdf_set_transition', 'pdf_set_value', 'pdf_set_word_spacing', + 'pdf_setcolor', 'pdf_setdash', 'pdf_setflat', 'pdf_setfont', + 'pdf_setgray', 'pdf_setgray_fill', 'pdf_setgray_stroke', 'pdf_setlinecap', + 'pdf_setlinejoin', 'pdf_setlinewidth', 'pdf_setmatrix', + 'pdf_setmiterlimit', 'pdf_setpolydash', 'pdf_setrgbcolor', + 'pdf_setrgbcolor_fill', 'pdf_setrgbcolor_stroke', 'pdf_show', + 'pdf_show_boxed', 'pdf_show_xy', 'pdf_skew', 'pdf_stringwidth', + 'pdf_stroke', 'pdf_translate', 'pfpro_cleanup', 'pfpro_init', + 'pfpro_process', 'pfpro_process_raw', 'pfpro_version', 'pfsockopen', + 'pg_affected_rows', 'pg_cancel_query', 'pg_client_encoding', 'pg_close', + 'pg_connect', 'pg_connection_busy', 'pg_connection_reset', + 'pg_connection_status', 'pg_copy_from', 'pg_copy_to', 'pg_dbname', + 'pg_end_copy', 'pg_escape_bytea', 'pg_escape_string', 'pg_fetch_array', + 'pg_fetch_object', 'pg_fetch_result', 'pg_fetch_row', 'pg_field_is_null', + 'pg_field_name', 'pg_field_num', 'pg_field_prtlen', 'pg_field_size', + 'pg_field_type', 'pg_free_result', 'pg_get_result', 'pg_host', + 'pg_last_error', 'pg_last_notice', 'pg_last_oid', 'pg_lo_close', + 'pg_lo_create', 'pg_lo_export', 'pg_lo_import', 'pg_lo_open', + 'pg_lo_read', 'pg_lo_seek', 'pg_lo_tell', 'pg_lo_unlink', 'pg_lo_write', + 'pg_num_fields', 'pg_num_rows', 'pg_options', 'pg_pconnect', 'pg_port', + 'pg_put_line', 'pg_query', 'pg_result_error', 'pg_result_status', + 'pg_send_query', 'pg_set_client_encoding', 'pg_trace', 'pg_tty', + 'pg_untrace', 'php_logo_guid', 'php_sapi_name', 'php_uname', 'phpcredits', + 'phpinfo', 'phpversion', 'pi', 'png2wbmp', 'popen', 'pos', 'posix_ctermid', + 'posix_getcwd', 'posix_getegid', 'posix_geteuid', 'posix_getgid', + 'posix_getgrgid', 'posix_getgrnam', 'posix_getgroups', 'posix_getlogin', + 'posix_getpgid', 'posix_getpgrp', 'posix_getpid', 'posix_getppid', + 'posix_getpwnam', 'posix_getpwuid', 'posix_getrlimit', 'posix_getsid', + 'posix_getuid', 'posix_isatty', 'posix_kill', 'posix_mkfifo', + 'posix_setegid', 'posix_seteuid', 'posix_setgid', 'posix_setpgid', + 'posix_setsid', 'posix_setuid', 'posix_times', 'posix_ttyname', + 'posix_uname', 'pow', 'preg_grep', 'preg_match', 'preg_match_all', + 'preg_quote', 'preg_replace', 'preg_replace_callback', 'preg_split', + 'prev', 'print', 'print_r', 'printer_abort', 'printer_close', + 'printer_create_brush', 'printer_create_dc', 'printer_create_font', + 'printer_create_pen', 'printer_delete_brush', 'printer_delete_dc', + 'printer_delete_font', 'printer_delete_pen', 'printer_draw_bmp', + 'printer_draw_chord', 'printer_draw_elipse', 'printer_draw_line', + 'printer_draw_pie', 'printer_draw_rectangle', 'printer_draw_roundrect', + 'printer_draw_text', 'printer_end_doc', 'printer_end_page', + 'printer_get_option', 'printer_list', 'printer_logical_fontheight', + 'printer_open', 'printer_select_brush', 'printer_select_font', + 'printer_select_pen', 'printer_set_option', 'printer_start_doc', + 'printer_start_page', 'printer_write', 'printf', 'pspell_add_to_personal', + 'pspell_add_to_session', 'pspell_check', 'pspell_clear_session', + 'pspell_config_create', 'pspell_config_ignore', 'pspell_config_mode', + 'pspell_config_personal', 'pspell_config_repl', + 'pspell_config_runtogether', 'pspell_config_save_repl', 'pspell_new', + 'pspell_new_config', 'pspell_new_personal', 'pspell_save_wordlist', + 'pspell_store_replacement', 'pspell_suggest', 'putenv', 'qdom_error', + 'qdom_tree', 'quoted_printable_decode', 'quotemeta', 'rad2deg', 'rand', + 'range', 'rawurldecode', 'rawurlencode', 'read_exif_data', 'readdir', + 'readfile', 'readgzfile', 'readline', 'readline_add_history', + 'readline_clear_history', 'readline_completion_function', 'readline_info', + 'readline_list_history', 'readline_read_history', 'readline_write_history', + 'readlink', 'realpath', 'recode', 'recode_file', 'recode_string', + 'register_shutdown_function', 'register_tick_function', 'rename', + 'require', 'require_once', 'reset', 'restore_error_handler', + 'restore_include_path', 'rewind', 'rewinddir', 'rmdir', 'round', 'rsort', + 'rtrim', 'sem_acquire', 'sem_get', 'sem_release', 'sem_remove', + 'serialize', 'sesam_affected_rows', 'sesam_commit', 'sesam_connect', + 'sesam_diagnostic', 'sesam_disconnect', 'sesam_errormsg', 'sesam_execimm', + 'sesam_fetch_array', 'sesam_fetch_result', 'sesam_fetch_row', + 'sesam_field_array', 'sesam_field_name', 'sesam_free_result', + 'sesam_num_fields', 'sesam_query', 'sesam_rollback', 'sesam_seek_row', + 'sesam_settransaction', 'session_cache_expire', 'session_cache_limiter', + 'session_decode', 'session_destroy', 'session_encode', + 'session_get_cookie_params', 'session_id', 'session_is_registered', + 'session_module_name', 'session_name', 'session_register', + 'session_save_path', 'session_set_cookie_params', + 'session_set_save_handler', 'session_start', 'session_unregister', + 'session_unset', 'session_write_close', 'set_error_handler', + 'set_file_buffer', 'set_include_path', 'set_magic_quotes_runtime', + 'set_time_limit', 'setcookie', 'setlocale', 'settype', 'shell_exec', + 'shm_attach', 'shm_detach', 'shm_get_var', 'shm_put_var', 'shm_remove', + 'shm_remove_var', 'shmop_close', 'shmop_delete', 'shmop_open', + 'shmop_read', 'shmop_size', 'shmop_write', 'show_source', 'shuffle', + 'similar_text', 'sin', 'sinh', 'sizeof', 'sleep', 'snmp_get_quick_print', + 'snmp_set_quick_print', 'snmpget', 'snmprealwalk', 'snmpset', 'snmpwalk', + 'snmpwalkoid', 'socket_accept', 'socket_bind', 'socket_close', + 'socket_connect', 'socket_create', 'socket_create_listen', + 'socket_create_pair', 'socket_fd_alloc', 'socket_fd_clear', + 'socket_fd_free', 'socket_fd_isset', 'socket_fd_set', 'socket_fd_zero', + 'socket_get_status', 'socket_getopt', 'socket_getpeername', + 'socket_getsockname', 'socket_iovec_add', 'socket_iovec_alloc', + 'socket_iovec_delete', 'socket_iovec_fetch', 'socket_iovec_free', + 'socket_iovec_set', 'socket_last_error', 'socket_listen', 'socket_read', + 'socket_readv', 'socket_recv', 'socket_recvfrom', 'socket_recvmsg', + 'socket_select', 'socket_send', 'socket_sendmsg', 'socket_sendto', + 'socket_set_blocking', 'socket_set_nonblock', 'socket_set_timeout', + 'socket_setopt', 'socket_shutdown', 'socket_strerror', 'socket_write', + 'socket_writev', 'sort', 'soundex', 'split', 'spliti', 'sprintf', + 'sql_regcase', 'sqrt', 'srand', 'sscanf', 'stat', 'str_pad', 'str_repeat', + 'str_replace', 'str_rot13', 'strcasecmp', 'strchr', 'strcmp', 'strcoll', + 'strcspn', 'strftime', 'strip_tags', 'stripcslashes', 'stripslashes', + 'stristr', 'strlen', 'strnatcasecmp', 'strnatcmp', 'strncasecmp', + 'strncmp', 'strpos', 'strrchr', 'strrev', 'strrpos', 'strspn', 'strstr', + 'strtok', 'strtolower', 'strtotime', 'strtoupper', 'strtr', 'strval', + 'substr', 'substr_count', 'substr_replace', 'swf_actiongeturl', + 'swf_actiongotoframe', 'swf_actiongotolabel', 'swf_actionnextframe', + 'swf_actionplay', 'swf_actionprevframe', 'swf_actionsettarget', + 'swf_actionstop', 'swf_actiontogglequality', 'swf_actionwaitforframe', + 'swf_addbuttonrecord', 'swf_addcolor', 'swf_closefile', + 'swf_definebitmap', 'swf_definefont', 'swf_defineline', 'swf_definepoly', + 'swf_definerect', 'swf_definetext', 'swf_endbutton', 'swf_enddoaction', + 'swf_endshape', 'swf_endsymbol', 'swf_fontsize', 'swf_fontslant', + 'swf_fonttracking', 'swf_getbitmapinfo', 'swf_getfontinfo', + 'swf_getframe', 'swf_labelframe', 'swf_lookat', 'swf_modifyobject', + 'swf_mulcolor', 'swf_nextid', 'swf_oncondition', 'swf_openfile', + 'swf_ortho', 'swf_ortho2', 'swf_perspective', 'swf_placeobject', + 'swf_polarview', 'swf_popmatrix', 'swf_posround', 'swf_pushmatrix', + 'swf_removeobject', 'swf_rotate', 'swf_scale', 'swf_setfont', + 'swf_setframe', 'swf_shapearc', 'swf_shapecurveto', 'swf_shapecurveto3', + 'swf_shapefillbitmapclip', 'swf_shapefillbitmaptile', 'swf_shapefilloff', + 'swf_shapefillsolid', 'swf_shapelinesolid', 'swf_shapelineto', + 'swf_shapemoveto', 'swf_showframe', 'swf_startbutton', + 'swf_startdoaction', 'swf_startshape', 'swf_startsymbol', 'swf_textwidth', + 'swf_translate', 'swf_viewport', 'swfaction', 'swfbitmap', + 'swfbitmap.getheight', 'swfbitmap.getwidth', 'swfbutton', + 'swfbutton.addaction', 'swfbutton.addshape', 'swfbutton.setaction', + 'swfbutton.setdown', 'swfbutton.sethit', 'swfbutton.setover', + 'swfbutton.setup', 'swfbutton_keypress', 'swfdisplayitem', + 'swfdisplayitem.addcolor', 'swfdisplayitem.move', 'swfdisplayitem.moveto', + 'swfdisplayitem.multcolor', 'swfdisplayitem.remove', + 'swfdisplayitem.rotate', 'swfdisplayitem.rotateto', + 'swfdisplayitem.scale', 'swfdisplayitem.scaleto', + 'swfdisplayitem.setdepth', 'swfdisplayitem.setname', + 'swfdisplayitem.setratio', 'swfdisplayitem.skewx', + 'swfdisplayitem.skewxto', 'swfdisplayitem.skewy', + 'swfdisplayitem.skewyto', 'swffill', 'swffill.moveto', 'swffill.rotateto', + 'swffill.scaleto', 'swffill.skewxto', 'swffill.skewyto', 'swffont', + 'swffont.getwidth', 'swfgradient', 'swfgradient.addentry', 'swfmorph', + 'swfmorph.getshape1', 'swfmorph.getshape2', 'swfmovie', 'swfmovie.add', + 'swfmovie.nextframe', 'swfmovie.output', 'swfmovie.remove', + 'swfmovie.save', 'swfmovie.setbackground', 'swfmovie.setdimension', + 'swfmovie.setframes', 'swfmovie.setrate', 'swfmovie.streammp3', + 'swfshape', 'swfshape.addfill', 'swfshape.drawcurve', + 'swfshape.drawcurveto', 'swfshape.drawline', 'swfshape.drawlineto', + 'swfshape.movepen', 'swfshape.movepento', 'swfshape.setleftfill', + 'swfshape.setline', 'swfshape.setrightfill', 'swfsprite', 'swfsprite.add', + 'swfsprite.nextframe', 'swfsprite.remove', 'swfsprite.setframes', + 'swftext', 'swftext.addstring', 'swftext.getwidth', 'swftext.moveto', + 'swftext.setcolor', 'swftext.setfont', 'swftext.setheight', + 'swftext.setspacing', 'swftextfield', 'swftextfield.addstring', + 'swftextfield.align', 'swftextfield.setbounds', 'swftextfield.setcolor', + 'swftextfield.setfont', 'swftextfield.setheight', + 'swftextfield.setindentation', 'swftextfield.setleftmargin', + 'swftextfield.setlinespacing', 'swftextfield.setmargins', + 'swftextfield.setname', 'swftextfield.setrightmargin', + 'sybase_affected_rows', 'sybase_close', 'sybase_connect', + 'sybase_data_seek', 'sybase_fetch_array', 'sybase_fetch_field', + 'sybase_fetch_object', 'sybase_fetch_row', 'sybase_field_seek', + 'sybase_free_result', 'sybase_get_last_message', + 'sybase_min_client_severity', 'sybase_min_error_severity', + 'sybase_min_message_severity', 'sybase_min_server_severity', + 'sybase_num_fields', 'sybase_num_rows', 'sybase_pconnect', 'sybase_query', + 'sybase_result', 'sybase_select_db', 'symlink', 'syslog', 'system', 'tan', + 'tanh', 'tempnam', 'textdomain', 'time', 'tmpfile', 'touch', + 'trigger_error', 'trim', 'uasort', 'ucfirst', 'ucwords', + 'udm_add_search_limit', 'udm_alloc_agent', 'udm_api_version', + 'udm_cat_list', 'udm_cat_path', 'udm_check_charset', 'udm_check_stored', + 'udm_clear_search_limits', 'udm_close_stored', 'udm_crc32', 'udm_errno', + 'udm_error', 'udm_find', 'udm_free_agent', 'udm_free_ispell_data', + 'udm_free_res', 'udm_get_doc_count', 'udm_get_res_field', + 'udm_get_res_param', 'udm_load_ispell_data', 'udm_open_stored', + 'udm_set_agent_param', 'uksort', 'umask', 'uniqid', 'unixtojd', 'unlink', + 'unpack', 'unregister_tick_function', 'unserialize', 'unset', 'urldecode', + 'urlencode', 'user_error', 'usleep', 'usort', 'utf8_decode', 'utf8_encode', + 'var_dump', 'var_export', 'variant', 'version_compare', 'virtual', 'vpo', + 'vpopmail_add_alias_domain', 'vpopmail_add_alias_domain_ex', + 'vpopmail_add_domain', 'vpopmail_add_domain_ex', 'vpopmail_add_user', + 'vpopmail_alias_add', 'vpopmail_alias_del', 'vpopmail_alias_del_domain', + 'vpopmail_alias_get', 'vpopmail_alias_get_all', 'vpopmail_auth_user', + 'vpopmail_del_domain_ex', 'vpopmail_del_user', 'vpopmail_error', + 'vpopmail_passwd', 'vpopmail_set_user_quota', 'vprintf', 'vsprintf', + 'w32api_deftype', 'w32api_init_dtype', 'w32api_invoke_function', + 'w32api_register_function', 'w32api_set_call_method', 'wddx_add_vars', + 'wddx_deserialize', 'wddx_packet_end', 'wddx_packet_start', + 'wddx_serialize_value', 'wddx_serialize_vars', 'wordwrap', + 'xml_error_string', 'xml_get_current_byte_index', + 'xml_get_current_column_number', 'xml_get_current_line_number', + 'xml_get_error_code', 'xml_parse', 'xml_parse_into_struct', + 'xml_parser_create', 'xml_parser_create_ns', 'xml_parser_free', + 'xml_parser_get_option', 'xml_parser_set_option', + 'xml_set_character_data_handler', 'xml_set_default_handler', + 'xml_set_element_handler', 'xml_set_end_namespace_decl_handler', + 'xml_set_external_entity_ref_handler', 'xml_set_notation_decl_handler', + 'xml_set_object', 'xml_set_processing_instruction_handler', + 'xml_set_start_namespace_decl_handler', + 'xml_set_unparsed_entity_decl_handler', 'xmldoc', 'xmldocfile', + 'xmlrpc_decode', 'xmlrpc_decode_request', 'xmlrpc_encode', + 'xmlrpc_encode_request', 'xmlrpc_get_type', + 'xmlrpc_parse_method_descriptions', + 'xmlrpc_server_add_introspection_data', 'xmlrpc_server_call_method', + 'xmlrpc_server_create', 'xmlrpc_server_destroy', + 'xmlrpc_server_register_introspection_callback', + 'xmlrpc_server_register_method', 'xmlrpc_set_type', 'xmltree', + 'xpath_eval', 'xpath_eval_expression', 'xpath_new_context', 'xptr_eval', + 'xptr_new_context', 'xslt_create', 'xslt_errno', 'xslt_error', + 'xslt_free', 'xslt_process', 'xslt_set_base', 'xslt_set_encoding', + 'xslt_set_error_handler', 'xslt_set_log', 'xslt_set_sax_handler', + 'xslt_set_sax_handlers', 'xslt_set_scheme_handler', + 'xslt_set_scheme_handlers', 'yaz_addinfo', 'yaz_ccl_conf', + 'yaz_ccl_parse', 'yaz_close', 'yaz_connect', 'yaz_database', + 'yaz_element', 'yaz_errno', 'yaz_error', 'yaz_hits', 'yaz_itemorder', + 'yaz_present', 'yaz_range', 'yaz_record', 'yaz_scan', 'yaz_scan_result', + 'yaz_search', 'yaz_sort', 'yaz_syntax', 'yaz_wait', 'yp_all', 'yp_cat', + 'yp_err_string', 'yp_errno', 'yp_first', 'yp_get_default_domain', + 'yp_master', 'yp_match', 'yp_next', 'yp_order', 'zend_logo_guid', + 'zend_version', 'zip_close', 'zip_entry_close', + 'zip_entry_compressedsize', 'zip_entry_compressionmethod', + 'zip_entry_filesize', 'zip_entry_name', 'zip_entry_open', + 'zip_entry_read', 'zip_open', 'zip_read' + ), + 1 => $CONTEXT . '/functions', + 2 => 'color:#006;', + 3 => false, + // urls (the name of a function, with brackets at the end, or a string with {FNAME} in it like GeSHi 1.0.X) + // e.g. geshi_php_convert_url(), or http://www.php.net/{FNAME} + 4 => 'geshi_php_convert_url()' + ) +); + +$this->_contextCharactersDisallowedBeforeKeywords = array('$', '_'); +$this->_contextCharactersDisallowedAfterKeywords = array("'", '_'); +$this->_contextSymbols = array( + 0 => array( + 0 => array( + '(', ')', ',', ';', ':', '[', ']', + '+', '-', '*', '/', '&', '|', '!', '<', '>', + '{', '}', '=', '@' + ), + // name + 1 => $CONTEXT . '/sym0', + // style + 2 => 'color:#008000;' + ) +); +$this->_contextRegexps = array( + 0 => array( + // The regexps + // each regex in this array will be tested and styled the same + 0 => array( + '#(\$\$?[a-zA-Z_][a-zA-Z0-9_]*)#', // This is a variable in PHP + ), + // index 1 is a string that strpos can use + 1 => '$', + // This is the special bit ;) + // For each bracket pair in the regex above, you can specify a name and style for it + 2 => array( + // index 1 is for the first bracket pair + // so for PHP it's everything within the (...) + // of course we could have specified the regex + // as #$([a-zA-Z_][a-zA-Z0-9_]*)# (note the change + // in place for the first open bracket), then the + // name and style for this part would not include + // the beginning $ + 1 => array($CONTEXT . '/var', 'color:#33f;', false), + ) + ), + // These are prebuild functions that can be called to add number + // support to a context. Call exactly as below + 1 => geshi_use_doubles($CONTEXT), + 2 => geshi_use_integers($CONTEXT) +); +$this->_objectSplitters = array( + 0 => array( + 0 => array('->'), + 1 => $CONTEXT . '/oodynamic', + 2 => 'color:#933;', + 3 => false + ), + 1 => array( + 0 => array('::'), + 1 => $CONTEXT . '/oostatic', + 2 => 'color:#933;font-weight:bold;', + 3 => false + ) +); + +/** + * This just demonstrates the concept... + * You can use a function like this, called + * by the URL entry of the keywords array, + * to do whatever you like with the URL. + * These functions that convert urls take one + * mandatory parameter - the keyword the URL + * is being built for. + * + * You can then have some kind of logic in this + * function to return a URL based on the + * keyword... saves on those nasty hacks that + * were used in 1.0.X to do this. + * + * Make sure you do the function_exists check! These + * context files will be included multiple times + */ + if (!function_exists('geshi_php_convert_url')) { + function geshi_php_convert_url ($keyword) + { + return 'http://www.php.net/' . $keyword; + } +} + +?> diff --git a/paste/include/geshi/contexts/php/single_comment.php b/paste/include/geshi/contexts/php/single_comment.php new file mode 100644 index 0000000..c367100 --- /dev/null +++ b/paste/include/geshi/contexts/php/single_comment.php @@ -0,0 +1,47 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('//', '#'), + 1 => array("\n", '?>'), + 2 => false + ) +); + +$this->_styler->setStyle($CONTEXT, 'color:#888;font-style:italic;'); +$this->_contextStyleType = GESHI_STYLE_COMMENTS; +$this->_delimiterParseData = GESHI_CHILD_PARSE_LEFT; + +?> diff --git a/paste/include/geshi/contexts/qbasic/comment.php b/paste/include/geshi/contexts/qbasic/comment.php new file mode 100644 index 0000000..a9a3a39 --- /dev/null +++ b/paste/include/geshi/contexts/qbasic/comment.php @@ -0,0 +1,47 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array("'", 'REM'), + 1 => array("\n"), + 2 => false + ) +); + +$this->_styler->setStyle($CONTEXT, 'color:#888;font-style:italic;'); +$this->_contextStyleType = GESHI_STYLE_COMMENTS; +$this->_delimiterParseData = GESHI_CHILD_PARSE_LEFT; + +?> diff --git a/paste/include/geshi/contexts/qbasic/qbasic.php b/paste/include/geshi/contexts/qbasic/qbasic.php new file mode 100644 index 0000000..72e72cf --- /dev/null +++ b/paste/include/geshi/contexts/qbasic/qbasic.php @@ -0,0 +1,68 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * ---------------------------------- + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_childContexts = array( + new GeSHiContext('qbasic', $DIALECT, 'string'), + new GeSHiContext('qbasic', $DIALECT, 'comment') +); + +$this->_contextKeywords = array( + 0 => array( + 0 => array('and', 'as', 'call', 'dim', 'end', 'goto', 'if', 'integer', 'print', 'sub', 'then'), + 1 => $CONTEXT . '/kw0', + 2 => 'color: #006;', + 3 => false, + 4 => 'http://qboho.qbasicnews.com/qboho/qck{FNAME}.html' + ) +); + +$this->_contextSymbols = array( + 0 => array( + 0 => array( + '(', ')', ',', ':', ';', '=', '<', '>' + ), + // name (should names have / in them like normal contexts? YES + 1 => $CONTEXT . '/sym0', + // style + 2 => 'color:#008000;' + ) +); +$this->_contextRegexps = array( + 0 => geshi_use_doubles($CONTEXT), + 1 => geshi_use_integers($CONTEXT) +); +// @todo [blocking 1.1.5] languages should be able to set the styles of their numbers + +?> diff --git a/paste/include/geshi/contexts/qbasic/string.php b/paste/include/geshi/contexts/qbasic/string.php new file mode 100644 index 0000000..9f8a79a --- /dev/null +++ b/paste/include/geshi/contexts/qbasic/string.php @@ -0,0 +1,46 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('"'), + 1 => array('"'), + 2 => false + ) +); + +$this->_styler->setStyle($CONTEXT, 'color:#f00;'); +$this->_contextStyleType = GESHI_STYLE_STRINGS; + +?> diff --git a/paste/include/geshi/contexts/web3d/comment.php b/paste/include/geshi/contexts/web3d/comment.php new file mode 100644 index 0000000..16c2497 --- /dev/null +++ b/paste/include/geshi/contexts/web3d/comment.php @@ -0,0 +1,48 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * ---------------------------------- + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('#'), + 1 => array("\n"), + 2 => false + ) +); + +$this->_styler->setStyle($CONTEXT, 'color:#888;background-color:#EEE;font-style:bold;'); +$this->_contextStyleType = GESHI_STYLE_COMMENTS; +$this->_delimiterParseData = GESHI_CHILD_PARSE_LEFT; + +?> diff --git a/paste/include/geshi/contexts/web3d/string.php b/paste/include/geshi/contexts/web3d/string.php new file mode 100644 index 0000000..1dda5dc --- /dev/null +++ b/paste/include/geshi/contexts/web3d/string.php @@ -0,0 +1,50 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + 0 => array('"'), + 1 => array('"'), + 2 => false + ) +); + +$this->_childContexts = array( + new GeSHiCodeContext('web3d', $DIALECT, 'string_javascript'), +); + +$this->_styler->setStyle($CONTEXT, 'color:#933;'); +$this->_contextStyleType = GESHI_STYLE_STRINGS; + +?> diff --git a/paste/include/geshi/contexts/web3d/string_javascript.php b/paste/include/geshi/contexts/web3d/string_javascript.php new file mode 100644 index 0000000..cc7b84e --- /dev/null +++ b/paste/include/geshi/contexts/web3d/string_javascript.php @@ -0,0 +1,51 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array( + 0 => array( + // Why doesn't this work correctly? +// 0 => array('REGEX#[java|vrml|ecma]script:#'), + + // yet this works (three valid names for the same VRML scripting) + 0 => array('REGEX#javascript:#', 'REGEX#ecmascript:#', 'REGEX#vrmlscript:#'), + 1 => array('"'), + 2 => false + ) +); + +$this->_delimiterParseData = GESHI_CHILD_PARSE_LEFT; + +$this->_overridingChildContext = new GeSHiCodeContext('javascript'); + +?> diff --git a/paste/include/geshi/contexts/web3d/vrml1.php b/paste/include/geshi/contexts/web3d/vrml1.php new file mode 100644 index 0000000..c657149 --- /dev/null +++ b/paste/include/geshi/contexts/web3d/vrml1.php @@ -0,0 +1,214 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * ---------------------------------- + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array(); + +$this->_childContexts = array( + new GeSHiContext('web3d', $DIALECT, 'comment'), + new GeSHiContext('web3d', $DIALECT, 'string') +); + +$this->_contextKeywords = array( + 0 => array( + // nodes + 0 => array( + // sensors + 'CylinderSensor', 'PlaneSensor', 'ProximitySensor', 'SphereSensor', + 'TimeSensor', 'TouchSensor', 'VisibilitySensor', + // interpolators + 'ColorInterpolator', 'CoordinateInterpolator', 'NormalInterpolator', + 'OrientationInterpolator', 'PositionInterpolator', 'ScalarInterpolator', + // grouping nodes + 'Anchor', 'Billboard', 'Collision', 'Group', 'LOD', 'Switch', 'Transform', + // bindables + 'Background', 'Fog', 'NavigationInfo', 'Viewpoint', + // lights + 'DirectionalLight', 'PointLight', 'SpotLight', + // shape and geometry + 'Box', 'Cone', 'Coordinate', 'Cylinder', 'ElevationGrid', 'Extrusion', + 'IndexedFaceSet', 'IndexedLineSet', 'PointSet', 'Shape', 'Sphere', 'Text', + // appearance + 'Appearance', 'Color', 'FontStyle', 'Material', + 'Normal', 'TextureCoordinate', 'TextureTransform', + // textures + 'ImageTexture', 'MovieTexture', 'PixelTexture', + // sound + 'AudioClip', 'Sound', + // other + 'Inline', 'Script', 'WorldInfo' + ), + // name + 1 => $CONTEXT . '/node', + // style + 2 => 'color:#b1b100;', + // case sensitive + 3 => true, + // url + 4 => 'http://www.web3d.org/x3d/specifications/vrml/ISO-IEC-14772-IS-VRML97WithAmendment1/part1/nodesRef.html#{FNAME}' + ), + 1 => array( + // fields of nodes + 0 => array( + // A + 'addChildren', 'ambientIntensity', 'appearance', 'attenuation', 'autoOffset', + 'avatarSize', 'axisOfRotation', + // B + 'backUrl', 'bboxCenter', 'bboxSize', 'beamWidth', 'beginCap', + 'bindTime', 'bottom', 'bottomRadius', 'bottomUrl', + // C + 'ccw', 'center', 'children', 'choice', 'collide', + 'collideTime', 'color', 'colorIndex', 'colorPerVertex', 'convex', + 'coord', 'coordIndex', 'creaseAngle', 'crossSection', 'cutOffAngle', + 'cycleInterval', 'cycleTime', + // D + 'description', 'diffuseColor', 'direction', 'directOutput', + 'diskAngle', 'duration_changed', + // E + 'emissiveColor', 'enabled', 'endCap', 'enterTime', 'exitTime', + // F + 'family', 'fieldOfView', 'fogType', 'fontStyle', 'fraction_changed', + 'frontUrl', + // G + 'geometry', 'groundAngle', 'groundColor', + // H + 'headlight', 'height', 'hitNormal_changed', 'hitPoint_changed', 'horizontal', + // I + 'image', 'info', 'intensity', 'isActive', 'isBound', 'isOver', + // J + 'jump', 'justify', + // K + 'key', 'keyValue', + // L + 'language', 'leftUrl', 'leftToRight','length', 'level', + 'location', 'loop', + // M + 'material', 'maxAngle', 'maxBack', 'maxExtent', 'maxFront', + 'maxPosition', 'minAngle', 'minBack', 'minFront', 'minPosition', + 'mustEvaluate', + // N + 'normal', 'normalIndex', 'normalPerVertex', + // O + 'offset', 'on', 'orientation', 'orientation_changed', + // P + 'parameter', 'pitch', 'point', 'position', 'position_changed', + 'priority', 'proxy', + // Q + + // R + 'radius', 'range', 'removeChildren', 'repeatS', 'repeatT', + 'rightUrl', 'rotation', 'rotation_changed', + // S + 'scale', 'scaleOrientation', 'set_bind', 'set_colorIndex', 'set_coordIndex', + 'set_crossSection', 'set_fraction', 'set_height', 'set_normalIndex', 'set_orientation', + 'set_spine', 'set_scale', 'set_texCoordIndex', 'shininess', 'side', + 'size', 'skyAngle', 'skyColor', 'solid', 'source', + 'spacing', 'spatialization', 'specularColor', 'speed', 'spine', + 'startTime', 'stopTime', 'string', 'style', + // T + 'texCoord', 'texCoordIndex', 'texture', 'textureTransform', 'time', + 'title', 'top', 'topUrl', 'topToBottom', 'touchTime', + 'trackPoint_changed', 'translation', 'translation_changed', 'transparency', 'type', + // U + 'url', + // V + 'value_changed', 'vector', 'visibilityLimit', 'visibilityRange', + // W + 'whichChoice', + // X + 'xDimension', 'xSpacing', + // Y + + // Z + 'zDimension', 'zSpacing' + ), + 1 => $CONTEXT . '/field', + 2 => 'font-weight:bold;color:red;', + 3 => true, + 4 => '' + ), + 2 => array( + // keywords + 0 => array( + 'DEF', 'USE', 'IS', 'PROTO', 'EXTERNPROTO', 'TO', 'ROUTE', + 'TRUE', 'FALSE', 'NULL', + ), + 1 => $CONTEXT . '/keyword', + 2 => 'font-weight:bold;color:blue;', + 3 => true, + 4 => '' + ), + 3 => array( + // field access types + 0 => array( + 'eventIn', 'eventOut', 'exposedField', 'field', + ), + 1 => $CONTEXT . '/fieldaccess', + 2 => 'font-weight:bold;color:purple;', + 3 => true, + 4 => '' + ), + 4 => array( + // field data types + 0 => array( + 'SFBool', 'SFColor', 'SFFloat', 'SFImage', 'SFInt32', 'SFNode', + 'SFRotation', 'SFString', 'SFTime', 'SFVec2f', 'SFVec3f', + 'MFColor', 'MFFloat', 'MFInt32', 'MFNode', + 'MFRotation', 'MFString', 'MFTime', 'MFVec2f', 'MFVec3f', + ), + 1 => $CONTEXT . '/fieldtype', + 2 => 'color:green;', + 3 => true, + 4 => '' + ) +); + +$this->_contextSymbols = array( + 0 => array( + 0 => array( + '{', '}' + ), + 1 => $CONTEXT . '/nodesymbol', + 2 => 'color:#008000;' + ), + 1 => array( + 0 => array( + '[', ']' + ), + 1 => $CONTEXT . '/arraysymbol', + 2 => 'color:#008000;' + ) +); + +?>
\ No newline at end of file diff --git a/paste/include/geshi/contexts/web3d/vrml97.php b/paste/include/geshi/contexts/web3d/vrml97.php new file mode 100644 index 0000000..bf37220 --- /dev/null +++ b/paste/include/geshi/contexts/web3d/vrml97.php @@ -0,0 +1,218 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array(); + +$this->_childContexts = array( + new GeSHiContext('web3d', $DIALECT, 'comment'), + new GeSHiContext('web3d', $DIALECT, 'string') +); + +$this->_contextKeywords = array( + 0 => array( + // nodes + 0 => array( + // sensors + 'CylinderSensor', 'PlaneSensor', 'ProximitySensor', 'SphereSensor', + 'TimeSensor', 'TouchSensor', 'VisibilitySensor', + // interpolators + 'ColorInterpolator', 'CoordinateInterpolator', 'NormalInterpolator', + 'OrientationInterpolator', 'PositionInterpolator', 'ScalarInterpolator', + // grouping nodes + 'Anchor', 'Billboard', 'Collision', 'Group', 'LOD', 'Switch', 'Transform', + // bindables + 'Background', 'Fog', 'NavigationInfo', 'Viewpoint', + // lights + 'DirectionalLight', 'PointLight', 'SpotLight', + // shape and geometry + 'Box', 'Cone', 'Coordinate', 'Cylinder', 'ElevationGrid', 'Extrusion', + 'IndexedFaceSet', 'IndexedLineSet', 'PointSet', 'Shape', 'Sphere', 'Text', + // appearance + 'Appearance', 'Color', 'FontStyle', 'Material', + 'Normal', 'TextureCoordinate', 'TextureTransform', + // textures + 'ImageTexture', 'MovieTexture', 'PixelTexture', + // sound + 'AudioClip', 'Sound', + // other + 'Inline', 'Script', 'WorldInfo' + ), + // name + 1 => $CONTEXT . '/node', + // style + 2 => 'color:#b1b100;', + // case sensitive + 3 => true, + // url + 4 => 'http://www.web3d.org/x3d/specifications/vrml/ISO-IEC-14772-IS-VRML97WithAmendment1/part1/nodesRef.html#{FNAME}' + ), + 1 => array( + // fields of nodes + 0 => array( + // A + 'addChildren', 'ambientIntensity', 'appearance', 'attenuation', 'autoOffset', + 'avatarSize', 'axisOfRotation', + // B + 'backUrl', 'bboxCenter', 'bboxSize', 'beamWidth', 'beginCap', + 'bindTime', 'bottom', 'bottomRadius', 'bottomUrl', + // C + 'ccw', 'center', 'children', 'choice', 'collide', + 'collideTime', 'color', 'colorIndex', 'colorPerVertex', 'convex', + 'coord', 'coordIndex', 'creaseAngle', 'crossSection', 'cutOffAngle', + 'cycleInterval', 'cycleTime', + // D + 'description', 'diffuseColor', 'direction', 'directOutput', + 'diskAngle', 'duration_changed', + // E + 'emissiveColor', 'enabled', 'endCap', 'enterTime', 'exitTime', + // F + 'family', 'fieldOfView', 'fogType', 'fontStyle', 'fraction_changed', + 'frontUrl', + // G + 'geometry', 'groundAngle', 'groundColor', + // H + 'headlight', 'height', 'hitNormal_changed', 'hitPoint_changed', 'horizontal', + // I + 'image', 'info', 'intensity', 'isActive', 'isBound', 'isOver', + // J + 'jump', 'justify', + // K + 'key', 'keyValue', + // L + 'language', 'leftUrl', 'leftToRight','length', 'level', + 'location', 'loop', + // M + 'material', 'maxAngle', 'maxBack', 'maxExtent', 'maxFront', + 'maxPosition', 'minAngle', 'minBack', 'minFront', 'minPosition', + 'mustEvaluate', + // N + 'normal', 'normalIndex', 'normalPerVertex', + // O + 'offset', 'on', 'orientation', 'orientation_changed', + // P + 'parameter', 'pitch', 'point', 'position', 'position_changed', + 'priority', 'proxy', + // Q + + // R + 'radius', 'range', 'removeChildren', 'repeatS', 'repeatT', + 'rightUrl', 'rotation', 'rotation_changed', + // S + 'scale', 'scaleOrientation', 'set_bind', 'set_colorIndex', 'set_coordIndex', + 'set_crossSection', 'set_fraction', 'set_height', 'set_normalIndex', 'set_orientation', + 'set_spine', 'set_scale', 'set_texCoordIndex', 'shininess', 'side', + 'size', 'skyAngle', 'skyColor', 'solid', 'source', + 'spacing', 'spatialization', 'specularColor', 'speed', 'spine', + 'startTime', 'stopTime', 'string', 'style', + // T + 'texCoord', 'texCoordIndex', 'texture', 'textureTransform', 'time', + 'title', 'top', 'topUrl', 'topToBottom', 'touchTime', + 'trackPoint_changed', 'translation', 'translation_changed', 'transparency', 'type', + // U + 'url', + // V + 'value_changed', 'vector', 'visibilityLimit', 'visibilityRange', + // W + 'whichChoice', + // X + 'xDimension', 'xSpacing', + // Y + + // Z + 'zDimension', 'zSpacing' + ), + 1 => $CONTEXT . '/field', + 2 => 'font-weight:bold;color:red;', + 3 => true, + 4 => '' + ), + 2 => array( + // keywords + 0 => array( + 'DEF', 'USE', 'IS', 'PROTO', 'EXTERNPROTO', 'TO', 'ROUTE', + 'TRUE', 'FALSE', 'NULL', + ), + 1 => $CONTEXT . '/keyword', + 2 => 'font-weight:bold;color:blue;', + 3 => true, + 4 => '' + ), + 3 => array( + // field access types + 0 => array( + 'eventIn', 'eventOut', 'exposedField', 'field', + ), + 1 => $CONTEXT . '/fieldaccess', + 2 => 'font-weight:bold;color:purple;', + 3 => true, + 4 => '' + ), + 4 => array( + // field data types + 0 => array( + 'SFBool', 'SFColor', 'SFFloat', 'SFImage', 'SFInt32', 'SFNode', + 'SFRotation', 'SFString', 'SFTime', 'SFVec2f', 'SFVec3f', + 'MFColor', 'MFFloat', 'MFInt32', 'MFNode', + 'MFRotation', 'MFString', 'MFTime', 'MFVec2f', 'MFVec3f', + ), + 1 => $CONTEXT . '/fieldtype', + 2 => 'color:green;', + 3 => true, + 4 => '' + ) +); + +$this->_contextSymbols = array( + 0 => array( + 0 => array( + '{', '}' + ), + 1 => $CONTEXT . '/nodesymbol', + 2 => 'color:#008000;' + ), + 1 => array( + 0 => array( + '[', ']' + ), + 1 => $CONTEXT . '/arraysymbol', + 2 => 'color:#008000;' + ) +); + +$this->_contextRegexps = array( + 0 => geshi_use_doubles($CONTEXT), + 1 => geshi_use_integers($CONTEXT) +); + +?>
\ No newline at end of file diff --git a/paste/include/geshi/contexts/web3d/x3d_ascii.php b/paste/include/geshi/contexts/web3d/x3d_ascii.php new file mode 100644 index 0000000..fc58acc --- /dev/null +++ b/paste/include/geshi/contexts/web3d/x3d_ascii.php @@ -0,0 +1,221 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * ---------------------------------- + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$this->_contextDelimiters = array(); + +$this->_childContexts = array( + new GeSHiContext('web3d', $DIALECT, 'comment'), + new GeSHiContext('web3d', $DIALECT, 'string') +); + +$this->_contextKeywords = array( + 0 => array( + // nodes + 0 => array( + // sensors + 'CylinderSensor', 'PlaneSensor', 'ProximitySensor', 'SphereSensor', + 'TimeSensor', 'TouchSensor', 'VisibilitySensor', + // interpolators + 'ColorInterpolator', 'CoordinateInterpolator', 'NormalInterpolator', + 'OrientationInterpolator', 'PositionInterpolator', 'ScalarInterpolator', + // grouping nodes + 'Anchor', 'Billboard', 'Collision', 'Group', 'LOD', 'Switch', 'Transform', + // bindables + 'Background', 'Fog', 'NavigationInfo', 'Viewpoint', + // lights + 'DirectionalLight', 'PointLight', 'SpotLight', + // shape and geometry + 'Box', 'Cone', 'Coordinate', 'Cylinder', 'ElevationGrid', 'Extrusion', + 'IndexedFaceSet', 'IndexedLineSet', 'PointSet', 'Shape', 'Sphere', 'Text', + // appearance + 'Appearance', 'Color', 'FontStyle', 'Material', + 'Normal', 'TextureCoordinate', 'TextureTransform', + // textures + 'ImageTexture', 'MovieTexture', 'PixelTexture', + // sound + 'AudioClip', 'Sound', + // other + 'Inline', 'Script', 'WorldInfo' + ), + // name + 1 => $CONTEXT . '/node', + // style + 2 => 'color:#b1b100;', + // case sensitive + 3 => true, + // url + 4 => 'http://www.web3d.org/x3d/specifications/vrml/ISO-IEC-14772-IS-VRML97WithAmendment1/part1/nodesRef.html#{FNAME}' + ), + 1 => array( + // fields of nodes + 0 => array( + // A + 'addChildren', 'ambientIntensity', 'appearance', 'attenuation', 'autoOffset', + 'avatarSize', 'axisOfRotation', + // B + 'backUrl', 'bboxCenter', 'bboxSize', 'beamWidth', 'beginCap', + 'bindTime', 'bottom', 'bottomRadius', 'bottomUrl', + // C + 'ccw', 'center', 'children', 'choice', 'collide', + 'collideTime', 'color', 'colorIndex', 'colorPerVertex', 'convex', + 'coord', 'coordIndex', 'creaseAngle', 'crossSection', 'cutOffAngle', + 'cycleInterval', 'cycleTime', + // D + 'description', 'diffuseColor', 'direction', 'directOutput', + 'diskAngle', 'duration_changed', + // E + 'emissiveColor', 'enabled', 'endCap', 'enterTime', 'exitTime', + // F + 'family', 'fieldOfView', 'fogType', 'fontStyle', 'fraction_changed', + 'frontUrl', + // G + 'geometry', 'groundAngle', 'groundColor', + // H + 'headlight', 'height', 'hitNormal_changed', 'hitPoint_changed', 'horizontal', + // I + 'image', 'info', 'intensity', 'isActive', 'isBound', 'isOver', + // J + 'jump', 'justify', + // K + 'key', 'keyValue', + // L + 'language', 'leftUrl', 'leftToRight','length', 'level', + 'location', 'loop', + // M + 'material', 'maxAngle', 'maxBack', 'maxExtent', 'maxFront', + 'maxPosition', 'minAngle', 'minBack', 'minFront', 'minPosition', + 'mustEvaluate', + // N + 'normal', 'normalIndex', 'normalPerVertex', + // O + 'offset', 'on', 'orientation', 'orientation_changed', + // P + 'parameter', 'pitch', 'point', 'position', 'position_changed', + 'priority', 'proxy', + // Q + + // R + 'radius', 'range', 'removeChildren', 'repeatS', 'repeatT', + 'rightUrl', 'rotation', 'rotation_changed', + // S + 'scale', 'scaleOrientation', 'set_bind', 'set_colorIndex', 'set_coordIndex', + 'set_crossSection', 'set_fraction', 'set_height', 'set_normalIndex', 'set_orientation', + 'set_spine', 'set_scale', 'set_texCoordIndex', 'shininess', 'side', + 'size', 'skyAngle', 'skyColor', 'solid', 'source', + 'spacing', 'spatialization', 'specularColor', 'speed', 'spine', + 'startTime', 'stopTime', 'string', 'style', + // T + 'texCoord', 'texCoordIndex', 'texture', 'textureTransform', 'time', + 'title', 'top', 'topUrl', 'topToBottom', 'touchTime', + 'trackPoint_changed', 'translation', 'translation_changed', 'transparency', 'type', + // U + 'url', + // V + 'value_changed', 'vector', 'visibilityLimit', 'visibilityRange', + // W + 'whichChoice', + // X + 'xDimension', 'xSpacing', + // Y + + // Z + 'zDimension', 'zSpacing' + ), + 1 => $CONTEXT . '/field', + 2 => 'font-weight:bold;color:red;', + 3 => true, + 4 => '' + ), + 2 => array( + // keywords + 0 => array( + 'DEF', 'USE', 'IS', 'PROTO', 'EXTERNPROTO', 'TO', 'ROUTE', + 'TRUE', 'FALSE', 'NULL', + // X3D + 'IMPORT', 'EXPORT', 'PROFILE', 'COMPONENT', 'META' + ), + 1 => $CONTEXT . '/keyword', + 2 => 'font-weight:bold;color:blue;', + 3 => true, + 4 => '' + ), + 3 => array( + // field access types + 0 => array( + 'eventIn', 'eventOut', 'exposedField', 'field', + // X3D + 'inputOnly', 'outputOnly', 'inputOutput', 'initializeOnly' + ), + 1 => $CONTEXT . '/fieldaccess', + 2 => 'font-weight:bold;color:purple;', + 3 => true, + 4 => '' + ), + 4 => array( + // field data types + 0 => array( + 'SFBool', 'SFColor', 'SFFloat', 'SFImage', 'SFInt32', 'SFNode', + 'SFRotation', 'SFString', 'SFTime', 'SFVec2f', 'SFVec3f', + 'MFColor', 'MFFloat', 'MFInt32', 'MFNode', + 'MFRotation', 'MFString', 'MFTime', 'MFVec2f', 'MFVec3f', + // X3D + 'SFColorRGBA', 'SFDouble', 'SFVec2d', 'SFVec3d', + 'MFBool', 'MFColorRGBA', 'MFDouble', 'MFImage', 'MFVec2d', 'MFVec3d' + ), + 1 => $CONTEXT . '/fieldtype', + 2 => 'color:green;', + 3 => true, + 4 => '' + ) +); + +$this->_contextSymbols = array( + 0 => array( + 0 => array( + '{', '}' + ), + 1 => $CONTEXT . '/nodesymbol', + 2 => 'color:#008000;' + ), + 1 => array( + 0 => array( + '[', ']' + ), + 1 => $CONTEXT . '/arraysymbol', + 2 => 'color:#008000;' + ) +); + +?>
\ No newline at end of file diff --git a/paste/include/geshi/functions.geshi.php b/paste/include/geshi/functions.geshi.php new file mode 100644 index 0000000..8e34b74 --- /dev/null +++ b/paste/include/geshi/functions.geshi.php @@ -0,0 +1,282 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package core + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +$GLOBALS['geshi_dbg_level'] = 0; +function geshi_dbg_level ($level) { + $GLOBALS['geshi_dbg_level'] = $level; +} + +/** + * Handles debugging by printing a message according to current debug level, + * mask of context and other things. + * + * @param string The message to print out + * @param int The context in which this message is to be printed out in - see + * the GESHI_DBG_* constants + * @param boolean Whether to add a newline to the message + * @param boolean Whether to return the count of errors or not + */ +function geshi_dbg ($message, $context, $add_nl = true, $return_counts = false) +{ + if ((GESHI_DBG & $context) || ($GLOBALS['geshi_dbg_level'] & $context)) { + // + // Message can have the following symbols at start + // + // @b: bold + // @i: italic + // @o: ok (green colour) + // @w: warn (yellow colour) + // @e: err (red colour) + $test = substr($message, 0, 2); + $start = ''; + $end = '</span>'; + switch ($test) { + case '@b': + $start = '<span style="font-weight:bold;">'; + break; + + case '@i': + $start = '<span style="font-style:italic;">'; + break; + + case '@o': + $start = '<span style="color:green;background-color:#efe;border:1px solid #393;">'; + break; + + case '@w': + $start = '<span style="color:#660;background-color:#ffe;border:1px solid #993;">'; + break; + + case '@e': + $start = '<span style="color:red;background-color:#fee;border:1px solid #933;">'; + break; + + default: + $end = ''; + } + + if(preg_match('#(.*?)::(.*?)\((.*?)\)#si', $message)) { + $start = '<span style="font-weight:bold;">'; + $end = '</span>'; + } + + if (preg_match('#^@[a-z]#', $message)) { + $message = substr($message, 2); + } + echo $start . htmlspecialchars(str_replace("\n", '', $message)) . $end; + if ($add_nl) echo "\n"; + } +} + +/** + * Checks whether a file name is able to be read by GeSHi + * + * The file must be within the GESHI_ROOT directory + * + * @param string The absolute pathname of the file to check + * @return boolean Whether the file is readable by GeSHi + */ +function geshi_can_include ($file_name) +{ + return (GESHI_ROOT == substr($file_name, 0, strlen(GESHI_ROOT)) && + is_file($file_name) && is_readable($file_name)); +} + + +/** + * Drop-in replacement for strpos and stripos. Also can handle regular expression + * string positions. + * + * @param string The string in which to search for the $needle + * @param string The string to search for. If this string starts with "REGEX" then + * a regular expression search is performed. + * @param int The offset in the string in which to start searching + * @param boolean Whether the search is case sensitive or not + * @param boolean Whether the match table is needed (almost never, and it makes things slower) + * @return array An array of data: + * <pre> 'pos' => position in string of needle, + * 'len' => length of match + * 'tab' => a table of the stuff matched in brackets for a regular expression</pre> + */ +function geshi_get_position ($haystack, $needle, $offset = 0, $case_sensitive = false, $need_table = false) +{ + //geshi_dbg('Checking haystack: ' . $haystack . ' against needle ' . $needle . ' (' . $offset . ')',GESHI_DBG_PARSE, false); + if ('REGEX' != substr($needle, 0, 5)) { + if (!$case_sensitive) { + return array('pos' => stripos($haystack, $needle, $offset), 'len' => strlen($needle)); + } else { + return array('pos' => strpos($haystack, $needle, $offset), 'len' => strlen($needle)); + } + } + + // geshi_preg_match_pos + + $regex = substr($needle, 5); + $string = $haystack; + + $foo = microtime(); + $foo_len = strlen($foo); + $len = strlen($string); + $str = preg_replace($regex, $foo, $string, 1); + $length = $len - (strlen($str) - $foo_len); + + // ADD SOME MORE: Return matching table (?) + if ($need_table) { + $matches = array(); + preg_match_all($regex, $string, $matches); + //$table = $matches; + $i = 0; + $table = array(); + foreach ( $matches as $match ) { + $table[$i++] = (isset($match[0])) ? $match[0] : null; + } + } else { + $table = array(); + } + return array('pos' => strpos($str, $foo), 'len' => $length, 'tab' => $table); +} + +/** + * Returns the regexp for integer numbers, for use with GeSHiCodeContexts + * + * @param string The prefix to use for the name of this number match + * @return array + */ +function geshi_use_integers ($prefix) +{ + return array( + 0 => array( + '#([^a-zA-Z_0-9\.]|^)([-]?[0-9]+)(?=[^a-zA-Z_0-9]|$)#' + ), + 1 => '', + 2 => array( + 1 => true, // catch banned stuff for highlighting by the code context that it is in + 2 => array( + 0 => $prefix . '/' . GESHI_NUM_INT, + 1 => 'color:#11e;', + 2 => false + ), + 3 => true + ) + ); +} + +/** + * Returns the regexp for double numbers, for use with GeSHiCodeContexts + * + * @param string The prefix to use for the name of this number match + * @param boolean Whether a number is required in front of the decimal point or not. + * @return array + */ +function geshi_use_doubles ($prefix, $require_leading_number = false) +{ + $banned = '[^a-zA-Z_0-9]'; + $plus_minus = '[\-\+]?'; + $leading_number_symbol = ($require_leading_number) ? '+' : '*'; + + return array( + 0 => array( + // double precision with e, e.g. 3.5e7 or -.45e2 + "#(^|$banned)?({$plus_minus}[0-9]$leading_number_symbol\.[0-9]+[eE]{$plus_minus}[0-9]+)($banned|\$)?#", + // double precision with e and no decimal place, e.g. 5e2 + "#(^|$banned)?({$plus_minus}[0-9]+[eE]{$plus_minus}[0-9]+)($banned|\$)?#", + // double precision (.123 or 34.342 for example) + // There are some cases where the - sign will not be highlighted for various reasons, + // but I'm happy that it's done where it can be. Maybe it might be worth looking at + // later if there are any real problems, else I'll ignore it + "#(^|$banned)?({$plus_minus}[0-9]$leading_number_symbol\.[0-9]+)($banned|\$)?#" + ), + 1 => '.', //doubles must have a dot + 2 => array( + 1 => true, // as above, catch for normal stuff + 2 => array( + 0 => $prefix . '/' . GESHI_NUM_DBL, + 1 => 'color:#d3d;', + 2 => false // Don't attempt to highlight numbers as code + ), + 3 => true, + //4 => true + ) + ); +} + + +// @todo [blocking 1.1.9] fix this up +// +----------------------------------------------------------------------+ +// | PHP Version 4 | +// +----------------------------------------------------------------------+ +// | Copyright (c) 1997-2004 The PHP Group | +// +----------------------------------------------------------------------+ +// | This source file is subject to version 3.0 of the PHP license, | +// | that is bundled with this package in the file LICENSE, and is | +// | available at through the world-wide-web at | +// | http://www.php.net/license/3_0.txt. | +// | If you did not receive a copy of the PHP license and are unable to | +// | obtain it through the world-wide-web, please send a note to | +// | license@php.net so we can mail you a copy immediately. | +// +----------------------------------------------------------------------+ +// | Authors: Aidan Lister <aidan@php.net> | +// +----------------------------------------------------------------------+ +// +/** + * Replace stripos() + * + * This function lifted from the PHP_Compat PEAR package, and optimised + * + * @author Aidan Lister <aidan@php.net>, Nigel McNie <nigel@geshi.org> + * @version 1.1.0 + */ +if (!function_exists('stripos')) { + function stripos ( $haystack, $needle, $offset = null ) + { + // Manipulate the string if there is an offset + $fix = 0; + if (!is_null($offset)) { + if ($offset > 0) { + $haystack = substr($haystack, $offset); + $fix = $offset; + } + } + $segments = explode(strtolower($needle), strtolower($haystack), 2); + + // Check there was a match + if (count($segments) == 1) { + return false; + } + + return strlen($segments[0]) + $fix; + } +} + +?> diff --git a/paste/include/geshi/languages/codeworker/codeworker.php b/paste/include/geshi/languages/codeworker/codeworker.php new file mode 100644 index 0000000..617b5ea --- /dev/null +++ b/paste/include/geshi/languages/codeworker/codeworker.php @@ -0,0 +1,52 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/* + * Codeworker language file for GeSHi + * + * [notes about language] + * + * [notes about this implementation of the language] + * + */ + +/** Get the GeSHiCodeContext class */ +require_once GESHI_CLASSES_ROOT . 'class.geshicodecontext.php'; + + +$this->_humanLanguageName = 'CodeWorker'; + +$this->_rootContext =& new GeSHiCodeContext('codeworker'); + +?> diff --git a/paste/include/geshi/languages/css/css.php b/paste/include/geshi/languages/css/css.php new file mode 100644 index 0000000..d42505d --- /dev/null +++ b/paste/include/geshi/languages/css/css.php @@ -0,0 +1,52 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/* + * CSS language file for GeSHi + * + * [notes about language] + * + * [notes about this implementation of the language] + * + */ + +/** Get the GeSHiCodeContext class */ +require_once GESHI_CLASSES_ROOT . 'class.geshicodecontext.php'; + + +$this->_humanLanguageName = 'CSS'; + +$this->_rootContext =& new GeSHiCodeContext('css'); + +?>
\ No newline at end of file diff --git a/paste/include/geshi/languages/delphi/delphi.php b/paste/include/geshi/languages/delphi/delphi.php new file mode 100644 index 0000000..8d55b10 --- /dev/null +++ b/paste/include/geshi/languages/delphi/delphi.php @@ -0,0 +1,54 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Benny Baumann <BenBE@benbe.omorphia.de>, Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/* + * Delphi language file for GeSHi + * + * [notes about language] + * + * This implementation of delphi uses it's own version of ASM. It might + * be the case in the future that another version of ASM is similar enough + * for it to be used instead of the current delphi-specific one. + * + */ + +/** Get the GeSHiCodeContext class */ +require_once GESHI_CLASSES_ROOT . 'class.geshicodecontext.php'; + + +$this->_humanLanguageName = 'Delphi'; + +$this->_rootContext =& new GeSHiCodeContext('delphi'); + +?> diff --git a/paste/include/geshi/languages/html/html.php b/paste/include/geshi/languages/html/html.php new file mode 100644 index 0000000..e6a0768 --- /dev/null +++ b/paste/include/geshi/languages/html/html.php @@ -0,0 +1,52 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/* + * HTML language file for GeSHi + * + * [notes about language] + * + * [notes about this implementation of the language] + * + */ + +/** Get the GeSHiCodeContext class */ +require_once GESHI_CLASSES_ROOT . 'class.geshicodecontext.php'; + + +$this->_humanLanguageName = 'HTML'; + +$this->_rootContext =& new GeSHiCodeContext('html'); + +?>
\ No newline at end of file diff --git a/paste/include/geshi/languages/javascript/javascript.php b/paste/include/geshi/languages/javascript/javascript.php new file mode 100644 index 0000000..354ac04 --- /dev/null +++ b/paste/include/geshi/languages/javascript/javascript.php @@ -0,0 +1,52 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/* + * Javascript language file for GeSHi + * + * [notes about language] + * + * [notes about this implementation of the language] + * + */ + +/** Get the GeSHiCodeContext class */ +require_once GESHI_CLASSES_ROOT . 'class.geshicodecontext.php'; + + +$this->_humanLanguageName = 'Javascript'; + +$this->_rootContext =& new GeSHiCodeContext('javascript'); + +?>
\ No newline at end of file diff --git a/paste/include/geshi/languages/php/php.php b/paste/include/geshi/languages/php/php.php new file mode 100644 index 0000000..e627d86 --- /dev/null +++ b/paste/include/geshi/languages/php/php.php @@ -0,0 +1,53 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/* + * PHP language file for GeSHi + * + * [notes about language] + * + * [notes about this implementation of the language] + * + */ + +/** Get the GeSHiCodeContext class */ +require_once GESHI_CLASSES_ROOT . 'class.geshicodecontext.php'; + + +$this->_humanLanguageName = 'PHP'; + +$this->_rootContext =& new GeSHiCodeContext('html'); +$this->_rootContext->infectWith(new GeSHiCodeContext('php')); + +?> diff --git a/paste/include/geshi/languages/php/php4.php b/paste/include/geshi/languages/php/php4.php new file mode 100644 index 0000000..2b20c9b --- /dev/null +++ b/paste/include/geshi/languages/php/php4.php @@ -0,0 +1,54 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * ---------------------------------- + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/* + * PHP4 language file for GeSHi + * + * [notes about language] + * + * [notes about this implementation of the language] + * + */ + +/** Get the GeSHiCodeContext class */ +require_once GESHI_CLASSES_ROOT . 'class.geshicodecontext.php'; + + +$this->_humanLanguageName = 'PHP4'; + +$this->_rootContext =& new GeSHiCodeContext('html'); +$this->_rootContext->infectWith(new GeSHiCodeContext('php', 'php4')); + +?> diff --git a/paste/include/geshi/languages/php/php5.php b/paste/include/geshi/languages/php/php5.php new file mode 100644 index 0000000..e108c04 --- /dev/null +++ b/paste/include/geshi/languages/php/php5.php @@ -0,0 +1,53 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/* + * PHP5 language file for GeSHi + * + * [notes about language] + * + * [notes about this implementation of the language] + * + */ + +/** Get the GeSHiCodeContext class */ +require_once GESHI_CLASSES_ROOT . 'class.geshicodecontext.php'; + + +$this->_humanLanguageName = 'PHP'; + +$this->_rootContext =& new GeSHiCodeContext('html'); +$this->_rootContext->infectWith(new GeSHiCodeContext('php', 'php5')); + +?> diff --git a/paste/include/geshi/languages/qbasic/qbasic.php b/paste/include/geshi/languages/qbasic/qbasic.php new file mode 100644 index 0000000..f69847c --- /dev/null +++ b/paste/include/geshi/languages/qbasic/qbasic.php @@ -0,0 +1,52 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/* + * QBasic language file for GeSHi + * + * [notes about language] + * + * [notes about this implementation of the language] + * + */ + +/** Get the GeSHiCodeContext class */ +require_once GESHI_CLASSES_ROOT . 'class.geshicodecontext.php'; + + +$this->_humanLanguageName = 'QBasic'; + +$this->_rootContext =& new GeSHiCodeContext('qbasic'); + +?>
\ No newline at end of file diff --git a/paste/include/geshi/languages/web3d/vrml97.php b/paste/include/geshi/languages/web3d/vrml97.php new file mode 100644 index 0000000..d39326b --- /dev/null +++ b/paste/include/geshi/languages/web3d/vrml97.php @@ -0,0 +1,46 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * ---------------------------------- + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package lang + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** Get the GeSHiCodeContext class */ +require_once GESHI_CLASSES_ROOT . 'class.geshicodecontext.php'; + +/** + * VRML97 Language file for GeSHi + */ +$this->_humanLanguageName = 'VRML97'; + +$this->_rootContext =& new GeSHiCodeContext('web3d', 'vrml97'); + +?>
\ No newline at end of file diff --git a/paste/include/geshi/scripts/get-keywords/docs/README b/paste/include/geshi/scripts/get-keywords/docs/README new file mode 100644 index 0000000..ad60041 --- /dev/null +++ b/paste/include/geshi/scripts/get-keywords/docs/README @@ -0,0 +1,23 @@ +get-keywords.php is a script to get a current list of all the keywords for a particular language. + +Currently it's very alpha, just like the rest of this stuff. I run Debian and KDE, and so I have +access to the katepart XML files in /usr/share/apps/katepart/syntax. Thus, the keyword getter +strategies that use parser those files work for me. + +If you know where these files are online, feel free to write a strategy implementation that gets +the file from the 'net and uses that (perhaps from KDE SVN?). + +No real documentation I'm afraid... just look through the code and look at how the various keyword +strategy stuff is implemented in language/*/class.*getterstrategy.php. + +Oh, and to use: + +php get-keywords.php [lang] [group[ +php get-keywords.php --list-langs +php get-keywords.php --list-groups [language] + +In the future: + +php get-keywords.php ... --output-format=[HTML|text|special] + + $Id: README,v 1.2 2005/06/09 13:31:35 oracleshinoda Exp $ diff --git a/paste/include/geshi/scripts/get-keywords/get-keywords.php b/paste/include/geshi/scripts/get-keywords/get-keywords.php new file mode 100644 index 0000000..c5d4534 --- /dev/null +++ b/paste/include/geshi/scripts/get-keywords/get-keywords.php @@ -0,0 +1,143 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package scripts + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +define('GESHI_GET_KEYWORDS_VERSION', '0.1.2'); + +/** + * Script to get keywords for languages from katepart kde package + * + * Usage: + * get-keywords.php css properties + * get-keywords.php css attributes + * get-keywords.php php statements + * get-keywords.php php keywords + * get-keywords.php --list-langs + * get-keywords.php --list-groups css + * ... + * + * @todo [blocking 1.1.1] customise output format options (one per line, formatted for pasting into lang file, HTML) + */ + +// As always... +error_reporting(E_ALL); + +/** Get standard functions */ +require_once 'lib/functions.get-keywords.php'; +/** Get the KeywordGetter class */ +require_once 'lib/class.keywordgetter.php'; +/** Get the console options reader class */ +require_once 'lib/pear/Console/Getopt.php'; + +// Parse command line options +$opt_parser =& new Console_Getopt; +$args = $opt_parser->getopt($argv, 'hv', array('help', 'version', 'list-groups=', 'list-langs')); + +// Print error if there was an argument not recognised +if (PEAR::isError($args)) { + echo str_replace('Console_Getopt', $argv[0], $args->getMessage()) . ' +Try `' . $argv[0] . " --help' for more information.\n"; + exit(1); +} + + +// +// Do the easy options first +// + +// Check for help +if (get_option(array('h', 'help'), $args)) { + show_help(); + exit; +} + +// Check for version +if (get_option(array('v', 'version'), $args)) { + show_version(); + exit; +} + +// Check for --list-langs +if (get_option('list-langs', $args)) { + $languages = KeywordGetter::getSupportedLanguages(); + print_r($languages); + exit; +} + +// Check for --list-groups +if (false !== ($language = get_option('list-groups', $args))) { + $kwgetter =& KeywordGetter::factory($language); + if (KeywordGetter::isError($kwgetter)) { + die($kwgetter->lastError()); + } + print_r($kwgetter->getValidKeywordGroups()); + exit; +} + + +// +// Simple options are not being used - time to actually +// get keywords if we can +// + +// If we don't have a language and a keyword type, show the help and exit +if (!isset($argv[1]) || !isset($argv[2])) { + show_help(); + exit; +} + +// Create a new keyword getter. If this language is not supported, exit +$kwgetter =& KeywordGetter::factory($argv[1]); +if (KeywordGetter::isError($kwgetter)) { + die($kwgetter->lastError()); +} + +// Get the keywords based on the required keyword group. If there +// is an error getting the keywords, print it and exit +$keywords = $kwgetter->getKeywords($argv[2]); +if (KeywordGetter::isError($keywords)) { + die($keywords->lastError()); +} + +// Simply echo to standard out, although a todo would be to make this customisable +// @todo [blocking 1.1.1] Customise the output of keywords (to a file perhaps?) +$result = ''; +$spaces = ' '; +foreach ($keywords as $keyword) { + $result .= "'".$keyword . "', "; +} +$result = wordwrap($result, 75); +$result = $spaces . str_replace("\n", "\n$spaces", $result); +echo substr($result, 0, -2) . "\n"; + +?> diff --git a/paste/include/geshi/scripts/get-keywords/languages/css/class.csskeywordgetter.php b/paste/include/geshi/scripts/get-keywords/languages/css/class.csskeywordgetter.php new file mode 100644 index 0000000..397d2ea --- /dev/null +++ b/paste/include/geshi/scripts/get-keywords/languages/css/class.csskeywordgetter.php @@ -0,0 +1,101 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package scripts + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** Get the CSS XML parser used for getting CSS keywords */ +require_once 'class.cssxmlparser.php'; + +/** + * Implementation of KeywordGetterStrategy for the CSS language. + * + * @package scripts + * @author Nigel McNie <nigel@geshi.org> + * @since 0.1.0 + * @version 1.1.0 + * @see KeywordGetterStrategy + */ +class cssKeywordGetterStrategy extends KeywordGetterStrategy +{ + /** + * Creates a new CSS Keyword Getter Strategy. Defines allowed + * keyword groups for CSS. + */ + function cssKeywordGetterStrategy () + { + $this->_language = 'CSS'; + $this->_validKeywordGroups = array( + 'properties', 'types', 'colors', 'paren', 'mediatypes', 'pseudoclasses' + ); + } + + /** + * Implementation of abstract method {@link KeywordGetterStrategy::getKeywords()} + * to get keywords for CSS + * + * @param string The keyword group to get keywords for. If not a valid keyword + * group an error is returned + * @return array The keywords for CSS for the specified keyword group + * @throws KeywordGetterError + */ + function getKeywords ($keyword_group) + { + // Check that keyword group listed is valid + $group_valid = $this->keywordGroupIsValid($keyword_group); + if (KeywordGetter::isError($group_valid)) { + return $group_valid; + } + + $xml_parser =& new CSS_XML_Parser; + $xml_parser->setKeywordGroup($keyword_group); + + // Set the file to parse to Nigel's local CSS syntax file. + // @todo [blocking 1.1.9] Find online if possible (check kde.org) and link to that + // @todo [blocking 1.1.9] Make configurable the file? Have at least hardcoded ones for me and for the web + $result =& $xml_parser->setInputFile('/usr/share/apps/katepart/syntax/css.xml'); + if (PEAR::isError($result)) { + return new KeywordGetterError(FILE_UNAVAILABLE, $this->_language, + array('{FILENAME}' => '/usr/share/apps/katepart/syntax/css.xml')); + } + + $result =& $xml_parser->parse(); + if (PEAR::isError($result)) { + return new KeywordGetterError(PARSE_ERROR, $this->_language, + array('{PARSE_ERROR}' => $result->getMessage())); + } + + $keywords =& $xml_parser->getKeywords(); + return array_unique($keywords); + } +} + +?> diff --git a/paste/include/geshi/scripts/get-keywords/languages/css/class.cssxmlparser.php b/paste/include/geshi/scripts/get-keywords/languages/css/class.cssxmlparser.php new file mode 100644 index 0000000..dd2f576 --- /dev/null +++ b/paste/include/geshi/scripts/get-keywords/languages/css/class.cssxmlparser.php @@ -0,0 +1,112 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package scripts + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** Get the Keyword XML Parser class for use by CSS_XML_Parser */ +require_once 'lib/class.keywordxmlparser.php'; + +/** + * Extends Keyword_XML_Parser as a class to get CSS keywords from + * a katepart syntax XML file + * + * @package scripts + * @author Nigel McNie <nigel@geshi.org> + * @since 0.1.0 + * @version 1.1.0 + * @see Keyword_XML_Parser + */ +class CSS_XML_Parser extends Keyword_XML_Parser +{ + /**#@+ + * @var boolean + * @access private + */ + /** + * Whether we are currently in the block of the XML file + * with items of the correct type + */ + var $_valid; + + /** + * Whether we should add the next CDATA we encounter. This + * is made true when we encounter an ITEM node + */ + var $_addKeyword; + + /** + * A list of keywords to ignore + * @var array + */ + var $_keywordsToIgnore = array('100', '200', '300', '400', '500', '600', '700', '800', '900'); + /**#@-*/ + + /** + * Called when the start tag of a node of the + * XML document is encountered + * + * @param resource XML Parser Resource + * @param string The name of the node encountered + * @param array Any attributes the node has + */ + function startHandler ($xp, $name, $attributes) + { + if ('LIST' == $name) { + if ($attributes['NAME'] == $this->_keywordGroup) { + $this->_valid = true; + } else { + $this->_valid = false; + } + } + if ($this->_valid && 'ITEM' == $name) { + $this->_addKeyword = true; + } else { + $this->_addKeyword = false; + } + } + + /** + * Called when CDATA is encountered + * + * @param resource XML Parser resource + * @param string The CDATA encountered + */ + function cdataHandler ($xp, $cdata) + { + if ($this->_addKeyword && !in_array(trim($cdata), $this->_keywordsToIgnore)) { + array_push($this->_keywords, trim($cdata)); + } + $this->_addKeyword = false; + } +} + +?> diff --git a/paste/include/geshi/scripts/get-keywords/languages/html/class.htmlkeywordgetter.php b/paste/include/geshi/scripts/get-keywords/languages/html/class.htmlkeywordgetter.php new file mode 100644 index 0000000..a8a8a7e --- /dev/null +++ b/paste/include/geshi/scripts/get-keywords/languages/html/class.htmlkeywordgetter.php @@ -0,0 +1,96 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package scripts + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** + * Implementation of KeywordGetterStrategy for the HTML language. + * + * @package scripts + * @author Nigel McNie <nigel@geshi.org> + * @since 0.1.1 + * @version 1.1.0 + * @see KeywordGetterStrategy + */ +class htmlKeywordGetterStrategy extends KeywordGetterStrategy +{ + /** + * The file from which the attribute names will be raided + * @var string + * @access private + */ + var $_fileName = '/usr/share/doc/w3-recs/RECS/html4/index/attributes.html'; + + /** + * Creates a new HTML Keyword Getter Strategy. Defines allowed + * keyword groups for HTML. + */ + function htmlKeywordGetterStrategy () + { + $this->_language = 'HTML'; + $this->_validKeywordGroups = array( + 'attributes' + ); + } + + /** + * Implementation of abstract method {@link KeywordGetterStrategy::getKeywords()} + * to get keywords for HTML + * + * @param string The keyword group to get keywords for. If not a valid keyword + * group an error is returned + * @return array The keywords for HTML for the specified keyword group + * @throws KeywordGetterError + */ + function getKeywords ($keyword_group) + { + // Check that keyword group listed is valid + $group_valid = $this->keywordGroupIsValid($keyword_group); + if (KeywordGetter::isError($group_valid)) { + return $group_valid; + } + + if (!is_readable($this->_fileName)) { + return new KeywordGetterError(FILE_UNAVAILABLE, $this->_language, + array('{FILENAME}' => $this->_fileName)); + } + + $file_contents = implode('', file($this->_fileName)); + $matches = array(); + preg_match_all('#<td title="Name"><a[^>]+>\s*([a-z\-]+)#', $file_contents, $matches); + $keywords = $matches[1]; + + return array_unique($keywords); + } +} + +?> diff --git a/paste/include/geshi/scripts/get-keywords/languages/javascript/class.javascriptkeywordgetter.php b/paste/include/geshi/scripts/get-keywords/languages/javascript/class.javascriptkeywordgetter.php new file mode 100644 index 0000000..b25c26e --- /dev/null +++ b/paste/include/geshi/scripts/get-keywords/languages/javascript/class.javascriptkeywordgetter.php @@ -0,0 +1,121 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package scripts + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** Get the Javascript XML parser used for getting Javascript keywords */ +require_once 'class.javascriptxmlparser.php'; + +/** + * Implementation of KeywordGetterStrategy for the Javascript language. + * + * @package scripts + * @author Nigel McNie <nigel@geshi.org> + * @since 0.1.1 + * @version 1.1.0 + * @see KeywordGetterStrategy + */ +class javascriptKeywordGetterStrategy extends KeywordGetterStrategy +{ + + /** + * Extra keywords missed by the language file + * + * @var array + * @access private + */ + var $_missedKeywords = array( + 'keywords' => array( + 'null' + ), + 'methods' => array( + 'getElementById' + ) + ); + + /** + * Creates a new Javascript Keyword Getter Strategy. Defines allowed + * keyword groups for Javascript. + */ + function javascriptKeywordGetterStrategy () + { + $this->_language = 'Javascript'; + $this->_validKeywordGroups = array( + 'keywords', 'functions', 'objects', 'math', 'events', 'methods' + ); + } + + /** + * Implementation of abstract method {@link KeywordGetterStrategy::getKeywords()} + * to get keywords for Javascript + * + * @param string The keyword group to get keywords for. If not a valid keyword + * group an error is returned + * @return array The keywords for Javascript for the specified keyword group + * @throws KeywordGetterError + */ + function getKeywords ($keyword_group) + { + // Check that keyword group listed is valid + $group_valid = $this->keywordGroupIsValid($keyword_group); + if (KeywordGetter::isError($group_valid)) { + return $group_valid; + } + + $xml_parser =& new Javascript_XML_Parser; + $xml_parser->setKeywordGroup($keyword_group); + + // Set the file to parse to Nigel's local Javascript syntax file. + $result =& $xml_parser->setInputFile('/usr/share/apps/katepart/syntax/javascript.xml'); + if (PEAR::isError($result)) { + return new KeywordGetterError(FILE_UNAVAILABLE, $this->_language, + array('{FILENAME}' => '/usr/share/apps/katepart/syntax/javascript.xml')); + } + + $result =& $xml_parser->parse(); + if (PEAR::isError($result)) { + return new KeywordGetterError(PARSE_ERROR, $this->_language, + array('{PARSE_ERROR}' => $result->getMessage())); + } + + $keywords =& $xml_parser->getKeywords(); + //@todo [blocking 1.1.1] move missedkeywords functionality into common place + // as well as unique and sorts + if (isset($this->_missedKeywords[$keyword_group])) { + $keywords = array_merge($keywords, $this->_missedKeywords[$keyword_group]); + } + sort($keywords); + return array_unique($keywords); + } +} + +?> diff --git a/paste/include/geshi/scripts/get-keywords/languages/javascript/class.javascriptxmlparser.php b/paste/include/geshi/scripts/get-keywords/languages/javascript/class.javascriptxmlparser.php new file mode 100644 index 0000000..a427494 --- /dev/null +++ b/paste/include/geshi/scripts/get-keywords/languages/javascript/class.javascriptxmlparser.php @@ -0,0 +1,107 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package scripts + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** Get the Keyword XML Parser class for use by Javascript_XML_Parser */ +require_once 'lib/class.keywordxmlparser.php'; + +/** + * Extends Keyword_XML_Parser as a class to get Javascript keywords from + * a katepart syntax XML file + * + * @package scripts + * @author Nigel McNie <nigel@geshi.org> + * @since 0.1.1 + * @version 1.1.0 + * @see Keyword_XML_Parser + */ +class Javascript_XML_Parser extends Keyword_XML_Parser +{ + /**#@+ + * @var boolean + * @access private + */ + /** + * Whether we are currently in the block of the XML file + * with items of the correct type + */ + var $_valid; + + /** + * Whether we should add the next CDATA we encounter. This + * is made true when we encounter an ITEM node + */ + var $_addKeyword; + + /**#@-*/ + + /** + * Called when the start tag of a node of the + * XML document is encountered + * + * @param resource XML Parser resource + * @param string The name of the node encountered + * @param array Any attributes the node has + */ + function startHandler ($xp, $name, $attributes) + { + if ('LIST' == $name) { + if ($attributes['NAME'] == $this->_keywordGroup) { + $this->_valid = true; + } else { + $this->_valid = false; + } + } + if ($this->_valid && 'ITEM' == $name) { + $this->_addKeyword = true; + } else { + $this->_addKeyword = false; + } + } + + /** + * Called when CDATA is encountered + * + * @param resource XML Parser Resource + * @param string The CDATA encountered + */ + function cdataHandler ($xp, $cdata) + { + if ($this->_addKeyword) { + array_push($this->_keywords, trim($cdata)); + } + $this->_addKeyword = false; + } +} + +?> diff --git a/paste/include/geshi/scripts/get-keywords/languages/php/class.phpkeywordgetter.php b/paste/include/geshi/scripts/get-keywords/languages/php/class.phpkeywordgetter.php new file mode 100644 index 0000000..ede4d05 --- /dev/null +++ b/paste/include/geshi/scripts/get-keywords/languages/php/class.phpkeywordgetter.php @@ -0,0 +1,120 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package scripts + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** Get the PHP XML parser used for getting PHP keywords */ +require_once 'class.phpxmlparser.php'; + +/** + * Implementation of KeywordGetterStrategy for the PHP language. + * + * @package scripts + * @author Nigel McNie <nigel@geshi.org> + * @since 0.1.1 + * @version 1.1.0 + * @see KeywordGetterStrategy + */ +class phpKeywordGetterStrategy extends KeywordGetterStrategy +{ + /** + * Creates a new PHP Keyword Getter Strategy. Defines allowed + * keyword groups for PHP. + */ + function phpKeywordGetterStrategy () + { + $this->_language = 'PHP'; + $this->_validKeywordGroups = array( + 'controlstructures', 'keywords', 'functions' + ); + } + + /** + * Implementation of abstract method {@link KeywordGetterStrategy::getKeywords()} + * to get keywords for PHP + * + * @param string The keyword group to get keywords for. If not a valid keyword + * group an error is returned + * @return array The keywords for PHP for the specified keyword group + * @throws KeywordGetterError + */ + function getKeywords ($keyword_group) + { + // Check that keyword group listed is valid + $group_valid = $this->keywordGroupIsValid($keyword_group); + if (KeywordGetter::isError($group_valid)) { + return $group_valid; + } + + // Convert keyword group to correct name + // for XML parser if needed + if ('controlstructures' == $keyword_group) { + $keyword_group = 'control structures'; + } + + $xml_parser =& new PHP_XML_Parser; + $xml_parser->setKeywordGroup($keyword_group); + + // Set the file to parse to Nigel's local PHP syntax file. + $result =& $xml_parser->setInputFile('/usr/share/apps/katepart/syntax/php.xml'); + if (PEAR::isError($result)) { + return new KeywordGetterError(FILE_UNAVAILABLE, $this->_language, + array('{FILENAME}' => '/usr/share/apps/katepart/syntax/php.xml')); + } + + $result =& $xml_parser->parse(); + if (PEAR::isError($result)) { + return new KeywordGetterError(PARSE_ERROR, $this->_language, + array('{PARSE_ERROR}' => $result->getMessage())); + } + + $keywords =& $xml_parser->getKeywords(); + + // Add some keywords that don't seem to be in the XML file + if ('control structures' == $keyword_group) { + array_push($keywords, 'endwhile', 'endif', 'endswitch', 'endforeach'); + } elseif ('keywords' == $keyword_group) { + array_push($keywords, '__FUNCTION__', '__CLASS__', '__METHOD__', + 'DEFAULT_INCLUDE_PATH', 'PEAR_INSTALL_DIR', 'PEAR_EXTENSION_DIR', + 'PHP_EXTENSION_DIR', 'PHP_BINDIR', 'PHP_LIBDIR', 'PHP_DATADIR', + 'PHP_SYSCONFDIR', 'PHP_LOCALSTATEDIR', 'PHP_CONFIG_FILE_PATH', + 'PHP_OUTPUT_HANDLER_START', 'PHP_OUTPUT_HANDLER_CONT', + 'PHP_OUTPUT_HANDLER_END', 'E_STRICT', 'E_CORE_ERROR', 'E_CORE_WARNING', + 'E_COMPILE_ERROR', 'E_COMPILE_WARNING'); + } + sort($keywords); + + return array_unique($keywords); + } +} + +?> diff --git a/paste/include/geshi/scripts/get-keywords/languages/php/class.phpxmlparser.php b/paste/include/geshi/scripts/get-keywords/languages/php/class.phpxmlparser.php new file mode 100644 index 0000000..26d2641 --- /dev/null +++ b/paste/include/geshi/scripts/get-keywords/languages/php/class.phpxmlparser.php @@ -0,0 +1,107 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package scripts + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** Get the Keyword XML Parser class for use by CSS_XML_Parser */ +require_once 'lib/class.keywordxmlparser.php'; + +/** + * Extends Keyword_XML_Parser as a class to get PHP keywords from + * a katepart syntax XML file + * + * @package scripts + * @author Nigel McNie <nigel@geshi.org> + * @since 0.1.1 + * @version 1.1.0 + * @see Keyword_XML_Parser + */ +class PHP_XML_Parser extends Keyword_XML_Parser +{ + /**#@+ + * @var boolean + * @access private + */ + /** + * Whether we are currently in the block of the XML file + * with items of the correct type + */ + var $_valid; + + /** + * Whether we should add the next CDATA we encounter. This + * is made true when we encounter an ITEM node + */ + var $_addKeyword; + + /**#@-*/ + + /** + * Called when the start tag of a node of the + * XML document is encountered + * + * @param resource XML Parser resource + * @param string The name of the node encountered + * @param array Any attributes the node has + */ + function startHandler ($xp, $name, $attributes) + { + if ('LIST' == $name) { + if ($attributes['NAME'] == $this->_keywordGroup) { + $this->_valid = true; + } else { + $this->_valid = false; + } + } + if ($this->_valid && 'ITEM' == $name) { + $this->_addKeyword = true; + } else { + $this->_addKeyword = false; + } + } + + /** + * Called when CDATA is encountered + * + * @param resource XML Parser resource + * @param string The CDATA encountered + */ + function cdataHandler ($xp, $cdata) + { + if ($this->_addKeyword) { + array_push($this->_keywords, trim($cdata)); + } + $this->_addKeyword = false; + } +} + +?> diff --git a/paste/include/geshi/scripts/get-keywords/lib/class.keywordgetter.php b/paste/include/geshi/scripts/get-keywords/lib/class.keywordgetter.php new file mode 100644 index 0000000..8e1f3af --- /dev/null +++ b/paste/include/geshi/scripts/get-keywords/lib/class.keywordgetter.php @@ -0,0 +1,184 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * ---------------------------------- + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package scripts + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** The language to get keywords for is not supported by this tool */ +define('LANG_NOT_SUPPORTED', -1); +/** The keyword group asked for is not supported by the language */ +define('INVALID_KEYWORD_GROUP', -2); +/** There was a parse error parsing an XML document for keywords */ +define('PARSE_ERROR', -3); + +/**#@+ + * @access private + */ +/** The strategy object used to get keywords is invalid */ +define('INVALID_STRATEGY', -4); +/**#@-*/ + +/** Class that handles errors */ +require_once 'class.keywordgettererror.php'; + +/** Class that is the root of the keyword getting strategy */ +require_once 'class.keywordgetterstrategy.php'; + +/** + * The KeywordGetter class. The get-keywords program is a + * frontend to this class. + * + * @author Nigel McNie + * @since 0.1.0 + */ +class KeywordGetter +{ + /**#@+ + * @access private + */ + /** + * The language being used + * @var string + */ + var $_language; + + /** + * The keyword strategy to use + * @var KeywordGetterStrategy + */ + var $_keywordStrategy; + /**#@-*/ + + /** + * Constructor + * + * @param KeywordGetterStrategy The strategy to use to get keywords + * @private + * {@internal Yes, that's right, PRIVATE. Use KeywordGetter::factory + * to create new KeywordGetters}} + */ + function KeywordGetter ($kwstrategy) + { + if (!is_a($kwstrategy, 'KeywordGetterStrategy')) { + return new KeywordGetterError(INVALID_STRATEGY, $this->_language); + } + $this->_keywordStrategy = $kwstrategy; + } + + /** + * Creates a new keyword getter based on the incoming language + * + * @param string The language to get keywords for + * @static + */ + function &factory ($language) + { + if (!file_exists('languages/' . $language . '/class.' . $language . 'keywordgetter.php')) { + return new KeywordGetterError(LANG_NOT_SUPPORTED, $language); + } + $this->_language = $language; + + /** Get the requested language */ + require_once 'languages/' . $language . '/class.' . $language . 'keywordgetter.php'; + + $class = $language . 'KeywordGetterStrategy'; + if (!class_exists($class)) { + return new KeywordGetterError(LANG_NOT_SUPPORTED, $language); + } + + return new KeywordGetter(new $class); + } + + /** + * Returns whether the passed object is an error object + * + * @param mixed The variable that may be an error object + * @return boolean Whether the variable is an error object + * @static + */ + function isError ($possible_err_object) + { + return is_a($possible_err_object, 'KeywordGetterError'); + } + + /** + * Gets the keywords for a language + * + * @param The keyword group to get keywords for + * @return array An array of the keywords for this language/keyword group + */ + function &getKeywords ($keyword_group) + { + return $this->_keywordStrategy->getKeywords($keyword_group); + } + + /** + * Gets valid keyword groups for a language + * + * @return array An array of valid keyword groups for the language + * that this KeywordGetter is representing + */ + function &getValidKeywordGroups () + { + return $this->_keywordStrategy->getValidKeywordGroups(); + } + + /** + * Gets a list of all supported languages + * + * @return array + * @static + */ + function &getSupportedLanguages () + { + $files_to_ignore = array('.', '..', 'CVS'); + $supported_languages = array(); + + $dh = @opendir('languages'); + if (false === $dh) { + return false; + } + + while (false !== ($file = @readdir($dh))) { + if (in_array($file, $files_to_ignore)) { + continue; + } + if (file_exists('languages/' . $file . '/class.' . $file . 'keywordgetter.php')) { + array_push($supported_languages, $file); + } + } + + return $supported_languages; + } +} + +?> diff --git a/paste/include/geshi/scripts/get-keywords/lib/class.keywordgettererror.php b/paste/include/geshi/scripts/get-keywords/lib/class.keywordgettererror.php new file mode 100644 index 0000000..ac12a9a --- /dev/null +++ b/paste/include/geshi/scripts/get-keywords/lib/class.keywordgettererror.php @@ -0,0 +1,97 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * ---------------------------------- + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package scripts + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +class KeywordGetterError +{ + + /** + * The error message + * @var string + */ + var $_errorMessage; + + /** + * Possible error messages + * @var array + * @static + */ + var $_errorMessages = array( + LANG_NOT_SUPPORTED => + 'The language "{LANGUAGE}" is not supported by this tool at this time +(see php $0 list-langs for a list of supported languages)', + INVALID_STRATEGY => + 'The strategy object given is invalid (this is an internal error, +if you see this please send a bug report to nigel@geshi.org)', + INVALID_KEYWORD_GROUP => + 'The keyword group "{KEYWORD_GROUP}" given is invalid for the language "{LANGUAGE}"', + PARSE_ERROR => + 'There was a parsing error while trying to parse the XML language file: {MESSAGE}', + FILE_UNAVAILABLE => + 'The file {FILENAME} is unavailable for retrieving keywords from. Does it exist/is it readable?' + ); + + /** + * Creates a new KeywordGetterError object + * + * @param int The error type of this error + * @param string The language being used + */ + function KeywordGetterError ($error_type, $language, $other_info = array()) + { + global $argv; + $message = $this->_errorMessages[$error_type]; + $matches = array( + '{LANGUAGE}' => $language, + '$0' => $argv[0] + ); + $matches = array_merge($matches, $other_info); + + $message = str_replace(array_keys($matches), $matches, $message); + $this->_errorMessage = 'Error: ' . $message . "\n"; + } + + /** + * Returns the last error + * + * @return string + */ + function lastError () + { + return $this->_errorMessage; + } +} + +?> + diff --git a/paste/include/geshi/scripts/get-keywords/lib/class.keywordgetterstrategy.php b/paste/include/geshi/scripts/get-keywords/lib/class.keywordgetterstrategy.php new file mode 100644 index 0000000..a586507 --- /dev/null +++ b/paste/include/geshi/scripts/get-keywords/lib/class.keywordgetterstrategy.php @@ -0,0 +1,105 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * ---------------------------------- + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package scripts + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** + * Class that is overridden to provide an implementation of getting keywords + * for a particular language + * + * @author Nigel McNie <nigel@geshi.org> + * @since 0.1.0 + * @abstract + */ +class KeywordGetterStrategy +{ + + /**#@+ + * @access private + */ + + /** + * The language that this getter is getting keywords for + * @var string + */ + var $_language; + + /** + * The keyword group within the language that this getter is + * getting keywords for + * @var string + */ + var $_keywordGroup; + + /** + * The keyword groups that are valid (supported) by this strategy + * @var array + */ + var $_validKeywordGroups; + + /** + * used? + */ + var $_keywords = array(); + + /**#@-*/ + + /** + * @abstract + */ + function getKeywords ($keyword_group) + { + return new KeywordGetterError(LANG_NOT_SUPPORTED, $this->_language); + } + + /** + * @return array + */ + function getValidKeywordGroups () + { + return $this->_validKeywordGroups; + } + + /** + * Checks whether the keyword group asked for is valid + */ + function keywordGroupIsValid ($keyword_group) { + if (in_array($keyword_group, $this->_validKeywordGroups)) { + return true; + } + return new KeywordGetterError(INVALID_KEYWORD_GROUP, $this->_language, + array('{KEYWORD_GROUP}' => $keyword_group)); + } +} + +?> diff --git a/paste/include/geshi/scripts/get-keywords/lib/class.keywordxmlparser.php b/paste/include/geshi/scripts/get-keywords/lib/class.keywordxmlparser.php new file mode 100644 index 0000000..1c0ea72 --- /dev/null +++ b/paste/include/geshi/scripts/get-keywords/lib/class.keywordxmlparser.php @@ -0,0 +1,58 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * ---------------------------------- + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package scripts + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** Get the XML parser class */ +require_once 'lib/pear/XML/Parser.php'; + +/** + * @todo [blocking 1.1.9] comment + */ +class Keyword_XML_Parser extends XML_Parser +{ + var $_keywordGroup; + var $_keywords = array(); + + function setKeywordGroup ($keyword_group) + { + $this->_keywordGroup = $keyword_group; + } + + function &getKeywords () + { + return $this->_keywords; + } +} + +?> diff --git a/paste/include/geshi/scripts/get-keywords/lib/functions.get-keywords.php b/paste/include/geshi/scripts/get-keywords/lib/functions.get-keywords.php new file mode 100644 index 0000000..9116c36 --- /dev/null +++ b/paste/include/geshi/scripts/get-keywords/lib/functions.get-keywords.php @@ -0,0 +1,95 @@ +<?php +/** + * GeSHi - Generic Syntax Highlighter + * + * For information on how to use GeSHi, please consult the documentation + * found in the docs/ directory, or online at http://geshi.org/docs/ + * + * This file is part of GeSHi. + * + * GeSHi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GeSHi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GeSHi; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * You can view a copy of the GNU GPL in the COPYING file that comes + * with GeSHi, in the docs/ directory. + * + * @package scripts + * @author Nigel McNie <nigel@geshi.org> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2005 Nigel McNie + * @version 1.1.0 + * + */ + +/** + * Shows help text for get-keywords script and exits + * + * @since 0.1.0 + */ +function show_help () +{ + global $argv; + print <<<EOF +Usage: php $argv[0] language keyword-group +Language is a language supported by GeSHi and +that also has a katepart language file or similar. + +Options: + -h --help Show this help text + -v --version Show version information + --list-groups [lang] List keyword groups for language [lang] + --list-langs List supported languages + +EOF; + exit; +} + +/** + * Shows the version number of get-keywords and exits + * + * @since 0.1.0 + */ +function show_version () +{ + print GESHI_GET_KEYWORDS_VERSION . + "\n\$Date: 2005/07/25 07:03:11 $\n"; + exit; +} + +/** + * Checks whether the specified options were passed on the command + * line, and returns the value of the option if specified. + * + * @param string|array The options to check for + * @param array The arguments as parsed by Console_Getopt::getopt() + * @return True if the argument exists, the value of the argument if there is a value, else false + * @since 0.1.0 + * @todo [blocking 1.1.5] Move this into console_getopt class + * @todo [blocking 1.1.5] Check about what is returned when option does exist + */ +function get_option ($options, $args) +{ + $options = (array) $options; + $args = $args[0]; + foreach ($args as $arg) { + foreach ($options as $option) { + if ($option == $arg[0] || '--' . $option == $arg[0]) { + return ($arg[1]) ? $arg[1] : true; + } + } + } + return false; +} + +?> diff --git a/paste/include/geshi/scripts/get-keywords/lib/pear/Console/Getopt.php b/paste/include/geshi/scripts/get-keywords/lib/pear/Console/Getopt.php new file mode 100644 index 0000000..723ef12 --- /dev/null +++ b/paste/include/geshi/scripts/get-keywords/lib/pear/Console/Getopt.php @@ -0,0 +1,251 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4: */ +// +----------------------------------------------------------------------+ +// | PHP Version 4 | +// +----------------------------------------------------------------------+ +// | Copyright (c) 1997-2003 The PHP Group | +// +----------------------------------------------------------------------+ +// | This source file is subject to version 3.0 of the PHP license, | +// | that is bundled with this package in the file LICENSE, and is | +// | available through the world-wide-web at the following url: | +// | http://www.php.net/license/3_0.txt. | +// | If you did not receive a copy of the PHP license and are unable to | +// | obtain it through the world-wide-web, please send a note to | +// | license@php.net so we can mail you a copy immediately. | +// +----------------------------------------------------------------------+ +// | Author: Andrei Zmievski <andrei@php.net> | +// +----------------------------------------------------------------------+ +// +// $Id: Getopt.php,v 1.1 2005/06/04 04:04:00 oracleshinoda Exp $ + +require_once 'lib/pear/PEAR.php'; + +/** + * Command-line options parsing class. + * + * @author Andrei Zmievski <andrei@php.net> + * + */ +class Console_Getopt { + /** + * Parses the command-line options. + * + * The first parameter to this function should be the list of command-line + * arguments without the leading reference to the running program. + * + * The second parameter is a string of allowed short options. Each of the + * option letters can be followed by a colon ':' to specify that the option + * requires an argument, or a double colon '::' to specify that the option + * takes an optional argument. + * + * The third argument is an optional array of allowed long options. The + * leading '--' should not be included in the option name. Options that + * require an argument should be followed by '=', and options that take an + * option argument should be followed by '=='. + * + * The return value is an array of two elements: the list of parsed + * options and the list of non-option command-line arguments. Each entry in + * the list of parsed options is a pair of elements - the first one + * specifies the option, and the second one specifies the option argument, + * if there was one. + * + * Long and short options can be mixed. + * + * Most of the semantics of this function are based on GNU getopt_long(). + * + * @param array $args an array of command-line arguments + * @param string $short_options specifies the list of allowed short options + * @param array $long_options specifies the list of allowed long options + * + * @return array two-element array containing the list of parsed options and + * the non-option arguments + * + * @access public + * + */ + function getopt2($args, $short_options, $long_options = null) + { + return Console_Getopt::doGetopt(2, $args, $short_options, $long_options); + } + + /** + * This function expects $args to start with the script name (POSIX-style). + * Preserved for backwards compatibility. + * @see getopt2() + */ + function getopt($args, $short_options, $long_options = null) + { + return Console_Getopt::doGetopt(1, $args, $short_options, $long_options); + } + + /** + * The actual implementation of the argument parsing code. + */ + function doGetopt($version, $args, $short_options, $long_options = null) + { + // in case you pass directly readPHPArgv() as the first arg + if (PEAR::isError($args)) { + return $args; + } + if (empty($args)) { + return array(array(), array()); + } + $opts = array(); + $non_opts = array(); + + settype($args, 'array'); + + if ($long_options) { + sort($long_options); + } + + /* + * Preserve backwards compatibility with callers that relied on + * erroneous POSIX fix. + */ + if ($version < 2) { + if (isset($args[0]{0}) && $args[0]{0} != '-') { + array_shift($args); + } + } + + reset($args); + while (list($i, $arg) = each($args)) { + + /* The special element '--' means explicit end of + options. Treat the rest of the arguments as non-options + and end the loop. */ + if ($arg == '--') { + $non_opts = array_merge($non_opts, array_slice($args, $i + 1)); + break; + } + + if ($arg{0} != '-' || (strlen($arg) > 1 && $arg{1} == '-' && !$long_options)) { + $non_opts = array_merge($non_opts, array_slice($args, $i)); + break; + } elseif (strlen($arg) > 1 && $arg{1} == '-') { + $error = Console_Getopt::_parseLongOption(substr($arg, 2), $long_options, $opts, $args); + if (PEAR::isError($error)) + return $error; + } else { + $error = Console_Getopt::_parseShortOption(substr($arg, 1), $short_options, $opts, $args); + if (PEAR::isError($error)) + return $error; + } + } + + return array($opts, $non_opts); + } + + /** + * @access private + * + */ + function _parseShortOption($arg, $short_options, &$opts, &$args) + { + for ($i = 0; $i < strlen($arg); $i++) { + $opt = $arg{$i}; + $opt_arg = null; + + /* Try to find the short option in the specifier string. */ + if (($spec = strstr($short_options, $opt)) === false || $arg{$i} == ':') + { + return PEAR::raiseError("Console_Getopt: unrecognized option -- $opt"); + } + + if (strlen($spec) > 1 && $spec{1} == ':') { + if (strlen($spec) > 2 && $spec{2} == ':') { + if ($i + 1 < strlen($arg)) { + /* Option takes an optional argument. Use the remainder of + the arg string if there is anything left. */ + $opts[] = array($opt, substr($arg, $i + 1)); + break; + } + } else { + /* Option requires an argument. Use the remainder of the arg + string if there is anything left. */ + if ($i + 1 < strlen($arg)) { + $opts[] = array($opt, substr($arg, $i + 1)); + break; + } else if (list(, $opt_arg) = each($args)) + /* Else use the next argument. */; + else + return PEAR::raiseError("Console_Getopt: option requires an argument -- $opt"); + } + } + + $opts[] = array($opt, $opt_arg); + } + } + + /** + * @access private + * + */ + function _parseLongOption($arg, $long_options, &$opts, &$args) + { + @list($opt, $opt_arg) = explode('=', $arg, 2); + $opt_len = strlen($opt); + + for ($i = 0; $i < count($long_options); $i++) { + $long_opt = $long_options[$i]; + $opt_start = substr($long_opt, 0, $opt_len); + + /* Option doesn't match. Go on to the next one. */ + if ($opt_start != $opt) + continue; + + $opt_rest = substr($long_opt, $opt_len); + + /* Check that the options uniquely matches one of the allowed + options. */ + if ($opt_rest != '' && $opt{0} != '=' && + $i + 1 < count($long_options) && + $opt == substr($long_options[$i+1], 0, $opt_len)) { + return PEAR::raiseError("Console_Getopt: option --$opt is ambiguous"); + } + + if (substr($long_opt, -1) == '=') { + if (substr($long_opt, -2) != '==') { + /* Long option requires an argument. + Take the next argument if one wasn't specified. */; + if (!strlen($opt_arg) && !(list(, $opt_arg) = each($args))) { + return PEAR::raiseError("Console_Getopt: option --$opt requires an argument"); + } + } + } else if ($opt_arg) { + return PEAR::raiseError("Console_Getopt: option --$opt doesn't allow an argument"); + } + + $opts[] = array('--' . $opt, $opt_arg); + return; + } + + return PEAR::raiseError("Console_Getopt: unrecognized option --$opt"); + } + + /** + * Safely read the $argv PHP array across different PHP configurations. + * Will take care on register_globals and register_argc_argv ini directives + * + * @access public + * @return mixed the $argv PHP array or PEAR error if not registered + */ + function readPHPArgv() + { + global $argv; + if (!is_array($argv)) { + if (!@is_array($_SERVER['argv'])) { + if (!@is_array($GLOBALS['HTTP_SERVER_VARS']['argv'])) { + return PEAR::raiseError("Console_Getopt: Could not read cmd args (register_argc_argv=Off?)"); + } + return $GLOBALS['HTTP_SERVER_VARS']['argv']; + } + return $_SERVER['argv']; + } + return $argv; + } + +} + +?> diff --git a/paste/include/geshi/scripts/get-keywords/lib/pear/PEAR.php b/paste/include/geshi/scripts/get-keywords/lib/pear/PEAR.php new file mode 100644 index 0000000..5a86b6b --- /dev/null +++ b/paste/include/geshi/scripts/get-keywords/lib/pear/PEAR.php @@ -0,0 +1,1055 @@ +<?php +// +// +--------------------------------------------------------------------+ +// | PEAR, the PHP Extension and Application Repository | +// +--------------------------------------------------------------------+ +// | Copyright (c) 1997-2004 The PHP Group | +// +--------------------------------------------------------------------+ +// | This source file is subject to version 3.0 of the PHP license, | +// | that is bundled with this package in the file LICENSE, and is | +// | available through the world-wide-web at the following url: | +// | http://www.php.net/license/3_0.txt. | +// | If you did not receive a copy of the PHP license and are unable to | +// | obtain it through the world-wide-web, please send a note to | +// | license@php.net so we can mail you a copy immediately. | +// +--------------------------------------------------------------------+ +// | Authors: Sterling Hughes <sterling@php.net> | +// | Stig Bakken <ssb@php.net> | +// | Tomas V.V.Cox <cox@idecnet.com> | +// +--------------------------------------------------------------------+ +// +// $Id: PEAR.php,v 1.1 2005/06/04 04:03:26 oracleshinoda Exp $ +// + +define('PEAR_ERROR_RETURN', 1); +define('PEAR_ERROR_PRINT', 2); +define('PEAR_ERROR_TRIGGER', 4); +define('PEAR_ERROR_DIE', 8); +define('PEAR_ERROR_CALLBACK', 16); +/** + * WARNING: obsolete + * @deprecated + */ +define('PEAR_ERROR_EXCEPTION', 32); +define('PEAR_ZE2', (function_exists('version_compare') && + version_compare(zend_version(), "2-dev", "ge"))); + +if (substr(PHP_OS, 0, 3) == 'WIN') { + define('OS_WINDOWS', true); + define('OS_UNIX', false); + define('PEAR_OS', 'Windows'); +} else { + define('OS_WINDOWS', false); + define('OS_UNIX', true); + define('PEAR_OS', 'Unix'); // blatant assumption +} + +// instant backwards compatibility +if (!defined('PATH_SEPARATOR')) { + if (OS_WINDOWS) { + define('PATH_SEPARATOR', ';'); + } else { + define('PATH_SEPARATOR', ':'); + } +} + +$GLOBALS['_PEAR_default_error_mode'] = PEAR_ERROR_RETURN; +$GLOBALS['_PEAR_default_error_options'] = E_USER_NOTICE; +$GLOBALS['_PEAR_destructor_object_list'] = array(); +$GLOBALS['_PEAR_shutdown_funcs'] = array(); +$GLOBALS['_PEAR_error_handler_stack'] = array(); + +@ini_set('track_errors', true); + +/** + * Base class for other PEAR classes. Provides rudimentary + * emulation of destructors. + * + * If you want a destructor in your class, inherit PEAR and make a + * destructor method called _yourclassname (same name as the + * constructor, but with a "_" prefix). Also, in your constructor you + * have to call the PEAR constructor: $this->PEAR();. + * The destructor method will be called without parameters. Note that + * at in some SAPI implementations (such as Apache), any output during + * the request shutdown (in which destructors are called) seems to be + * discarded. If you need to get any debug information from your + * destructor, use error_log(), syslog() or something similar. + * + * IMPORTANT! To use the emulated destructors you need to create the + * objects by reference: $obj =& new PEAR_child; + * + * @since PHP 4.0.2 + * @author Stig Bakken <ssb@php.net> + * @see http://pear.php.net/manual/ + */ +class PEAR +{ + // {{{ properties + + /** + * Whether to enable internal debug messages. + * + * @var bool + * @access private + */ + var $_debug = false; + + /** + * Default error mode for this object. + * + * @var int + * @access private + */ + var $_default_error_mode = null; + + /** + * Default error options used for this object when error mode + * is PEAR_ERROR_TRIGGER. + * + * @var int + * @access private + */ + var $_default_error_options = null; + + /** + * Default error handler (callback) for this object, if error mode is + * PEAR_ERROR_CALLBACK. + * + * @var string + * @access private + */ + var $_default_error_handler = ''; + + /** + * Which class to use for error objects. + * + * @var string + * @access private + */ + var $_error_class = 'PEAR_Error'; + + /** + * An array of expected errors. + * + * @var array + * @access private + */ + var $_expected_errors = array(); + + // }}} + + // {{{ constructor + + /** + * Constructor. Registers this object in + * $_PEAR_destructor_object_list for destructor emulation if a + * destructor object exists. + * + * @param string $error_class (optional) which class to use for + * error objects, defaults to PEAR_Error. + * @access public + * @return void + */ + function PEAR($error_class = null) + { + $classname = strtolower(get_class($this)); + if ($this->_debug) { + print "PEAR constructor called, class=$classname\n"; + } + if ($error_class !== null) { + $this->_error_class = $error_class; + } + while ($classname && strcasecmp($classname, "pear")) { + $destructor = "_$classname"; + if (method_exists($this, $destructor)) { + global $_PEAR_destructor_object_list; + $_PEAR_destructor_object_list[] = &$this; + if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) { + register_shutdown_function("_PEAR_call_destructors"); + $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true; + } + break; + } else { + $classname = get_parent_class($classname); + } + } + } + + // }}} + // {{{ destructor + + /** + * Destructor (the emulated type of...). Does nothing right now, + * but is included for forward compatibility, so subclass + * destructors should always call it. + * + * See the note in the class desciption about output from + * destructors. + * + * @access public + * @return void + */ + function _PEAR() { + if ($this->_debug) { + printf("PEAR destructor called, class=%s\n", strtolower(get_class($this))); + } + } + + // }}} + // {{{ getStaticProperty() + + /** + * If you have a class that's mostly/entirely static, and you need static + * properties, you can use this method to simulate them. Eg. in your method(s) + * do this: $myVar = &PEAR::getStaticProperty('myclass', 'myVar'); + * You MUST use a reference, or they will not persist! + * + * @access public + * @param string $class The calling classname, to prevent clashes + * @param string $var The variable to retrieve. + * @return mixed A reference to the variable. If not set it will be + * auto initialised to NULL. + */ + function &getStaticProperty($class, $var) + { + static $properties; + return $properties[$class][$var]; + } + + // }}} + // {{{ registerShutdownFunc() + + /** + * Use this function to register a shutdown method for static + * classes. + * + * @access public + * @param mixed $func The function name (or array of class/method) to call + * @param mixed $args The arguments to pass to the function + * @return void + */ + function registerShutdownFunc($func, $args = array()) + { + $GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args); + } + + // }}} + // {{{ isError() + + /** + * Tell whether a value is a PEAR error. + * + * @param mixed $data the value to test + * @param int $code if $data is an error object, return true + * only if $code is a string and + * $obj->getMessage() == $code or + * $code is an integer and $obj->getCode() == $code + * @access public + * @return bool true if parameter is an error + */ + function isError($data, $code = null) + { + if (is_a($data, 'PEAR_Error')) { + if (is_null($code)) { + return true; + } elseif (is_string($code)) { + return $data->getMessage() == $code; + } else { + return $data->getCode() == $code; + } + } + return false; + } + + // }}} + // {{{ setErrorHandling() + + /** + * Sets how errors generated by this object should be handled. + * Can be invoked both in objects and statically. If called + * statically, setErrorHandling sets the default behaviour for all + * PEAR objects. If called in an object, setErrorHandling sets + * the default behaviour for that object. + * + * @param int $mode + * One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, + * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, + * PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION. + * + * @param mixed $options + * When $mode is PEAR_ERROR_TRIGGER, this is the error level (one + * of E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR). + * + * When $mode is PEAR_ERROR_CALLBACK, this parameter is expected + * to be the callback function or method. A callback + * function is a string with the name of the function, a + * callback method is an array of two elements: the element + * at index 0 is the object, and the element at index 1 is + * the name of the method to call in the object. + * + * When $mode is PEAR_ERROR_PRINT or PEAR_ERROR_DIE, this is + * a printf format string used when printing the error + * message. + * + * @access public + * @return void + * @see PEAR_ERROR_RETURN + * @see PEAR_ERROR_PRINT + * @see PEAR_ERROR_TRIGGER + * @see PEAR_ERROR_DIE + * @see PEAR_ERROR_CALLBACK + * @see PEAR_ERROR_EXCEPTION + * + * @since PHP 4.0.5 + */ + + function setErrorHandling($mode = null, $options = null) + { + if (isset($this) && is_a($this, 'PEAR')) { + $setmode = &$this->_default_error_mode; + $setoptions = &$this->_default_error_options; + } else { + $setmode = &$GLOBALS['_PEAR_default_error_mode']; + $setoptions = &$GLOBALS['_PEAR_default_error_options']; + } + + switch ($mode) { + case PEAR_ERROR_EXCEPTION: + case PEAR_ERROR_RETURN: + case PEAR_ERROR_PRINT: + case PEAR_ERROR_TRIGGER: + case PEAR_ERROR_DIE: + case null: + $setmode = $mode; + $setoptions = $options; + break; + + case PEAR_ERROR_CALLBACK: + $setmode = $mode; + // class/object method callback + if (is_callable($options)) { + $setoptions = $options; + } else { + trigger_error("invalid error callback", E_USER_WARNING); + } + break; + + default: + trigger_error("invalid error mode", E_USER_WARNING); + break; + } + } + + // }}} + // {{{ expectError() + + /** + * This method is used to tell which errors you expect to get. + * Expected errors are always returned with error mode + * PEAR_ERROR_RETURN. Expected error codes are stored in a stack, + * and this method pushes a new element onto it. The list of + * expected errors are in effect until they are popped off the + * stack with the popExpect() method. + * + * Note that this method can not be called statically + * + * @param mixed $code a single error code or an array of error codes to expect + * + * @return int the new depth of the "expected errors" stack + * @access public + */ + function expectError($code = '*') + { + if (is_array($code)) { + array_push($this->_expected_errors, $code); + } else { + array_push($this->_expected_errors, array($code)); + } + return sizeof($this->_expected_errors); + } + + // }}} + // {{{ popExpect() + + /** + * This method pops one element off the expected error codes + * stack. + * + * @return array the list of error codes that were popped + */ + function popExpect() + { + return array_pop($this->_expected_errors); + } + + // }}} + // {{{ _checkDelExpect() + + /** + * This method checks unsets an error code if available + * + * @param mixed error code + * @return bool true if the error code was unset, false otherwise + * @access private + * @since PHP 4.3.0 + */ + function _checkDelExpect($error_code) + { + $deleted = false; + + foreach ($this->_expected_errors AS $key => $error_array) { + if (in_array($error_code, $error_array)) { + unset($this->_expected_errors[$key][array_search($error_code, $error_array)]); + $deleted = true; + } + + // clean up empty arrays + if (0 == count($this->_expected_errors[$key])) { + unset($this->_expected_errors[$key]); + } + } + return $deleted; + } + + // }}} + // {{{ delExpect() + + /** + * This method deletes all occurences of the specified element from + * the expected error codes stack. + * + * @param mixed $error_code error code that should be deleted + * @return mixed list of error codes that were deleted or error + * @access public + * @since PHP 4.3.0 + */ + function delExpect($error_code) + { + $deleted = false; + + if ((is_array($error_code) && (0 != count($error_code)))) { + // $error_code is a non-empty array here; + // we walk through it trying to unset all + // values + foreach($error_code as $key => $error) { + if ($this->_checkDelExpect($error)) { + $deleted = true; + } else { + $deleted = false; + } + } + return $deleted ? true : PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME + } elseif (!empty($error_code)) { + // $error_code comes alone, trying to unset it + if ($this->_checkDelExpect($error_code)) { + return true; + } else { + return PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME + } + } else { + // $error_code is empty + return PEAR::raiseError("The expected error you submitted is empty"); // IMPROVE ME + } + } + + // }}} + // {{{ raiseError() + + /** + * This method is a wrapper that returns an instance of the + * configured error class with this object's default error + * handling applied. If the $mode and $options parameters are not + * specified, the object's defaults are used. + * + * @param mixed $message a text error message or a PEAR error object + * + * @param int $code a numeric error code (it is up to your class + * to define these if you want to use codes) + * + * @param int $mode One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, + * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, + * PEAR_ERROR_CALLBACK, PEAR_ERROR_EXCEPTION. + * + * @param mixed $options If $mode is PEAR_ERROR_TRIGGER, this parameter + * specifies the PHP-internal error level (one of + * E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR). + * If $mode is PEAR_ERROR_CALLBACK, this + * parameter specifies the callback function or + * method. In other error modes this parameter + * is ignored. + * + * @param string $userinfo If you need to pass along for example debug + * information, this parameter is meant for that. + * + * @param string $error_class The returned error object will be + * instantiated from this class, if specified. + * + * @param bool $skipmsg If true, raiseError will only pass error codes, + * the error message parameter will be dropped. + * + * @access public + * @return object a PEAR error object + * @see PEAR::setErrorHandling + * @since PHP 4.0.5 + */ + function raiseError($message = null, + $code = null, + $mode = null, + $options = null, + $userinfo = null, + $error_class = null, + $skipmsg = false) + { + // The error is yet a PEAR error object + if (is_object($message)) { + $code = $message->getCode(); + $userinfo = $message->getUserInfo(); + $error_class = $message->getType(); + $message->error_message_prefix = ''; + $message = $message->getMessage(); + } + + if (isset($this) && isset($this->_expected_errors) && sizeof($this->_expected_errors) > 0 && sizeof($exp = end($this->_expected_errors))) { + if ($exp[0] == "*" || + (is_int(reset($exp)) && in_array($code, $exp)) || + (is_string(reset($exp)) && in_array($message, $exp))) { + $mode = PEAR_ERROR_RETURN; + } + } + // No mode given, try global ones + if ($mode === null) { + // Class error handler + if (isset($this) && isset($this->_default_error_mode)) { + $mode = $this->_default_error_mode; + $options = $this->_default_error_options; + // Global error handler + } elseif (isset($GLOBALS['_PEAR_default_error_mode'])) { + $mode = $GLOBALS['_PEAR_default_error_mode']; + $options = $GLOBALS['_PEAR_default_error_options']; + } + } + + if ($error_class !== null) { + $ec = $error_class; + } elseif (isset($this) && isset($this->_error_class)) { + $ec = $this->_error_class; + } else { + $ec = 'PEAR_Error'; + } + if ($skipmsg) { + return new $ec($code, $mode, $options, $userinfo); + } else { + return new $ec($message, $code, $mode, $options, $userinfo); + } + } + + // }}} + // {{{ throwError() + + /** + * Simpler form of raiseError with fewer options. In most cases + * message, code and userinfo are enough. + * + * @param string $message + * + */ + function throwError($message = null, + $code = null, + $userinfo = null) + { + if (isset($this) && is_a($this, 'PEAR')) { + return $this->raiseError($message, $code, null, null, $userinfo); + } else { + return PEAR::raiseError($message, $code, null, null, $userinfo); + } + } + + // }}} + function staticPushErrorHandling($mode, $options = null) + { + $stack = &$GLOBALS['_PEAR_error_handler_stack']; + $def_mode = &$GLOBALS['_PEAR_default_error_mode']; + $def_options = &$GLOBALS['_PEAR_default_error_options']; + $stack[] = array($def_mode, $def_options); + switch ($mode) { + case PEAR_ERROR_EXCEPTION: + case PEAR_ERROR_RETURN: + case PEAR_ERROR_PRINT: + case PEAR_ERROR_TRIGGER: + case PEAR_ERROR_DIE: + case null: + $def_mode = $mode; + $def_options = $options; + break; + + case PEAR_ERROR_CALLBACK: + $def_mode = $mode; + // class/object method callback + if (is_callable($options)) { + $def_options = $options; + } else { + trigger_error("invalid error callback", E_USER_WARNING); + } + break; + + default: + trigger_error("invalid error mode", E_USER_WARNING); + break; + } + $stack[] = array($mode, $options); + return true; + } + + function staticPopErrorHandling() + { + $stack = &$GLOBALS['_PEAR_error_handler_stack']; + $setmode = &$GLOBALS['_PEAR_default_error_mode']; + $setoptions = &$GLOBALS['_PEAR_default_error_options']; + array_pop($stack); + list($mode, $options) = $stack[sizeof($stack) - 1]; + array_pop($stack); + switch ($mode) { + case PEAR_ERROR_EXCEPTION: + case PEAR_ERROR_RETURN: + case PEAR_ERROR_PRINT: + case PEAR_ERROR_TRIGGER: + case PEAR_ERROR_DIE: + case null: + $setmode = $mode; + $setoptions = $options; + break; + + case PEAR_ERROR_CALLBACK: + $setmode = $mode; + // class/object method callback + if (is_callable($options)) { + $setoptions = $options; + } else { + trigger_error("invalid error callback", E_USER_WARNING); + } + break; + + default: + trigger_error("invalid error mode", E_USER_WARNING); + break; + } + return true; + } + + // {{{ pushErrorHandling() + + /** + * Push a new error handler on top of the error handler options stack. With this + * you can easily override the actual error handler for some code and restore + * it later with popErrorHandling. + * + * @param mixed $mode (same as setErrorHandling) + * @param mixed $options (same as setErrorHandling) + * + * @return bool Always true + * + * @see PEAR::setErrorHandling + */ + function pushErrorHandling($mode, $options = null) + { + $stack = &$GLOBALS['_PEAR_error_handler_stack']; + if (isset($this) && is_a($this, 'PEAR')) { + $def_mode = &$this->_default_error_mode; + $def_options = &$this->_default_error_options; + } else { + $def_mode = &$GLOBALS['_PEAR_default_error_mode']; + $def_options = &$GLOBALS['_PEAR_default_error_options']; + } + $stack[] = array($def_mode, $def_options); + + if (isset($this) && is_a($this, 'PEAR')) { + $this->setErrorHandling($mode, $options); + } else { + PEAR::setErrorHandling($mode, $options); + } + $stack[] = array($mode, $options); + return true; + } + + // }}} + // {{{ popErrorHandling() + + /** + * Pop the last error handler used + * + * @return bool Always true + * + * @see PEAR::pushErrorHandling + */ + function popErrorHandling() + { + $stack = &$GLOBALS['_PEAR_error_handler_stack']; + array_pop($stack); + list($mode, $options) = $stack[sizeof($stack) - 1]; + array_pop($stack); + if (isset($this) && is_a($this, 'PEAR')) { + $this->setErrorHandling($mode, $options); + } else { + PEAR::setErrorHandling($mode, $options); + } + return true; + } + + // }}} + // {{{ loadExtension() + + /** + * OS independant PHP extension load. Remember to take care + * on the correct extension name for case sensitive OSes. + * + * @param string $ext The extension name + * @return bool Success or not on the dl() call + */ + function loadExtension($ext) + { + if (!extension_loaded($ext)) { + // if either returns true dl() will produce a FATAL error, stop that + if ((ini_get('enable_dl') != 1) || (ini_get('safe_mode') == 1)) { + return false; + } + if (OS_WINDOWS) { + $suffix = '.dll'; + } elseif (PHP_OS == 'HP-UX') { + $suffix = '.sl'; + } elseif (PHP_OS == 'AIX') { + $suffix = '.a'; + } elseif (PHP_OS == 'OSX') { + $suffix = '.bundle'; + } else { + $suffix = '.so'; + } + return @dl('php_'.$ext.$suffix) || @dl($ext.$suffix); + } + return true; + } + + // }}} +} + +// {{{ _PEAR_call_destructors() + +function _PEAR_call_destructors() +{ + global $_PEAR_destructor_object_list; + if (is_array($_PEAR_destructor_object_list) && + sizeof($_PEAR_destructor_object_list)) + { + reset($_PEAR_destructor_object_list); + if (@PEAR::getStaticProperty('PEAR', 'destructlifo')) { + $_PEAR_destructor_object_list = array_reverse($_PEAR_destructor_object_list); + } + while (list($k, $objref) = each($_PEAR_destructor_object_list)) { + $classname = get_class($objref); + while ($classname) { + $destructor = "_$classname"; + if (method_exists($objref, $destructor)) { + $objref->$destructor(); + break; + } else { + $classname = get_parent_class($classname); + } + } + } + // Empty the object list to ensure that destructors are + // not called more than once. + $_PEAR_destructor_object_list = array(); + } + + // Now call the shutdown functions + if (is_array($GLOBALS['_PEAR_shutdown_funcs']) AND !empty($GLOBALS['_PEAR_shutdown_funcs'])) { + foreach ($GLOBALS['_PEAR_shutdown_funcs'] as $value) { + call_user_func_array($value[0], $value[1]); + } + } +} + +// }}} + +class PEAR_Error +{ + // {{{ properties + + var $error_message_prefix = ''; + var $mode = PEAR_ERROR_RETURN; + var $level = E_USER_NOTICE; + var $code = -1; + var $message = ''; + var $userinfo = ''; + var $backtrace = null; + + // }}} + // {{{ constructor + + /** + * PEAR_Error constructor + * + * @param string $message message + * + * @param int $code (optional) error code + * + * @param int $mode (optional) error mode, one of: PEAR_ERROR_RETURN, + * PEAR_ERROR_PRINT, PEAR_ERROR_DIE, PEAR_ERROR_TRIGGER, + * PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION + * + * @param mixed $options (optional) error level, _OR_ in the case of + * PEAR_ERROR_CALLBACK, the callback function or object/method + * tuple. + * + * @param string $userinfo (optional) additional user/debug info + * + * @access public + * + */ + function PEAR_Error($message = 'unknown error', $code = null, + $mode = null, $options = null, $userinfo = null) + { + if ($mode === null) { + $mode = PEAR_ERROR_RETURN; + } + $this->message = $message; + $this->code = $code; + $this->mode = $mode; + $this->userinfo = $userinfo; + if (function_exists("debug_backtrace")) { + if (@!PEAR::getStaticProperty('PEAR_Error', 'skiptrace')) { + $this->backtrace = debug_backtrace(); + } + } + if ($mode & PEAR_ERROR_CALLBACK) { + $this->level = E_USER_NOTICE; + $this->callback = $options; + } else { + if ($options === null) { + $options = E_USER_NOTICE; + } + $this->level = $options; + $this->callback = null; + } + if ($this->mode & PEAR_ERROR_PRINT) { + if (is_null($options) || is_int($options)) { + $format = "%s"; + } else { + $format = $options; + } + printf($format, $this->getMessage()); + } + if ($this->mode & PEAR_ERROR_TRIGGER) { + trigger_error($this->getMessage(), $this->level); + } + if ($this->mode & PEAR_ERROR_DIE) { + $msg = $this->getMessage(); + if (is_null($options) || is_int($options)) { + $format = "%s"; + if (substr($msg, -1) != "\n") { + $msg .= "\n"; + } + } else { + $format = $options; + } + die(sprintf($format, $msg)); + } + if ($this->mode & PEAR_ERROR_CALLBACK) { + if (is_callable($this->callback)) { + call_user_func($this->callback, $this); + } + } + if ($this->mode & PEAR_ERROR_EXCEPTION) { + trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_ErrorStack for exceptions", E_USER_WARNING); + eval('$e = new Exception($this->message, $this->code);$e->PEAR_Error = $this;throw($e);'); + } + } + + // }}} + // {{{ getMode() + + /** + * Get the error mode from an error object. + * + * @return int error mode + * @access public + */ + function getMode() { + return $this->mode; + } + + // }}} + // {{{ getCallback() + + /** + * Get the callback function/method from an error object. + * + * @return mixed callback function or object/method array + * @access public + */ + function getCallback() { + return $this->callback; + } + + // }}} + // {{{ getMessage() + + + /** + * Get the error message from an error object. + * + * @return string full error message + * @access public + */ + function getMessage() + { + return ($this->error_message_prefix . $this->message); + } + + + // }}} + // {{{ getCode() + + /** + * Get error code from an error object + * + * @return int error code + * @access public + */ + function getCode() + { + return $this->code; + } + + // }}} + // {{{ getType() + + /** + * Get the name of this error/exception. + * + * @return string error/exception name (type) + * @access public + */ + function getType() + { + return get_class($this); + } + + // }}} + // {{{ getUserInfo() + + /** + * Get additional user-supplied information. + * + * @return string user-supplied information + * @access public + */ + function getUserInfo() + { + return $this->userinfo; + } + + // }}} + // {{{ getDebugInfo() + + /** + * Get additional debug information supplied by the application. + * + * @return string debug information + * @access public + */ + function getDebugInfo() + { + return $this->getUserInfo(); + } + + // }}} + // {{{ getBacktrace() + + /** + * Get the call backtrace from where the error was generated. + * Supported with PHP 4.3.0 or newer. + * + * @param int $frame (optional) what frame to fetch + * @return array Backtrace, or NULL if not available. + * @access public + */ + function getBacktrace($frame = null) + { + if ($frame === null) { + return $this->backtrace; + } + return $this->backtrace[$frame]; + } + + // }}} + // {{{ addUserInfo() + + function addUserInfo($info) + { + if (empty($this->userinfo)) { + $this->userinfo = $info; + } else { + $this->userinfo .= " ** $info"; + } + } + + // }}} + // {{{ toString() + + /** + * Make a string representation of this object. + * + * @return string a string with an object summary + * @access public + */ + function toString() { + $modes = array(); + $levels = array(E_USER_NOTICE => 'notice', + E_USER_WARNING => 'warning', + E_USER_ERROR => 'error'); + if ($this->mode & PEAR_ERROR_CALLBACK) { + if (is_array($this->callback)) { + $callback = (is_object($this->callback[0]) ? + strtolower(get_class($this->callback[0])) : + $this->callback[0]) . '::' . + $this->callback[1]; + } else { + $callback = $this->callback; + } + return sprintf('[%s: message="%s" code=%d mode=callback '. + 'callback=%s prefix="%s" info="%s"]', + strtolower(get_class($this)), $this->message, $this->code, + $callback, $this->error_message_prefix, + $this->userinfo); + } + if ($this->mode & PEAR_ERROR_PRINT) { + $modes[] = 'print'; + } + if ($this->mode & PEAR_ERROR_TRIGGER) { + $modes[] = 'trigger'; + } + if ($this->mode & PEAR_ERROR_DIE) { + $modes[] = 'die'; + } + if ($this->mode & PEAR_ERROR_RETURN) { + $modes[] = 'return'; + } + return sprintf('[%s: message="%s" code=%d mode=%s level=%s '. + 'prefix="%s" info="%s"]', + strtolower(get_class($this)), $this->message, $this->code, + implode("|", $modes), $levels[$this->level], + $this->error_message_prefix, + $this->userinfo); + } + + // }}} +} + +/* + * Local Variables: + * mode: php + * tab-width: 4 + * c-basic-offset: 4 + * End: + */ +?> diff --git a/paste/include/geshi/scripts/get-keywords/lib/pear/XML/Parser.php b/paste/include/geshi/scripts/get-keywords/lib/pear/XML/Parser.php new file mode 100644 index 0000000..0febabb --- /dev/null +++ b/paste/include/geshi/scripts/get-keywords/lib/pear/XML/Parser.php @@ -0,0 +1,684 @@ +<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4 |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2004 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 3.0 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available at through the world-wide-web at |
+// | http://www.php.net/license/3_0.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Author: Stig Bakken <ssb@fast.no> |
+// | Tomas V.V.Cox <cox@idecnet.com> |
+// | Stephan Schmidt <schst@php-tools.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: Parser.php,v 1.1 2005/06/04 04:04:48 oracleshinoda Exp $
+
+/**
+ * XML Parser class.
+ *
+ * This is an XML parser based on PHP's "xml" extension,
+ * based on the bundled expat library.
+ *
+ * @category XML
+ * @package XML_Parser
+ * @author Stig Bakken <ssb@fast.no>
+ * @author Tomas V.V.Cox <cox@idecnet.com>
+ * @author Stephan Schmidt <schst@php-tools.net>
+ */
+
+/**
+ * uses PEAR's error handling
+ */
+require_once 'lib/pear/PEAR.php';
+
+/**
+ * resource could not be created
+ */
+define('XML_PARSER_ERROR_NO_RESOURCE', 200);
+
+/**
+ * unsupported mode
+ */
+define('XML_PARSER_ERROR_UNSUPPORTED_MODE', 201);
+
+/**
+ * invalid encoding was given
+ */
+define('XML_PARSER_ERROR_INVALID_ENCODING', 202);
+
+/**
+ * specified file could not be read
+ */
+define('XML_PARSER_ERROR_FILE_NOT_READABLE', 203);
+
+/**
+ * invalid input
+ */
+define('XML_PARSER_ERROR_INVALID_INPUT', 204);
+
+/**
+ * remote file cannot be retrieved in safe mode
+ */
+define('XML_PARSER_ERROR_REMOTE', 205);
+
+/**
+ * XML Parser class.
+ *
+ * This is an XML parser based on PHP's "xml" extension,
+ * based on the bundled expat library.
+ *
+ * Notes:
+ * - It requires PHP 4.0.4pl1 or greater
+ * - From revision 1.17, the function names used by the 'func' mode
+ * are in the format "xmltag_$elem", for example: use "xmltag_name"
+ * to handle the <name></name> tags of your xml file.
+ *
+ * @category XML
+ * @package XML_Parser
+ * @author Stig Bakken <ssb@fast.no>
+ * @author Tomas V.V.Cox <cox@idecnet.com>
+ * @author Stephan Schmidt <schst@php-tools.net>
+ * todo create XML_Parser_Namespace to parse documents with namespaces
+ * todo create XML_Parser_Pull
+ * todo Tests that need to be made:
+ * - mixing character encodings
+ * - a test using all expat handlers
+ * - options (folding, output charset)
+ * - different parsing modes
+ */
+class XML_Parser extends PEAR
+{
+ // {{{ properties
+
+ /**
+ * XML parser handle
+ *
+ * @var resource
+ * @see xml_parser_create()
+ */
+ var $parser;
+
+ /**
+ * File handle if parsing from a file
+ *
+ * @var resource
+ */
+ var $fp;
+
+ /**
+ * Whether to do case folding
+ *
+ * If set to true, all tag and attribute names will
+ * be converted to UPPER CASE.
+ *
+ * @var boolean
+ */
+ var $folding = true;
+
+ /**
+ * Mode of operation, one of "event" or "func"
+ *
+ * @var string
+ */
+ var $mode;
+
+ /**
+ * Mapping from expat handler function to class method.
+ *
+ * @var array
+ */
+ var $handler = array(
+ 'character_data_handler' => 'cdataHandler',
+ 'default_handler' => 'defaultHandler',
+ 'processing_instruction_handler' => 'piHandler',
+ 'unparsed_entity_decl_handler' => 'unparsedHandler',
+ 'notation_decl_handler' => 'notationHandler',
+ 'external_entity_ref_handler' => 'entityrefHandler'
+ );
+
+ /**
+ * source encoding
+ *
+ * @var string
+ */
+ var $srcenc;
+
+ /**
+ * target encoding
+ *
+ * @var string
+ */
+ var $tgtenc;
+
+ /**
+ * handler object
+ *
+ * @var object
+ */
+ var $_handlerObj;
+
+ // }}}
+ // {{{ constructor
+
+ /**
+ * Creates an XML parser.
+ *
+ * This is needed for PHP4 compatibility, it will
+ * call the constructor, when a new instance is created.
+ *
+ * @param string $srcenc source charset encoding, use NULL (default) to use
+ * whatever the document specifies
+ * @param string $mode how this parser object should work, "event" for
+ * startelement/endelement-type events, "func"
+ * to have it call functions named after elements
+ * @param string $tgenc a valid target encoding
+ */
+ function XML_Parser($srcenc = null, $mode = 'event', $tgtenc = null)
+ {
+ XML_Parser::__construct($srcenc, $mode, $tgtenc);
+ }
+ // }}}
+
+ /**
+ * PHP5 constructor
+ *
+ * @param string $srcenc source charset encoding, use NULL (default) to use
+ * whatever the document specifies
+ * @param string $mode how this parser object should work, "event" for
+ * startelement/endelement-type events, "func"
+ * to have it call functions named after elements
+ * @param string $tgenc a valid target encoding
+ */
+ function __construct($srcenc = null, $mode = 'event', $tgtenc = null)
+ {
+ $this->PEAR('XML_Parser_Error');
+
+ $this->mode = $mode;
+ $this->srcenc = $srcenc;
+ $this->tgtenc = $tgtenc;
+ }
+ // }}}
+
+ /**
+ * Sets the mode of the parser.
+ *
+ * Possible modes are:
+ * - func
+ * - event
+ *
+ * You can set the mode using the second parameter
+ * in the constructor.
+ *
+ * This method is only needed, when switching to a new
+ * mode at a later point.
+ *
+ * @access public
+ * @param string mode, either 'func' or 'event'
+ * @return boolean|object true on success, PEAR_Error otherwise
+ */
+ function setMode($mode)
+ {
+ if ($mode != 'func' && $mode != 'event') {
+ $this->raiseError('Unsupported mode given', XML_PARSER_ERROR_UNSUPPORTED_MODE);
+ }
+
+ $this->mode = $mode;
+ return true;
+ }
+
+ /**
+ * Sets the object, that will handle the XML events
+ *
+ * This allows you to create a handler object independent of the
+ * parser object that you are using and easily switch the underlying
+ * parser.
+ *
+ * If no object will be set, XML_Parser assumes that you
+ * extend this class and handle the events in $this.
+ *
+ * @access public
+ * @param object object to handle the events
+ * @return boolean will always return true
+ * @since v1.2.0beta3
+ */
+ function setHandlerObj(&$obj)
+ {
+ $this->_handlerObj = &$obj;
+ return true;
+ }
+
+ /**
+ * Init the element handlers
+ *
+ * @access private
+ */
+ function _initHandlers()
+ {
+ if (!is_resource($this->parser)) {
+ return false;
+ }
+
+ if (!is_object($this->_handlerObj)) {
+ $this->_handlerObj = &$this;
+ }
+ switch ($this->mode) {
+
+ case 'func':
+ xml_set_object($this->parser, $this->_handlerObj);
+ xml_set_element_handler($this->parser, array(&$this, 'funcStartHandler'), array(&$this, 'funcEndHandler'));
+ break;
+
+ case 'event':
+ xml_set_object($this->parser, $this->_handlerObj);
+ xml_set_element_handler($this->parser, 'startHandler', 'endHandler');
+ break;
+ default:
+ return $this->raiseError('Unsupported mode given', XML_PARSER_ERROR_UNSUPPORTED_MODE);
+ break;
+ }
+
+
+ /**
+ * set additional handlers for character data, entities, etc.
+ */
+ foreach ($this->handler as $xml_func => $method) {
+ if (method_exists($this->_handlerObj, $method)) {
+ $xml_func = 'xml_set_' . $xml_func;
+ $xml_func($this->parser, $method);
+ }
+ }
+ }
+
+ // {{{ _create()
+
+ /**
+ * create the XML parser resource
+ *
+ * Has been moved from the constructor to avoid
+ * problems with object references.
+ *
+ * Furthermore it allows us returning an error
+ * if something fails.
+ *
+ * @access private
+ * @return boolean|object true on success, PEAR_Error otherwise
+ *
+ * @see xml_parser_create
+ */
+ function _create()
+ {
+ if ($this->srcenc === null) {
+ $xp = @xml_parser_create();
+ } else {
+ $xp = @xml_parser_create($this->srcenc);
+ }
+ if (is_resource($xp)) {
+ if ($this->tgtenc !== null) {
+ if (!@xml_parser_set_option($xp, XML_OPTION_TARGET_ENCODING,
+ $this->tgtenc)) {
+ return $this->raiseError('invalid target encoding', XML_PARSER_ERROR_INVALID_ENCODING);
+ }
+ }
+ $this->parser = $xp;
+ $result = $this->_initHandlers($this->mode);
+ if ($this->isError($result)) {
+ return $result;
+ }
+ xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, $this->folding);
+
+ return true;
+ }
+ return $this->raiseError('Unable to create XML parser resource.', XML_PARSER_ERROR_NO_RESOURCE);
+ }
+
+ // }}}
+ // {{{ reset()
+
+ /**
+ * Reset the parser.
+ *
+ * This allows you to use one parser instance
+ * to parse multiple XML documents.
+ *
+ * @access public
+ * @return boolean|object true on success, PEAR_Error otherwise
+ */
+ function reset()
+ {
+ $result = $this->_create();
+ if ($this->isError( $result )) {
+ return $result;
+ }
+ return true;
+ }
+
+ // }}}
+ // {{{ setInputFile()
+
+ /**
+ * Sets the input xml file to be parsed
+ *
+ * @param string Filename (full path)
+ * @return resource fopen handle of the given file
+ * @throws XML_Parser_Error
+ * @see setInput(), setInputString(), parse()
+ * @access public
+ */
+ function setInputFile($file)
+ {
+ /**
+ * check, if file is a remote file
+ */
+ if (eregi('^(http|ftp)://', substr($file, 0, 10))) {
+ if (!ini_get('allow_url_fopen')) {
+ return $this->raiseError('Remote files cannot be parsed, as safe mode is enabled.', XML_PARSER_ERROR_REMOTE);
+ }
+ }
+
+ $fp = @fopen($file, 'rb');
+ if (is_resource($fp)) {
+ $this->fp = $fp;
+ return $fp;
+ }
+ return $this->raiseError('File could not be opened.', XML_PARSER_ERROR_FILE_NOT_READABLE);
+ }
+
+ // }}}
+ // {{{ setInputString()
+
+ /**
+ * XML_Parser::setInputString()
+ *
+ * Sets the xml input from a string
+ *
+ * @param string $data a string containing the XML document
+ * @return null
+ **/
+ function setInputString($data)
+ {
+ $this->fp = $data;
+ return null;
+ }
+
+ // }}}
+ // {{{ setInput()
+
+ /**
+ * Sets the file handle to use with parse().
+ *
+ * You should use setInputFile() or setInputString() if you
+ * pass a string
+ *
+ * @param mixed $fp Can be either a resource returned from fopen(),
+ * a URL, a local filename or a string.
+ * @access public
+ * @see parse()
+ * @uses setInputString(), setInputFile()
+ */
+ function setInput($fp)
+ {
+ if (is_resource($fp)) {
+ $this->fp = $fp;
+ return true;
+ }
+ // see if it's an absolute URL (has a scheme at the beginning)
+ elseif (eregi('^[a-z]+://', substr($fp, 0, 10))) {
+ return $this->setInputFile($fp);
+ }
+ // see if it's a local file
+ elseif (file_exists($fp)) {
+ return $this->setInputFile($fp);
+ }
+ // it must be a string
+ else {
+ $this->fp = $fp;
+ return true;
+ }
+
+ return $this->raiseError('Illegal input format', XML_PARSER_ERROR_INVALID_INPUT);
+ }
+
+ // }}}
+ // {{{ parse()
+
+ /**
+ * Central parsing function.
+ *
+ * @return true|object PEAR error returns true on success, or a PEAR_Error otherwise
+ * @access public
+ */
+ function parse()
+ {
+ /**
+ * reset the parser
+ */
+ $result = $this->reset();
+ if ($this->isError($result)) {
+ return $result;
+ }
+ // if $this->fp was fopened previously
+ if (is_resource($this->fp)) {
+
+ while ($data = fread($this->fp, 4096)) {
+ if (!$this->_parseString($data, feof($this->fp))) {
+ $error = &$this->raiseError();
+ $this->free();
+ return $error;
+ }
+ }
+ // otherwise, $this->fp must be a string
+ } else {
+ if (!$this->_parseString($this->fp, true)) {
+ $error = &$this->raiseError();
+ $this->free();
+ return $error;
+ }
+ }
+ $this->free();
+
+ return true;
+ }
+
+ /**
+ * XML_Parser::_parseString()
+ *
+ * @param string $data
+ * @param boolean $eof
+ * @return bool
+ * @access private
+ * @see parseString()
+ **/
+ function _parseString($data, $eof = false)
+ {
+ return xml_parse($this->parser, $data, $eof);
+ }
+
+ // }}}
+ // {{{ parseString()
+
+ /**
+ * XML_Parser::parseString()
+ *
+ * Parses a string.
+ *
+ * @param string $data XML data
+ * @param boolean $eof If set and TRUE, data is the last piece of data sent in this parser
+ * @throws XML_Parser_Error
+ * @return Pear Error|true true on success or a PEAR Error
+ * @see _parseString()
+ */
+ function parseString($data, $eof = false)
+ {
+ if (!isset($this->parser) || !is_resource($this->parser)) {
+ $this->reset();
+ }
+
+ if (!$this->_parseString($data, $eof)) {
+ $error = &$this->raiseError();
+ $this->free();
+ return $error;
+ }
+
+ if ($eof === true) {
+ $this->free();
+ }
+ return true;
+ }
+
+ /**
+ * XML_Parser::free()
+ *
+ * Free the internal resources associated with the parser
+ *
+ * @return null
+ **/
+ function free()
+ {
+ if (isset($this->parser) && is_resource($this->parser)) {
+ xml_parser_free($this->parser);
+ unset( $this->parser );
+ }
+ if (isset($this->fp) && is_resource($this->fp)) {
+ fclose($this->fp);
+ }
+ unset($this->fp);
+ return null;
+ }
+
+ /**
+ * XML_Parser::raiseError()
+ *
+ * Throws a XML_Parser_Error
+ *
+ * @param string $msg the error message
+ * @param integer $ecode the error message code
+ * @return XML_Parser_Error
+ **/
+ function raiseError($msg = null, $ecode = 0)
+ {
+ $msg = !is_null($msg) ? $msg : $this->parser;
+ $err = &new XML_Parser_Error($msg, $ecode);
+ return parent::raiseError($err);
+ }
+
+ // }}}
+ // {{{ funcStartHandler()
+
+ function funcStartHandler($xp, $elem, $attribs)
+ {
+ $func = 'xmltag_' . $elem;
+ if (strchr($func, '.')) {
+ $func = str_replace('.', '_', $func);
+ }
+ if (method_exists($this->_handlerObj, $func)) {
+ call_user_func(array(&$this->_handlerObj, $func), $xp, $elem, $attribs);
+ } elseif (method_exists($this->_handlerObj, 'xmltag')) {
+ call_user_func(array(&$this->_handlerObj, 'xmltag'), $xp, $elem, $attribs);
+ }
+ }
+
+ // }}}
+ // {{{ funcEndHandler()
+
+ function funcEndHandler($xp, $elem)
+ {
+ $func = 'xmltag_' . $elem . '_';
+ if (strchr($func, '.')) {
+ $func = str_replace('.', '_', $func);
+ }
+ if (method_exists($this->_handlerObj, $func)) {
+ call_user_func(array(&$this->_handlerObj, $func), $xp, $elem);
+ } elseif (method_exists($this->_handlerObj, 'xmltag_')) {
+ call_user_func(array(&$this->_handlerObj, 'xmltag_'), $xp, $elem);
+ }
+ }
+
+ // }}}
+ // {{{ startHandler()
+
+ /**
+ *
+ * @abstract
+ */
+ function startHandler($xp, $elem, &$attribs)
+ {
+ return NULL;
+ }
+
+ // }}}
+ // {{{ endHandler()
+
+ /**
+ *
+ * @abstract
+ */
+ function endHandler($xp, $elem)
+ {
+ return NULL;
+ }
+
+
+ // }}}me
+}
+
+/**
+ * error class, replaces PEAR_Error
+ *
+ * An instance of this class will be returned
+ * if an error occurs inside XML_Parser.
+ *
+ * There are three advantages over using the standard PEAR_Error:
+ * - All messages will be prefixed
+ * - check for XML_Parser error, using is_a( $error, 'XML_Parser_Error' )
+ * - messages can be generated from the xml_parser resource
+ *
+ * @package XML_Parser
+ * @access public
+ * @see PEAR_Error
+ */
+class XML_Parser_Error extends PEAR_Error
+{
+ // {{{ properties
+
+ /**
+ * prefix for all messages
+ *
+ * @var string
+ */
+ var $error_message_prefix = 'XML_Parser: ';
+
+ // }}}
+ // {{{ constructor()
+ /**
+ * construct a new error instance
+ *
+ * You may either pass a message or an xml_parser resource as first
+ * parameter. If a resource has been passed, the last error that
+ * happened will be retrieved and returned.
+ *
+ * @access public
+ * @param string|resource message or parser resource
+ * @param integer error code
+ * @param integer error handling
+ * @param integer error level
+ */
+ function XML_Parser_Error($msgorparser = 'unknown error', $code = 0, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE)
+ {
+ if (is_resource($msgorparser)) {
+ $code = xml_get_error_code($msgorparser);
+ $msgorparser = sprintf('%s at XML input line %d',
+ xml_error_string($code),
+ xml_get_current_line_number($msgorparser));
+ }
+ $this->PEAR_Error($msgorparser, $code, $mode, $level);
+ }
+ // }}}
+}
+?>
\ No newline at end of file diff --git a/paste/include/highlight.inc b/paste/include/highlight.inc deleted file mode 100644 index 32491d7..0000000 --- a/paste/include/highlight.inc +++ /dev/null @@ -1,1122 +0,0 @@ -<? -/* -This software is licensed through a BSD-style License. -http://www.opensource.org/licenses/bsd-license.php - -Copyright (c) 2002 - 2009 Jacob D. Cohen -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. -Neither the name of Jacob D. Cohen nor the names of his contributors -may be used to endorse or promote products derived from this software -without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -/* - -Special thanks to E.J. Brocklesby for providing PL/I language support. -Special thanks to F.R. for the XML language support. - -*/ - -function keyword_replace($keywords, $text, $ncs = false) -{ - $cm = ($ncs)? "i" : ""; - foreach ($keywords as $keyword) - { - $search[] = "/(\\b$keyword\\b)/" . $cm; - $replace[] = '<span class="keyword">\\0</span>'; - } - - $search[] = "/(\\bclass\s)/"; - $replace[] = '<span class="keyword">\\0</span>'; - - return preg_replace($search, $replace, $text); -} - - -function preproc_replace($preproc, $text) -{ - foreach ($preproc as $proc) - { - $search[] = "/(\\s*#\s*$proc\\b)/"; - $replace[] = '<span class="keyword">\\0</span>'; - } - - return preg_replace($search, $replace, $text); -} - - -function sch_syntax_helper($text) -{ - return $text; -} - - -function syntax_highlight_helper($text, $language) -{ - $preproc = array(); - $preproc["C++"] = array( - "if", "ifdef", "ifndef", "elif", "else", - "endif", "include", "define", "undef", "line", - "error", "pragma"); - $preproc["C89"] = & $preproc["C++"]; - $preproc["C"] = & $preproc["C89"]; - - $keywords = array( - "C++" => array( - "asm", "auto", "bool", "break", "case", - "catch", "char", /*class*/ "const", "const_cast", - "continue", "default", "delete", "do", "double", - "dynamic_cast", "else", "enum", "explicit", "export", - "extern", "false", "float", "for", "friend", - "goto", "if", "inline", "int", "long", - "mutable", "namespace", "new", "operator", "private", - "protected", "public", "register", "reinterpret_cast", "return", - "short", "signed", "sizeof", "static", "static_cast", - "struct", "switch", "template", "this", "throw", - "true", "try", "typedef", "typeid", "typename", - "union", "unsigned", "using", "virtual", "void", - "volatile", "wchar_t", "while"), - - "C89" => array( - "auto", "break", "case", "char", "const", - "continue", "default", "do", "double", "else", - "enum", "extern", "float", "for", "goto", - "if", "int", "long", "register", "return", - "short", "signed", "sizeof", "static", "struct", - "switch", "typedef", "union", "unsigned", "void", - "volatile", "while"), - - "C" => array( - "auto", "break", "case", "char", "const", - "continue", "default", "do", "double", "else", - "enum", "extern", "float", "for", "goto", - "if", "int", "long", "register", "return", - "short", "signed", "sizeof", "static", "struct", - "switch", "typedef", "union", "unsigned", "void", - "volatile", "while", "__restrict","_Bool"), - - "PHP" => array( - "and", "or", "xor", "__FILE__", "__LINE__", - "array", "as", "break", "case", "cfunction", - /*class*/ "const", "continue", "declare", "default", - "die", "do", "echo", "else", "elseif", - "empty", "enddeclare", "endfor", "endforeach", "endif", - "endswitch", "endwhile", "eval", "exit", "extends", - "for", "foreach", "function", "global", "if", - "include", "include_once", "isset", "list", "new", - "old_function", "print", "require", "require_once", "return", - "static", "switch", "unset", "use", "var", - "while", "__FUNCTION__", "__CLASS__"), - - "Perl" => array( - "-A", "-B", "-C", "-M", "-O", - "-R", "-S", "-T", "-W", "-X", - "-b", "-c", "-d", "-e", "-f", - "-g", "-k", "-l", "-o", "-p", - "-r", "-s", "-t", "-u", "-w", - "-x", "-z", "ARGV", "DATA", "ENV", - "SIG", "STDERR", "STDIN", "STDOUT", "atan2", - "bind", "binmode", "bless", "caller", "chdir", - "chmod", "chomp", "chop", "chown", "chr", - "chroot", "close", "closedir", "cmp", "connect", - "continue", "cos", "crypt", "dbmclose", "dbmopen", - "defined", "delete", "die", "do", "dump", - "each", "else", "elsif", "endgrent", "endhostent", - "endnetent", "endprotent", "endpwent", "endservent", "eof", - "eq", "eval", "exec", "exists", "exit", - "exp", "fcntl", "fileno", "flock", "for", - "foreach", "fork", "format", "formline", "ge", - "getc", "getgrent", "getgrid", "getgrnam", "gethostbyaddr", - "gethostbyname","gethostent", "getlogin", "getnetbyaddr", "getnetbyname", - "getnetent", "getpeername", "getpgrp", "getppid", "getpriority", - "getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam", - "getpwuid", "getservbyname","getservbyport","getservent","getsockname", - "getsockopt", "glob", "gmtime", "goto", "grep", - /*gt*/ "hex", "if", "import", "index", - "int", "ioctl", "join", "keys", "kill", - "last", "lc", "lcfirst", "le", "length", - "link", "listen", "local", "localtime", "log", - "lstat", /*lt*/ "m", "map", "mkdir", - "msgctl", "msgget", "msgrcv", "msgsnd", "my", - "ne", "next", "no", "oct", "open", - "opendir", "ord", "pack", "package", "pipe", - "pop", "pos", "print", "printf", "push", - "q", "qq", "quotemeta","qw", "qx", - "rand", "read", "readdir", "readlink", "recv", - "redo", "ref", "refname", "require", "reset", - "return", "reverse", "rewinddir","rindex", "rmdir", - "s", "scalar", "seek", "seekdir", "select", - "semctl", "semget", "semop", "send", "setgrent", - "sethostent", "setnetent", "setpgrp", "setpriority", "setprotoent", - "setpwent", "setservent", "setsockopt","shift", "shmctl", - "shmget", "shmread", "shmwrite", "shutdown", "sin", - "sleep", "socket", "socketpair","sort", "splice", - "split", "sprintf", "sqrt", "srand", "stat", - "study", "sub", "substr", "symlink", "syscall", - "sysopen", "sysread", "system", "syswrite", "tell", - "telldir", "tie", "tied", "time", "times", - "tr", "truncate", "uc", "ucfirst", "umask", - "undef", "unless", "unlink", "unpack", "unshift", - "untie", "until", "use", "utime", "values", - "vec", "wait", "waitpid", "wantarray", "warn", - "while", "write", "y", "or", "and", - "not"), - - "Java" => array( - "abstract", "boolean", "break", "byte", "case", - "catch", "char", /*class*/ "const", "continue", - "default", "do", "double", "else", "extends", - "final", "finally", "float", "for", "goto", - "if", "implements", "import", "instanceof", "int", - "interface", "long", "native", "new", "package", - "private", "protected", "public", "return", "short", - "static", "strictfp", "super", "switch", "synchronized", - "this", "throw", "throws", "transient", "try", - "void", "volatile", "while"), - - "VB" => array( - "AddressOf", "Alias", "And", "Any", "As", - "Binary", "Boolean", "ByRef", "Byte", "ByVal", - "Call", "Case", "CBool", "CByte", "CCur", - "CDate", "CDbl", "CInt", "CLng", "Close", - "Const", "CSng", "CStr", "Currency", "CVar", - "CVErr", "Date", "Debug", "Declare", "DefBool", - "DefByte", "DefCur", "DefDate", "DefDbl", "DefInt", - "DefLng", "DefObj", "DefSng", "DefStr", "DefVar", - "Dim", "Do", "Double", "Each", "Else", - "End", "Enum", "Eqv", "Erase", "Error", - "Event", "Exit", "For", "Friend", "Function", - "Get", "Get", "Global", "GoSub", "GoTo", - "If", "Imp", "Implements","In", "Input", - "Integer", "Is", "LBound", "Len", "Let", - "Lib", "Like", "Line", "Lock", "Long", - "Loop", "LSet", "Mod", "Name", "Next", - "Not", "Nothing", "Null", "Object", "On", - "Open", "Option Base 1","Option Compare Binary", - "Option Compare Database", "Option Compare Text", "Option Explicit", - "Option Private Module", "Optional", "Or", "Output", - "ParamArray", "Preserve", "Print", "Private", "Property", - "Public", "Put", "RaiseEvent","Random", "Read", - "ReDim", "Resume", "Return", "RSet", "Seek", - "Select", "Set", "Single", "Spc", "Static", - "Step", "Stop", "String", "Sub", "Tab", - "Then", "To", "Type", "UBound", "Unlock", - "Variant", "Wend", "While", "With", "WithEvents", - "Write", "Xor"), - - "C#" => array( - "abstract", "as", "base", "bool", "break", - "byte", "case", "catch", "char", "checked", - /*class*/ "const", "continue", "decimal", "default", - "delegate", "do", "double", "else", "enum", - "event", "explicit", "extern", "false", "finally", - "fixed", "float", "for", "foreach", "goto", - "if", "implicit", "in", "int", "interface", - "internal", "is", "lock", "long", "namespace", - "new", "null", "object", "operator", "out", - "override", "params", "private", "protected", "public", - "readonly", "ref", "return", "sbyte", "sealed", - "short", "sizeof", "stackalloc","static", "string", - "struct", "switch", "this", "throw", "true", - "try", "typeof", "uint", "ulong", "unchecked", - "unsafe", "ushort", "using", "virtual", "volatile", - "void", "while"), - - "Ruby" => array( - "alias", "and", "begin", "break", "case", - /*class*/ "def", "defined", "do", "else", - "elsif", "end", "ensure", "false", "for", - "if", "in", "module", "next", "module", - "next", "nil", "not", "or", "redo", - "rescue", "retry", "return", "self", "super", - "then", "true", "undef", "unless", "until", - "when", "while", "yield"), - - "Python" => array( - "and", "assert", "break", /*"class",*/ "continue", - "def", "del", "elif", "else", "except", - "exec", "finally", "for", "from", "global", - "if", "import", "in", "is", "lambda", - "not", "or", "pass", "print", "raise", - "return", "try", "while", "yield"), - - "Pascal" => array( - "Absolute", "Abstract", "All", "And", "And_then", - "Array", "Asm", "Begin", "Bindable", "Case", - /*"Class",*/ "Const", "Constructor","Destructor", "Div", - "Do", "Downto", "Else", "End", "Export", - "File", "For", "Function", "Goto", "If", - "Import", "Implementation","Inherited","In", "Inline", - "Interface", "Is", "Label", "Mod", "Module", - "Nil", "Not", "Object", "Of", "Only", - "Operator", "Or", "Or_else", "Otherwise", "Packed", - "Pow", "Procedure", "Program", "Property", "Protected", - "Qualified", "Record", "Repeat", "Restricted", "Set", - "Shl", "Shr", "Then", "To", "Type", - "Unit", "Until", "Uses", "Value", "Var", - "View", "Virtual", "While", "With", "Xor"), - - "mIRC" => array( - ), - - "PL/I" => array( - "A", "ABS", "ACOS", "%ACTIVATE", "ACTUALCOUNT", - "ADD", "ADDR", "ADDREL", "ALIGNED", "ALLOCATE", - "ALLOC", "ALLOCATION", "ALLOCN", "ANY", "ANYCONDITION", - "APPEND", "AREA", "ASIN", "ATAN", "ATAND", - "ATANH", "AUTOMATIC", "AUTO", "B", "B1", - "B2", "B3", "B4", "BACKUP_DATE", "BASED", - "BATCH", "BEGIN", "BINARY", "BIN", "BIT", - "BLOCK_BOUNDARY_FORMAT", "BLOCK_IO", "BLOCK_SIZE", "BOOL", - "BUCKET_SIZE", "BUILTIN", "BY", "BYTE", "BYTESIZE", - "CALL", "CANCEL_CONTROL_O", "CARRIAGE_RETURN_FORMAT", - "CEIL", "CHAR", "CHARACTER", "CLOSE", "COLLATE", "COLUMN", - "CONDITION", "CONTIGUOUS", "CONTIGUOUS_BEST_TRY", "CONTROLLED", - "CONVERSION", "COPY", "COS", "COSD", "COSH", - "CREATION_DATE", "CURRENT_POSITION", "DATE", - "DATETIME", "%DEACTIVATE", "DECIMAL", "DEC", "%DECLARE", - "%DCL", "DECLARE", "DCL", "DECODE", "DEFAULT_FILE_NAME", - "DEFERRED_WRITE", "DEFINED", "DEF", "DELETE", - "DESCRIPTOR", "%DICTIONARY", "DIMENSION","DIM", "DIRECT", - "DISPLAY", "DIVIDE", "%DO", "DO", "E", - "EDIT", "%ELSE", "ELSE", "EMPTY", "ENCODE", - "%END", "END", "ENDFILE", "ENDPAGE", "ENTRY", - "ENVIRONMENT", "ENV", "%ERROR", "ERROR", "EVERY", - "EXP", "EXPIRATION_DATE", "EXTEND", "EXTENSION_SIZE", - "EXTERNAL", "EXT", "F", "FAST_DELETE", "%FATAL", - "FILE", "FILE_ID", "FILE_ID_TO", "FILE_SIZE", - "FINISH", "FIXED", "FIXEDOVERFLOW", "FOFL", - "FIXED_CONTROL_FROM", "FIXED_CONTROL_SIZE", "FIXED_CONTROL_SIZE_TO", - "FIXED_CONTROL_TO", "FIXED_LENGTH_RECORDS", "FLOAT", - "FLOOR", "FLUSH", "FORMAT", "FREE", "FROM", - "GET", "GLOBALDEF", "GLOBALREF", "%GOTO", - "GOTO", "GO", "TO", "GROUP_PROTETION", "HBOUND", - "HIGH", "INDENT", "%IF", "IF", "IGNORE_LINE_MARKS", - "IN", "%INCLUDE", "INDEX", "INDEXED", "INDEX_NUMBER", - "%INFORM", "INFORM", "INITIAL", "INIT", "INITIAL_FILL", - "INPUT", "INT", "INTERNAL", "INTO", "KEY", - "KEYED", "KEYFROM", "KEYTO", "LABEL", "LBOUND", - "LEAVE", "LENGTH", "LIKE", "LINE", "LINENO", - "LINESIZE", "%LIST", "LIST", "LOCK_ON_READ", "LOCK_ON_WRITE", - "LOG", "LOG10", "LOG2", "LOW", "LTRIM", - "MAIN", "MANUAL_UNLOCKING", "MATCH_GREATER", - "MATCH_GREATER_EQUAL", "MATCH_NEXT", "MATCH_NEXT_EQUAL", - "MAX", "MAXIMUM_RECORD_NUMBER", "MAXIMUM_RECORD_SIZE", - "MAXLENGTH", "MEMBER", "MIN", "MOD", "MULTIBLOCK_COUNT", - "MULTIBUFFER_COUNT", "MULTIPLY", "NEXT_VOLUME", "%NOLIST", - "NOLOCK", "NONEXISTENT_RECORD", "NONRECURSIVE", "NONVARYING", - "NONVAR", "NORESCAN", "NO_ECHO", "NO_FILTER", "NO_SHARE", - "NULL", "OFFSET", "ON", "ONARGSLIST", "ONCHAR", - "ONCODE", "ONFILE", "ONKEY", "ONSOURCE", "OPEN", - "OPTIONAL", "OPTIONS", "OTHERWISE","OTHER", "OUTPUT", - "OVERFLOW", "OFL", "OWNER_GROUP", "OWNER_ID", - "OWNER_MEMBER", "OWNER_PROTECTION", "P", "%PAGE", - "PAGE", "PAGENO", "PAGESIZE", "PARAMETER", "PARM", - "PICTURE", "PIC", "POINTER", "PTR", "POSINT", - "POSITION", "POS", "PRECISION","PREC", "PRESENT", - "PRINT", "PRINTER_FORMAT", "%PROCEDURE", "%PROC", - "PROCEDURE", "PROC", "PROD", "PROMPT", "PURGE_TYPE_AHEAD", - "PUT", "R", "RANK", "READ", "READONLY", - "READ_AHEAD", "READ_CHECK", "READ_REGARDLESS", "RECORD", - "RECORD_ID", "RECORD_ID_ACCESS", "RECORD_ID_TO", "RECURSIVE", - "REFER", "REFERENCE", "RELEASE", "REPEAT", "%REPLACE", - "RESCAN", "RESIGNAL", "RETRIEVAL_POINTERS", "%RETURN", - "RETURN", "RETURNS", "REVERSE", "REVERT", "REVISION_DATE", - "REWIND", "REWIND_ON_CLOSE", "REWIND_ON_OPEN", - "REWRITE", "ROUND", "RTRIM", "%SBTTL", "SCALARVARYING", - "SEARCH", "SELECT", "SEQUENTIAL", "SEQL", - "SET", "SHARED_READ", "SHARED_WRITE", "SIGN", - "SIGNAL", "SIN", "SIND", "SINH", "SIZE", - "SKIP", "SNAP", "SOME", "SPACEBLOCK", "SPOOL", - "SQRT", "STATEMENT", "STATIC", "STOP", "STORAGE", - "STREAM", "STRING", "STRINGRANGE", "STRG", - "STRUCTURE", "SUBSCRIPTRANGE", "SUBRG", "SUBSTR", - "SUBTRACT", "SUM", "SUPERCEDE","SYSIN", "SYSPRINT", - "SYSTEM", "SYSTEM_PROTECTION", "TAB", "TAN", - "TAND", "TANH", "TEMPORARY","%THEN", "THEN", - "TIME", "TIMEOUT_PERIOD", "%TITLE", "TITLE", - "TO", "TRANSLATE", "TRIM", "TRUNC", "TRUNCATE", - "UNALIGNED", "UNAL", "UNDEFINED","UNDF", "UNDERFLOW", - "UFL", "UNION", "UNSPEC", "UNTIL", "UPDATE", - "USER_OPEN", "VALID", "VALUE", "VAL", "VARIABLE", - "VARIANT", "VARYING", "VAR", "VAXCONDITION", "VERIFY", - "WAIT_FOR_RECORD", "%WARN", "WARN", "WHEN", - "WHILE", "WORLD_PROTECTION", "WRITE", "WRITE_BEHIND", - "WRITE_CHECK", "X", "ZERODIVIDE"), - - "SQL" => array( - "abort", "abs", "absolute", "access", - "action", "ada", "add", "admin", - "after", "aggregate", "alias", "all", - "allocate", "alter", "analyse", "analyze", - "and", "any", "are", "array", - "as", "asc", "asensitive", "assertion", - "assignment", "asymmetric", "at", "atomic", - "authorization", "avg", "backward", "before", - "begin", "between", "bigint", "binary", - "bit", "bitvar", "bit_length", "blob", - "boolean", "both", "breadth", "by", - "c", "cache", "call", "called", - "cardinality", "cascade", "cascaded", "case", - "cast", "catalog", "catalog_name", "chain", - "char", "character", "characteristics", "character_length", - "character_set_catalog", "character_set_name", "character_set_schema", "char_length", - "check", "checked", "checkpoint", /* "class", */ - "class_origin", "clob", "close", "cluster", - "coalesce", "cobol", "collate", "collation", - "collation_catalog", "collation_name", "collation_schema", "column", - "column_name", "command_function", "command_function_code", "comment", - "commit", "committed", "completion", "condition_number", - "connect", "connection", "connection_name", "constraint", - "constraints", "constraint_catalog", "constraint_name", "constraint_schema", - "constructor", "contains", "continue", "conversion", - "convert", "copy", "corresponding", "count", - "create", "createdb", "createuser", "cross", - "cube", "current", "current_date", "current_path", - "current_role", "current_time", "current_timestamp", "current_user", - "cursor", "cursor_name", "cycle", "data", - "database", "date", "datetime_interval_code", "datetime_interval_precision", - "day", "deallocate", "dec", "decimal", - "declare", "default", "defaults", "deferrable", - "deferred", "defined", "definer", "delete", - "delimiter", "delimiters", "depth", "deref", - "desc", "describe", "descriptor", "destroy", - "destructor", "deterministic", "diagnostics", "dictionary", - "disconnect", "dispatch", "distinct", "do", - "domain", "double", "drop", "dynamic", - "dynamic_function", "dynamic_function_code", "each", "else", - "encoding", "encrypted", "end", "end-exec", - "equals", "escape", "every", "except", - "exception", "excluding", "exclusive", "exec", - "execute", "existing", "exists", "explain", - "external", "extract", "false", "fetch", - "final", "first", "float", "for", - "force", "foreign", "fortran", "forward", - "found", "free", "freeze", "from", - "full", "function", "g", "general", - "generated", "get", "global", "go", - "goto", "grant", "granted", "group", - "grouping", "handler", "having", "hierarchy", - "hold", "host", "hour", "identity", - "ignore", "ilike", "immediate", "immutable", - "implementation", "implicit", "in", "including", - "increment", "index", "indicator", "infix", - "inherits", "initialize", "initially", "inner", - "inout", "input", "insensitive", "insert", - "instance", "instantiable", "instead", "int", - "integer", "intersect", "interval", "into", - "invoker", "is", "isnull", "isolation", - "iterate", "join", "k", "key", - "key_member", "key_type", "lancompiler", "language", - "large", "last", "lateral", "leading", - "left", "length", "less", "level", - "like", "limit", "listen", "load", - "local", "localtime", "localtimestamp", "location", - "locator", "lock", "lower", "m", - "map", "match", "max", "maxvalue", - "message_length", "message_octet_length", "message_text", "method", - "min", "minute", "minvalue", "mod", - "mode", "modifies", "modify", "module", - "month", "more", "move", "mumps", - "name", "names", "national", "natural", - "nchar", "nclob", "new", "next", - "no", "nocreatedb", "nocreateuser", "none", - "not", "nothing", "notify", "notnull", - "null", "nullable", "nullif", "number", - "numeric", "object", "octet_length", "of", - "off", "offset", "oids", "old", - "on", "only", "open", "operation", - "operator", "option", "options", "or", - "order", "ordinality", "out", "outer", - "output", "overlaps", "overlay", "overriding", - "owner", "pad", "parameter", "parameters", - "parameter_mode", "parameter_name", "parameter_ordinal_position", "parameter_specific_catalog", - "parameter_specific_name", "parameter_specific_schema", "partial", "pascal", - "password", "path", "pendant", "placing", - "pli", "position", "postfix", "precision", - "prefix", "preorder", "prepare", "preserve", - "primary", "prior", "privileges", "procedural", - "procedure", "public", "read", "reads", - "real", "recheck", "recursive", "ref", - "references", "referencing", "reindex", "relative", - "rename", "repeatable", "replace", "reset", - "restart", "restrict", "result", "return", - "returned_length", "returned_octet_length", "returned_sqlstate", "returns", - "revoke", "right", "role", "rollback", - "rollup", "routine", "routine_catalog", "routine_name", - "routine_schema", "row", "rows", "row_count", - "rule", "savepoint", "scale", "schema", - "schema_name", "scope", "scroll", "search", - "second", "section", "security", "select", - "self", "sensitive", "sequence", "serializable", - "server_name", "session", "session_user", "set", - "setof", "sets", "share", "show", - "similar", "simple", "size", "smallint", - "some", "source", "space", "specific", - "specifictype", "specific_name", "sql", "sqlcode", - "sqlerror", "sqlexception", "sqlstate", "sqlwarning", - "stable", "start", "state", "statement", - "static", "statistics", "stdin", "stdout", - "storage", "strict", "structure", "style", - "subclass_origin", "sublist", "substring", "sum", - "symmetric", "sysid", "system", "system_user", - "table", "table_name", "temp", "template", - "temporary", "terminate", "text", "than", "then", - "time", "timestamp", "timezone_hour", "timezone_minute", - "to", "toast", "trailing", "transaction", - "transactions_committed", "transactions_rolled_back", "transaction_active", "transform", - "transforms", "translate", "translation", "treat", - "trigger", "trigger_catalog", "trigger_name", "trigger_schema", - "trim", "true", "truncate", "trusted", - "type", "uncommitted", "under", "unencrypted", - "union", "unique", "unknown", "unlisten", - "unnamed", "unnest", "until", "update", - "upper", "usage", "user", "user_defined_type_catalog", - "user_defined_type_name", "user_defined_type_schema", "using", "vacuum", - "valid", "validator", "value", "values", - "varchar", "variable", "varying", "verbose", - "version", "view", "volatile", "when", - "whenever", "where", "with", "without", - "work", "write", "year", "zone") - - ); - - $case_insensitive = array( - "VB" => true, - "Pascal" => true, - "PL/I" => true, - "SQL" => true - ); - $ncs = false; - if (array_key_exists($language, $case_insensitive)) - $ncs = true; - - $text = (array_key_exists($language, $preproc))? - preproc_replace($preproc[$language], $text) : - $text; - $text = (array_key_exists($language, $keywords))? - keyword_replace($keywords[$language], $text, $ncs) : - $text; - - return $text; -} - - -function rtrim1($span, $lang, $ch) -{ - return syntax_highlight_helper(substr($span, 0, -1), $lang); -} - - -function rtrim1_htmlesc($span, $lang, $ch) -{ - return htmlspecialchars(substr($span, 0, -1)); -} - - -function sch_rtrim1($span, $lang, $ch) -{ - return sch_syntax_helper(substr($span, 0, -1)); -} - - -function rtrim2($span, $lang, $ch) -{ - return substr($span, 0, -2); -} - - -function syn_proc($span, $lang, $ch) -{ - return syntax_highlight_helper($span, $lang); -} - -function dash_putback($span, $lang, $ch) -{ - return syntax_highlight_helper('-' . $span, $lang); -} - -function slash_putback($span, $lang, $ch) -{ - return syntax_highlight_helper('/' . $span, $lang); -} - -function slash_putback_rtrim1($span, $lang, $ch) -{ - return rtrim1('/' . $span, $lang, $ch); -} - -function lparen_putback($span, $lang, $ch) -{ - return syntax_highlight_helper('(' . $span, $lang); -} - -function lparen_putback_rtrim1($span, $lang, $ch) -{ - return rtrim1('(' . $span, $lang, $ch); -} - -function prepend_xml_opentag($span, $lang, $ch) -{ - return '<span class="xml_tag"><' . $span; -} - -function proc_void($span, $lang, $ch) -{ - return $span; -} - - -/** - * Syntax highlight function - * Does the bulk of the syntax highlighting by lexing the input - * string, then calling the helper function to highlight keywords. - */ -function SyntaxHighlight($text, $language) -{ - if ($language == "Plain Text") return $text; - - define("normal_text", 1, true); - define("dq_literal", 2, true); - define("dq_escape", 3, true); - define("sq_literal", 4, true); - define("sq_escape", 5, true); - define("slash_begin", 6, true); - define("star_comment", 7, true); - define("star_end", 8, true); - define("line_comment", 9, true); - define("html_entity", 10, true); - define("lc_escape", 11, true); - define("block_comment",12, true); - define("paren_begin", 13, true); - define("dash_begin", 14, true); - define("bt_literal", 15, true); - define("bt_escape", 16, true); - define("xml_tag_begin",17, true); - define("xml_tag", 18, true); - define("xml_pi", 19, true); - define("sch_normal", 20, true); - define("sch_stresc", 21, true); - define("sch_idexpr", 22, true); - define("sch_numlit", 23, true); - define("sch_chrlit", 24, true); - define("sch_strlit", 25, true); - - $initial_state["Scheme"] = sch_normal; - - $sch[sch_normal][0] = sch_normal; - $sch[sch_normal]['"'] = sch_strlit; - $sch[sch_normal]["#"] = sch_chrlit; - $sch[sch_normal]["0"] = sch_numlit; - $sch[sch_normal]["1"] = sch_numlit; - $sch[sch_normal]["2"] = sch_numlit; - $sch[sch_normal]["3"] = sch_numlit; - $sch[sch_normal]["4"] = sch_numlit; - $sch[sch_normal]["5"] = sch_numlit; - $sch[sch_normal]["6"] = sch_numlit; - $sch[sch_normal]["7"] = sch_numlit; - $sch[sch_normal]["8"] = sch_numlit; - $sch[sch_normal]["9"] = sch_numlit; - - $sch[sch_strlit]['"'] = sch_normal; - $sch[sch_strlit]["\n"] = sch_normal; - $sch[sch_strlit]["\\"] = sch_stresc; - $sch[sch_strlit][0] = sch_strlit; - - $sch[sch_chrlit][" "] = sch_normal; - $sch[sch_chrlit]["\t"] = sch_normal; - $sch[sch_chrlit]["\n"] = sch_normal; - $sch[sch_chrlit]["\r"] = sch_normal; - $sch[sch_chrlit][0] = sch_chrlit; - - $sch[sch_numlit][" "] = sch_normal; - $sch[sch_numlit]["\t"] = sch_normal; - $sch[sch_numlit]["\n"] = sch_normal; - $sch[sch_numlit]["\r"] = sch_normal; - $sch[sch_numlit][0] = sch_numlit; - - // - // State transitions for C - // - $c89[normal_text]["\""] = dq_literal; - $c89[normal_text]["'"] = sq_literal; - $c89[normal_text]["/"] = slash_begin; - $c89[normal_text][0] = normal_text; - - $c89[dq_literal]["\""] = normal_text; - $c89[dq_literal]["\n"] = normal_text; - $c89[dq_literal]["\\"] = dq_escape; - $c89[dq_literal][0] = dq_literal; - - $c89[dq_escape][0] = dq_literal; - - $c89[sq_literal]["'"] = normal_text; - $c89[sq_literal]["\n"] = normal_text; - $c89[sq_literal]["\\"] = sq_escape; - $c89[sq_literal][0] = sq_literal; - - $c89[sq_escape][0] = sq_literal; - - $c89[slash_begin]["*"] = star_comment; - $c89[slash_begin][0] = normal_text; - - $c89[star_comment]["*"] = star_end; - $c89[star_comment][0] = star_comment; - - $c89[star_end]["/"] = normal_text; - $c89[star_end]["*"] = star_end; - $c89[star_end][0] = star_comment; - - // - // State transitions for C++ - // Inherit transitions from C, and add line comment support - // - $cpp = $c89; - $cpp[slash_begin]["/"] = line_comment; - $cpp[line_comment]["\n"] = normal_text; - $cpp[line_comment]["\\"] = lc_escape; - $cpp[line_comment][0] = line_comment; - - $cpp[lc_escape]["\r"] = lc_escape; - $cpp[lc_escape][0] = line_comment; - - // - // State transitions for C99. - // C99 supports line comments like C++ - // - $c99 = $cpp; - - // State transitions for PL/I - // Kinda like C - $pli = $c89; - - // - // State transitions for PHP - // Inherit transitions from C++, and add perl-style line comment support - $php = $cpp; - $php[normal_text]["#"] = line_comment; - $php[sq_literal]["\n"] = sq_literal; - $php[dq_literal]["\n"] = dq_literal; - - // - // State transitions for Perl - $perl[normal_text]["#"] = line_comment; - $perl[normal_text]["\""] = dq_literal; - $perl[normal_text]["'"] = sq_literal; - $perl[normal_text][0] = normal_text; - - $perl[dq_literal]["\""] = normal_text; - $perl[dq_literal]["\\"] = dq_escape; - $perl[dq_literal][0] = dq_literal; - - $perl[dq_escape][0] = dq_literal; - - $perl[sq_literal]["'"] = normal_text; - $perl[sq_literal]["\\"] = sq_escape; - $perl[sq_literal][0] = sq_literal; - - $perl[sq_escape][0] = sq_literal; - - $perl[line_comment]["\n"] = normal_text; - $perl[line_comment][0] = line_comment; - - $mirc[normal_text]["\""] = dq_literal; - $mirc[normal_text][";"] = line_comment; - $mirc[normal_text][0] = normal_text; - - $mirc[dq_literal]["\""] = normal_text; - $mirc[dq_literal]["\\"] = dq_escape; - $mirc[dq_literal][0] = dq_literal; - - $mirc[dq_escape][0] = dq_literal; - - $mirc[line_comment]["\n"] = normal_text; - $mirc[line_comment][0] = line_comment; - - $ruby = $perl; - - $python = $perl; - - $java = $cpp; - - $vb = $perl; - $vb[normal_text]["#"] = normal_text; - $vb[normal_text]["'"] = line_comment; - - $cs = $java; - - $pascal = $c89; - $pascal[normal_text]["("] = paren_begin; - $pascal[normal_text]["/"] = slash_begin; - $pascal[normal_text]["{"] = block_comment; - - $pascal[paren_begin]["*"] = star_comment; - $pascal[paren_begin]["'"] = sq_literal; - $pascal[paren_begin]['"'] = dq_literal; - $pascal[paren_begin][0] = normal_text; - - $pascal[slash_begin]["'"] = sq_literal; - $pascal[slash_begin]['"'] = dq_literal; - $pascal[slash_begin]['/'] = line_comment; - $pascal[slash_begin][0] = normal_text; - - $pascal[star_comment]["*"] = star_end; - $pascal[star_comment][0] = star_comment; - - $pascal[block_comment]["}"] = normal_text; - $pascal[block_comment][0] = block_comment; - - $pascal[line_comment]["\n"] = normal_text; - $pascal[line_comment][0] = line_comment; - - $pascal[star_end][")"] = normal_text; - $pascal[star_end]["*"] = star_end; - $pascal[star_end][0] = star_comment; - - $sql[normal_text]['"'] = dq_literal; - $sql[normal_text]["'"] = sq_literal; - $sql[normal_text]['`'] = bt_literal; - $sql[normal_text]['-'] = dash_begin; - $sql[normal_text][0] = normal_text; - - $sql[dq_literal]['"'] = normal_text; - $sql[dq_literal]['\\'] = dq_escape; - $sql[dq_literal][0] = dq_literal; - - $sql[sq_literal]["'"] = normal_text; - $sql[sq_literal]['\\'] = sq_escape; - $sql[sq_literal][0] = sq_literal; - - $sql[bt_literal]['`'] = normal_text; - $sql[bt_literal]['\\'] = bt_escape; - $sql[bt_literal][0] = bt_literal; - - $sql[dq_escape][0] = dq_literal; - $sql[sq_escape][0] = sq_literal; - $sql[bt_escape][0] = bt_literal; - - $sql[dash_begin]["-"] = line_comment; - $sql[dash_begin][0] = normal_text; - - $sql[line_comment]["\n"] = normal_text; - $sql[line_comment]["\\"] = lc_escape; - $sql[line_comment][0] = line_comment; - - $sql[lc_escape]["\r"] = lc_escape; - $sql[lc_escape][0] = line_comment; - - $xml[normal_text]["<"] = xml_tag_begin; - $xml[normal_text]["&"] = html_entity; - $xml[normal_text][0] = normal_text; - $xml[html_entity][";"] = normal_text; - $xml[html_entity]["<"] = xml_tag_begin; - $xml[html_entity][0] = html_entity; - $xml[xml_tag_begin]["?"] = xml_pi; - $xml[xml_tag_begin]["!"] = line_comment; - $xml[xml_tag_begin][0] = xml_tag; - $xml[xml_tag][">"] = normal_text; - $xml[xml_tag]["\""] = dq_literal; - $xml[xml_tag]["'"] = sq_literal; - $xml[xml_tag][0] = xml_tag; - $xml[xml_pi][">"] = normal_text; - $xml[xml_pi][0] = xml_tag; - $xml[line_comment][">"] = normal_text; - $xml[line_comment][0] = line_comment; - $xml[dq_literal]["\""] = xml_tag; - $xml[dq_literal]["&"] = dq_escape; - $xml[dq_literal][0] = dq_literal; - $xml[sq_literal]["'"] = xml_tag; - $xml[sq_literal]["&"] = sq_escape; - $xml[sq_literal][0] = sq_literal; - $xml[dq_escape][";"] = dq_literal; - $xml[dq_escape][0] = dq_escape; - - // - // Main state transition table - // - $states = array( - "C89" => $c89, - "C" => $c99, - "C++" => $cpp, - "PHP" => $php, - "Perl" => $perl, - "Java" => $java, - "VB" => $vb, - "C#" => $cs, - "Ruby" => $ruby, - "Python" => $python, - "Pascal" => $pascal, - "mIRC" => $mirc, - "PL/I" => $pli, - "SQL" => $sql, - "XML" => $xml, - "Scheme" => $sch - ); - - - // - // Process functions - // - $process["C89"][normal_text][sq_literal] = "rtrim1"; - $process["C89"][normal_text][dq_literal] = "rtrim1"; - $process["C89"][normal_text][slash_begin] = "rtrim1"; - $process["C89"][normal_text][0] = "syn_proc"; - - $process["C89"][slash_begin][star_comment] = "rtrim1"; - $process["C89"][slash_begin][0] = "slash_putback"; - - $process["Scheme"][sch_normal][sch_strlit] = "sch_rtrim1"; - $process["Scheme"][sch_normal][sch_chrlit] = "sch_rtrim1"; - $process["Scheme"][sch_normal][sch_numlit] = "sch_rtrim1"; - - $process["SQL"][normal_text][sq_literal] = "rtrim1"; - $process["SQL"][normal_text][dq_literal] = "rtrim1"; - $process["SQL"][normal_text][bt_literal] = "rtrim1"; - $process["SQL"][normal_text][dash_begin] = "rtrim1"; - $process["SQL"][normal_text][0] = "syn_proc"; - - $process["SQL"][dash_begin][line_comment] = "rtrim1"; - $process["SQL"][dash_begin][0] = "dash_putback"; - - $process["PL/I"] = $process["C89"]; - - $process["C++"] = $process["C89"]; - $process["C++"][slash_begin][line_comment] = "rtrim1"; - - $process["C"] = $process["C++"]; - - $process["PHP"] = $process["C++"]; - $process["PHP"][normal_text][line_comment] = "rtrim1"; - - $process["Perl"][normal_text][sq_literal] = "rtrim1"; - $process["Perl"][normal_text][dq_literal] = "rtrim1"; - $process["Perl"][normal_text][line_comment] = "rtrim1"; - $process["Perl"][normal_text][0] = "syn_proc"; - - $process["Ruby"] = $process["Perl"]; - $process["Python"] = $process["Perl"]; - - $process["mIRC"][normal_text][dq_literal] = "rtrim1"; - $process["mIRC"][normal_text][line_comment] = "rtrim1"; - $process["mIRC"][normal_text][0] = "syn_proc"; - - $process["VB"] = $process["Perl"]; - - $process["Java"] = $process["C++"]; - - $process["C#"] = $process["Java"]; - - $process["Pascal"] = $process["C++"]; - $process["Pascal"][normal_text][line_comment] = "rtrim1"; - $process["Pascal"][normal_text][block_comment] = "rtrim1"; - $process["Pascal"][normal_text][paren_begin] = "rtrim1"; - $process["Pascal"][slash_begin][sq_literal] = "slash_putback_rtrim1"; - $process["Pascal"][slash_begin][dq_literal] = "slash_putback_rtrim1"; - $process["Pascal"][slash_begin][0] = "slash_putback"; - $process["Pascal"][paren_begin][sq_literal] = "lparen_putback_rtrim1"; - $process["Pascal"][paren_begin][dq_literal] = "lparen_putback_rtrim1"; - $process["Pascal"][paren_begin][star_comment] = "rtrim1"; - $process["Pascal"][paren_begin][0] = "lparen_putback"; - - $process["XML"][normal_text][xml_tag_begin] = "rtrim1"; - $process["XML"][normal_text][html_entity] = "rtrim1"; - $process["XML"][html_entity][xml_tag_begin] = "rtrim1"; - $process["XML"][html_entity][0] = "proc_void"; - $process["XML"][xml_tag_begin][xml_tag] = "prepend_xml_opentag"; - $process["XML"][xml_tag_begin][xml_pi] = "rtrim1"; - $process["XML"][xml_tag_begin][line_comment] = "rtrim1"; - $process["XML"][line_comment][normal_text] = "rtrim1_htmlesc"; - $process["XML"][xml_tag][normal_text] = "rtrim1"; - $process["XML"][xml_tag][dq_literal] = "rtrim1"; - $process["XML"][dq_literal][xml_tag] = "rtrim1"; - $process["XML"][dq_literal][dq_escape] = "rtrim1"; - - $process_end["C89"] = "syntax_highlight_helper"; - $process_end["C++"] = $process_end["C89"]; - $process_end["C"] = $process_end["C89"]; - $process_end["PHP"] = $process_end["C89"]; - $process_end["Perl"] = $process_end["C89"]; - $process_end["Java"] = $process_end["C89"]; - $process_end["VB"] = $process_end["C89"]; - $process_end["C#"] = $process_end["C89"]; - $process_end["Ruby"] = $process_end["C89"]; - $process_end["Python"] = $process_end["C89"]; - $process_end["Pascal"] = $process_end["C89"]; - $process_end["mIRC"] = $process_end["C89"]; - $process_end["PL/I"] = $process_end["C89"]; - $process_end["SQL"] = $process_end["C89"]; - $process_end["Scheme"] = "sch_syntax_helper"; - - - $edges["C89"][normal_text .",". dq_literal] = '<span class="literal">"'; - $edges["C89"][normal_text .",". sq_literal] = '<span class="literal">\''; - $edges["C89"][slash_begin .",". star_comment] = '<span class="comment">/*'; - $edges["C89"][dq_literal .",". normal_text] = '</span>'; - $edges["C89"][sq_literal .",". normal_text] = '</span>'; - $edges["C89"][star_end .",". normal_text] = '</span>'; - - $edges["Scheme"][sch_normal .",". sch_strlit] = '<span class="sch_str">"'; - $edges["Scheme"][sch_normal .",". sch_numlit] = '<span class="sch_num">'; - $edges["Scheme"][sch_normal .",". sch_chrlit] = '<span class="sch_chr">#'; - $edges["Scheme"][sch_strlit .",". sch_normal] = '</span>'; - $edges["Scheme"][sch_numlit .",". sch_normal] = '</span>'; - $edges["Scheme"][sch_chrlit .",". sch_normal] = '</span>'; - - $edges["SQL"][normal_text .",". dq_literal] = '<span class="literal">"'; - $edges["SQL"][normal_text .",". sq_literal] = '<span class="literal">\''; - $edges["SQL"][dash_begin .",". line_comment] = '<span class="comment">--'; - $edges["SQL"][normal_text .",". bt_literal] = '`'; - $edges["SQL"][dq_literal .",". normal_text] = '</span>'; - $edges["SQL"][sq_literal .",". normal_text] = '</span>'; - $edges["SQL"][line_comment .",". normal_text] = '</span>'; - - $edges["PL/I"] = $edges["C89"]; - - $edges["C++"] = $edges["C89"]; - $edges["C++"][slash_begin .",". line_comment] = '<span class="comment">//'; - $edges["C++"][line_comment .",". normal_text] = '</span>'; - - $edges["C"] = $edges["C++"]; - - $edges["PHP"] = $edges["C++"]; - $edges["PHP"][normal_text .",". line_comment] = '<span class="comment">#'; - - $edges["Perl"][normal_text .",". dq_literal] = '<span class="literal">"'; - $edges["Perl"][normal_text .",". sq_literal] = '<span class="literal">\''; - $edges["Perl"][dq_literal .",". normal_text] = '</span>'; - $edges["Perl"][sq_literal .",". normal_text] = '</span>'; - $edges["Perl"][normal_text .",". line_comment] = '<span class="comment">#'; - $edges["Perl"][line_comment .",". normal_text] = '</span>'; - - $edges["Ruby"] = $edges["Perl"]; - - $edges["Python"] = $edges["Perl"]; - - $edges["mIRC"][normal_text .",". dq_literal] = '<span class="literal">"'; - $edges["mIRC"][normal_text .",". line_comment] = '<span class="comment">;'; - $edges["mIRC"][dq_literal .",". normal_text] = '</span>'; - $edges["mIRC"][line_comment .",". normal_text] = '</span>'; - - $edges["VB"] = $edges["Perl"]; - $edges["VB"][normal_text .",". line_comment] = '<span class="comment">\''; - - $edges["Java"] = $edges["C++"]; - - $edges["C#"] = $edges["Java"]; - - $edges["Pascal"] = $edges["C89"]; - $edges["Pascal"][paren_begin .",". star_comment] = '<span class="comment">(*'; - $edges["Pascal"][paren_begin .",". dq_literal] = '<span class="literal">"'; - $edges["Pascal"][paren_begin .",". sq_literal] = '<span class="literal">\''; - $edges["Pascal"][slash_begin .",". dq_literal] = '<span class="literal">"'; - $edges["Pascal"][slash_begin .",". sq_literal] = '<span class="literal">\''; - $edges["Pascal"][slash_begin .",". line_comment] = '<span class="comment">//'; - $edges["Pascal"][normal_text . "," . block_comment] = '<span class="comment">{'; - $edges["Pascal"][line_comment . "," . normal_text] = '</span>'; - $edges["Pascal"][block_comment . "," . normal_text] = '</span>'; - - $edges["XML"][normal_text . "," . html_entity] = '<span class="html_entity">&'; - $edges["XML"][html_entity . "," . normal_text] = '</span>'; - $edges["XML"][html_entity . "," . xml_tag_begin] = '</span>'; - $edges["XML"][xml_tag . "," . normal_text] = '></span>'; - $edges["XML"][xml_tag_begin . "," . xml_pi] = '<span class="xml_pi"><?'; - $edges["XML"][xml_tag_begin . "," . line_comment] = '<span class="comment"><!'; - $edges["XML"][line_comment . "," . normal_text] = '></span>'; - $edges["XML"][xml_tag .",". dq_literal] = '<span class="literal">"'; - $edges["XML"][dq_literal . "," . xml_tag] = '"</span>'; - $edges["XML"][dq_literal . "," . dq_escape] = '<span class="html_entity">&'; - $edges["XML"][dq_escape . "," . dq_literal] = '</span>'; - $edges["XML"][xml_tag .",". sq_literal] = '<span class="literal">\''; - $edges["XML"][sq_literal . "," . xml_tag] = '\'</span>'; - $edges["XML"][sq_literal . "," . sq_escape] = '<span class="html_entity">&'; - $edges["XML"][sq_escape . "," . sq_literal] = '</span>'; - - // - // The State Machine - // - if (array_key_exists($language, $initial_state)) - $state = $initial_state[$language]; - else - $state = normal_text; - $output = ""; - $span = ""; - while (strlen($text) > 0) - { - $ch = substr($text, 0, 1); - $text = substr($text, 1); - - $oldstate = $state; - $state = (array_key_exists($ch, $states[$language][$state]))? - $states[$language][$state][$ch] : - $states[$language][$state][0]; - - $span .= $ch; - - if ($oldstate != $state) - { - if (array_key_exists($language, $process) && - array_key_exists($oldstate, $process[$language])) - { - if (array_key_exists($state, $process[$language][$oldstate])) - { - $pf = $process[$language][$oldstate][$state]; - $output .= $pf($span, $language, $ch); - } - else - { - $pf = $process[$language][$oldstate][0]; - $output .= $pf($span, $language, $ch); - } - } - else - { - $output .= $span; - } - - if (array_key_exists($language, $edges) && - array_key_exists("$oldstate,$state", $edges[$language])) - $output .= $edges[$language]["$oldstate,$state"]; - - $span = ""; - } - } - - if (array_key_exists($language, $process_end) && $state == normal_text) - $output .= $process_end[$language]($span, $language); - else - $output .= $span; - - if ($state != normal_text) - { - if (array_key_exists($language, $edges) && - array_key_exists("$state," . normal_text, $edges[$language])) - $output .= $edges[$language]["$state," . normal_text]; - } - - return $output; -} - -?> diff --git a/paste/include/pastify.inc b/paste/include/pastify.inc index 321fe51..bb3d2f9 100644 --- a/paste/include/pastify.inc +++ b/paste/include/pastify.inc @@ -4,6 +4,7 @@ This software is licensed through a BSD-style License. http://www.opensource.org/licenses/bsd-license.php Copyright (c) 2002 - 2009 Jacob D. Cohen +Copyright (c) 2009 Alexander Sulfrian All rights reserved. Redistribution and use in source and binary forms, with or without @@ -32,7 +33,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -require_once("highlight.inc"); +require_once("class.geshi.php"); function PastifyText($text, $language, $desc) { @@ -47,11 +48,8 @@ function PastifyText($text, $language, $desc) $lineout = ""; # Do the actual syntax highlighting - $output = SyntaxHighlight($text, $language); - - for ($i = 1; $i < $nlines; ++$i) - $lineout .= "$i\n"; - $lineout .= "$i"; + $geshi = new GeSHi($text, $language); + $output = $geshi->parse_code(); $html = <<<EOH <html> @@ -74,12 +72,7 @@ function PastifyText($text, $language, $desc) </table> </div> -<table border="0" cellpadding="1" cellspacing="2"> -<tr> - <td><pre class="code">$lineout</pre></td> - <td width="100%"><pre class="code" id="codemain">$output</pre></td> -</tr> -</table> +$output </html> EOH; |